[SERVER-5702] Unit test framework improvements (unittest) Created: 25/Apr/12  Updated: 11/Jul/16  Resolved: 17/Jan/13

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 2.2.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Andy Schwerin Assignee: Andy Schwerin
Resolution: Done Votes: 0
Labels: tracking-ticket
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-13576 Add lightweight instrumentation 'prob... Closed
is related to SERVER-5998 smoke.py should consult build/unittes... Closed
Participants:

 Description   

It needs to be easier to implement tests of individual modules, and get those tests executed by the automated build framework. We may already have some of the requisite parts on hand, or could get them by making small modifications to existing systems. Other parts may require (or deserve) significant development effort.

Features of such a system include:

  • Ability to write tests in C++ of individual C++ classes/minor components.
  • Quick compile and linking time of such tests (for dev-test cycle).
  • Ability to identify those tests to the automated test system, for execution during automated build.
  • Ability to write tests in a scripting language (python?) when that is a more appropriate way to test module functionality (i.e., testing crash/abend paths).


 Comments   
Comment by Eliot Horowitz (Inactive) [ 17/Jan/13 ]

Did you do enough that you'd resolve this, and you can add other tickets for new features?

Comment by auto [ 04/Jun/12 ]

Author:

{u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: SERVER-5702 Add mongo/util/text.cpp to foundation library, for Windows compilation.
Branch: master
https://github.com/mongodb/mongo/commit/b4fcede6c839ea0afcc217063a2309281ae99fc2

Comment by auto [ 04/Jun/12 ]

Author:

{u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: Add vars.cpp to framework library, rename to mutexdebugger.cpp.

SERVER-5702.
Branch: master
https://github.com/mongodb/mongo/commit/dd9649652b3cf603a1a09490354a1c2e0dc1c98d

Comment by auto [ 04/Jun/12 ]

Author:

{u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: SERVER-5702 Respond to late-arriving codereview comments.
Branch: master
https://github.com/mongodb/mongo/commit/715e9514b5ac623d71a9f0c87f7dc803d4c050fe

Comment by auto [ 04/Jun/12 ]

Author:

{u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: SERVER-5702 Whitespace fixup.
Branch: master
https://github.com/mongodb/mongo/commit/5975ab63216078b444b531fb87486a4c1e7bf64b

Comment by auto [ 04/Jun/12 ]

Author:

{u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: SERVER-5702 Fix Build Break

SCons has decidedly mixed feelings about recursively substituting expansion
variables in env.Alias() statements. Replace "$UNITTEST_ALIAS" with "unittests"
in SConstruct.
Branch: master
https://github.com/mongodb/mongo/commit/82811e8dc84a7f59e8f1dc00187a3863f8fb349f

Comment by auto [ 04/Jun/12 ]

Author:

{u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: SERVER-5702: Add ability to register unit tests in SCons.

Tests are registered with env.RegisterUnitTest(), or by compiling a C++ unit
test with
env.CppUnitTest('test_name', [test_source_list], LIBDEPS=[...])

The result is that SCons knows how to build a file "build/unittests.txt", one line per test.
Branch: master
https://github.com/mongodb/mongo/commit/82544c7d08c033184104a5c9ab115e4047fdbdbd

Comment by auto [ 04/Jun/12 ]

Author:

{u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: SERVER-5702: C++ unit test framework that can be compiled separately.

Includes a unit test of the unit test framework written in the unit test
framework, itself.
Branch: master
https://github.com/mongodb/mongo/commit/c04922ad14ebe43d99ba056b7b3ae79860b8cd91

Comment by auto [ 31/May/12 ]

Author:

{u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: Cobble together a logging/assertion library.

Work toward SERVER-5702.
Branch: master
https://github.com/mongodb/mongo/commit/a42e4da9aef50df7c6a776cc64e624e1f13e4a6b

Comment by auto [ 31/May/12 ]

Author:

{u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: Only include cmdline.h in debug_util.cpp if you need it.

Work toward SERVER-5702.
Branch: master
https://github.com/mongodb/mongo/commit/ba2e27e2843d1c7518059cc9565a07aefc4b0262

Comment by auto [ 31/May/12 ]

Author:

{u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: Missed include of util.h, part of SERVER-5702.
Branch: master
https://github.com/mongodb/mongo/commit/7b6db539971b671d6e05d8de0c5182a263f856a7

Comment by auto [ 31/May/12 ]

Author:

{u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: Rename sayDbContext() to logContext(), and move from util.

{h,cpp} to log.{h,cpp}

.

Remove now-empty util.h.

Work toward SERVER-5702.
Branch: master
https://github.com/mongodb/mongo/commit/ef4d5cbf766a99dddb886ffbadceef0def82beb8

Comment by auto [ 25/Apr/12 ]

Author:

{u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: Limit exitCleanly() and ntservice module to mongos and mongod.

The notions of exitCleanly() versus dbexit() vs _exit() in the scope of mongod
shutdown need to be reconsidered. This patch just attempts to limit the scope
of the issue to mongos and mongod. It would be better to limit it to just
mongod, but the implementation of the ntservice behavior doesn't currently
support that.

SERVER-5520, SERVER-5702
Branch: master
https://github.com/mongodb/mongo/commit/127b0b78ae3ac9b2bc0a54bcd3c097c0e2a91e79

Generated at Thu Feb 08 03:09:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.