[quote=“Slava_Rozman, post:1, topic:288564, full:true”]MyLowesLife
Hi,
I’m looking to run the available tests using resmoke.py on my mongo based project.
To begin with, I am trying to run the ready made test suites on out-of-the-box mongo project - I get various failures.
is there a guide that explains how to run all/some of the available tests and test suites?
what is the needed configuration for the suites?
[/quote]
Hello,
To run MongoDB tests using resmoke.py
, follow these steps:
Install Dependencies:
First, ensure you have the necessary dependencies installed. You can find them in the etc/pip/dev-requirements.txt
file.
Install the dependencies using pip:
pip install -r etc/pip/dev-requirements.txt
Run Specific Tests:
To see the available options for resmoke.py
, run:
python buildscripts/resmoke.py run --help
To run specific tests, simply list them after the run
command. For example:
python buildscripts/resmoke.py run jstests/core/find1.js jstests/core/explain*.js
Test Suites:
MongoDB has three main categories of tests:
JavaScript tests (in the jstests
directory) for integration testing.
C++ unit tests (old-style) for unit testing.
C++ dbtests (old-style) for unit testing (avoid writing new dbtests).
You can execute JavaScript tests using the mongo
shell directly or use resmoke.py
for a subset of tests.
The jstests/core
directory contains general-purpose tests.
Using mongo
Shell for JavaScript Tests:
Execute JavaScript tests using the mongo
shell:
mongo jstests/core/basic1.js
mongo jstests/core/count.js
Some tests may require specific environments (e.g., authentication, SSL connections). Refer to the test file names for context.
Using resmoke.py
:
resmoke.py
starts an instance of mongod
, runs tests, and shuts down the server.
It uses configurable ports and data directories for each instance.
Run it alongside other mongod
instances on the same machine.
By default, it uses ports in the 20000+ range.
python buildscripts/resmoke.py run <test_files>
Remember to adjust the test suite and configuration based on your project’s needs.
Hope this work for you.
Best regards,
florence023