Test Organization
Running all the testsscons smoke smokeDisk smokeTool smokeAuth startMongod smokeClient smokeJs scons startMongodSmallOplog smokeJs scons startMongod smokeJsSlowNightly scons smokeTool scons smokeReplSets scons smokeDur scons mongosTest smokeSharding scons smokeRepl smokeClone scons startMongod smokeParallel smoke.pysmoke.py lets you run a subsets of the tests in jstests/. When it is running tests, it starts up an instance of mongod, runs the tests, and then shuts it down again. You can run it while running other instances of MongoDB on the same machine: it uses ports in the 30000 range and its own data directories. For the moment, smoke.py must be run from the top-level directory of a MongoDB source repository. This directory must contain at least the mongo and mongod binaries. To run certain tests, you'll also need to build the tools and mongos. It's a good idea to run scons . before running the tests. To run smoke.py you'll need a recent version of PyMongo. To see the possible options, run: $ python buildscripts/smoke.py --help Usage: smoke.py [OPTIONS] ARGS* Options: -h, --help show this help message and exit --mode=MODE If "files", ARGS are filenames; if "suite", ARGS are sets of tests (suite) --test-path=TEST_PATH Path to the test executables to run, currently only used for 'client' (none) --mongod=MONGOD_EXECUTABLE Path to mongod to run (/Users/mike/10gen/mongo/mongod) --port=MONGOD_PORT Port the mongod will bind to (32000) --mongo=SHELL_EXECUTABLE Path to mongo, for .js test files (/Users/mike/10gen/mongo/mongo) --continue-on-failure If supplied, continue testing even after a test fails --from-file=FILE Run tests/suites named in FILE, one test per line, '-' means stdin --smoke-db-prefix=SMOKE_DB_PREFIX Prefix to use for the mongods' dbpaths ('') --small-oplog Run tests with master/slave replication & use a small oplog
To run specific tests, use the --mode=files option: python buildscripts/smoke.py --mode=files jstests/find1.js You can specify as many files as you want. You can also run a suite of tests. Suites are predefined and include:
To run a suite, specify the suite's name: python buildscripts/smoke.py js Running a jstest manuallyYou can run a jstest directly from the shell, for example: mongo --nodb jstests/replsets/replsetarb3.js Running the C++ unit testsThe tests under jstests/ folder are written in mongo shell javascript. However there are a set of C++ unit tests also. To run them: scons test ./test See Also |

PLEASE POST QUESTIONS IN THE USER GROUPS FORUM. Post non-question comments and helpful hints here.
blog comments powered by Disqus