Running Mongo test suites using resmoke.py

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=“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

Hi,

Thanks for your response!

I followed the instructions you provided, as well as the ones found here. I used the r7.0.2 tag in the MongoDB repository and was able to install the necessary Python virtual environment, dependencies, etc.

I successfully ran a suite named query_golden_classic.

My question now is, should I expect the core suite to pass on this version? Are any failures expected?

I’m trying to establish a reference point to compare the original MongoDB with my project.

Currently, when running the core suite with resmoke, I get the following summary: “Summary of core suite: 998 test(s) ran in 321.68 seconds (995 succeeded, 763 were skipped, 2 failed, 1 errored).”

The following tests failed (with exit code):

  • jstests/core/json_schema/logical_keywords.js (1 DB Exception)
  • logical_keywords:ValidateCollections (1 DB Exception)

The following tests had errors:
job0_fixture_teardown
Traceback (most recent call last):
File “/home/pliops/mongo/buildscripts/resmokelib/testing/testcases/fixture.py”, line 71, in run_test
self.fixture.teardown(finished=True)
File “/home/pliops/mongo/buildscripts/resmokelib/testing/fixtures/interface.py”, line 133, in teardown
self._do_teardown(mode=mode)
File “/home/pliops/mongo/buildscripts/resmokelib/testing/fixtures/standalone.py”, line 145, in _do_teardown
raise self.fixturelib.ServerFailure(msg)
buildscripts.resmokelib.errors.ServerFailure: mongod on port 20000 was expected to be running, but wasn’t. Process exited with code -6.

Does this seem right?

Thanks,
Slava