No Timing Found: Troubleshooting
If you are attempting to split your tests across containers with pytest and encountering issues, such as:
No timing found for "tests/commands/__init__.py"
No timing found for "tests/commands/test_1.py"
No timing found for "tests/commands/test_2.py"
There may be a few adjustments you need to make.
Are you setting a custom working_directory?
If so, you may need to adjust the file paths that are saving to your test metadata XML file. Alternatively, if you are able to, try working out of the standard working directory we set for a container to see if that helps (you can do this by removing any instances of
working_directory in your test run job).
Where does your pytest.ini live?
To get test splitting to work correctly it needs to be in the root directory of where you are running the tests from. If it's not, you may need to run the following command before you test run command:
cp -f .circleci/resources/pytest_build_config.ini pytest.ini
.circleci/resources/pytest_build_config.ini path may need to be replaced to point to where it's located in your project.
Are you setting the junit_family in your pytest.ini?
Check to see if you have something like
junit_family=legacy set in your pytest.ini file. More information here:
Search for "families" to see the relevant information.
Are your tests being skipped?
If you are skipping specific tests, you may still see the no timing found error for those tests.
Example project that correctly splits by timings
The following is a fork of our sample-python-cfd project that implements splitting:
Example build showing proper test splitting: