Conversation
|
@PeterNerlich interested in your opinion here :) |
|
All the tests fail due to |
Same for me. This is the difference in
|
|
No, I just assume that your container is listening on a different port. Because the settings have been unified, you now have to manually set the port as environment variable in that case, probably |
|
Thank you for reply, now I can run the tests with Were they deterministic in your local environment? After |
|
Damn, it seemed deterministic to me 😅 Can you paste which tests are failing? |
|
These tests are always failing but pass when run individually
These test are always failing and also fail when run individually
These test fail sometimes
|
|
I ran the tests with but ALSO a super long stack trace output of A second run gave me almost the same result, but this time I also have one failure and one error: |
Short description
Refactoring of our test suite to improve test reliability and execution time. Adds a comprehensive guide on how to use the introduced arguments and how to add new tests.
Proposed changes
Unify CI setup and local runs
test_settingsmodule to export the same settings tocircleci_settingsandtest.sh, eliminating duplicated dummy API keys and feature flagsDJANGO_SETTINGS_MODULEintest.shafterrequire_database, which was overriding with the base settingsFix flaky tests and eliminate ordering dependencies
@pytest.mark.order("last")on all transactional tests (needed because the --circleci-parallelize plugin reorders tests by module after pytest-django's collection).--testmon-noselectconflicted with parallel workers, causing sporadicUser.DoesNotExisterrors during fixture setup. Fixed by disabling testmon in parallel mode (-p no:testmon).test_edit_poi_category_was_successfulwas asserting the wrong category name in the success message, and the session-scoped client's message cookie would overflow in the full parallel suite. Fixed by checking database state directly instead of HTML messages.serialized_rollback=Truefrom django_db markers. it is no longer needed because ordering dependencies are eliminated, and removing this argument significantly speeds up transactional teststest_rule_out_false_positiveasxfail(strict=False)because it is non-deterministic by natureImprove test performance
QUICK_ROLESfor faster local iterationImprove test infrastructure
tests/factories.pyfor cleaner test setupstests/constants.py(importable without triggering fixture registration side effects)update_snapshotsargumentDocumentation
docs/src/testing.rstSide effects
Faithfulness to issue description and design
There are no intended deviations from the issue and design.
How to test
Run the test suite on your local machine. See that tests are now deterministic. Try the different options and see that they reduce test execution time:
./tools/test.sh -m unit— unit tests only (seconds)/tools/test.sh -m "not slow"— skip slow parametrized view testsQUICK_ROLES=1 ./tools/test.sh— test only 4 representative rolesResolved issues
Fixes: #2711 (sort of)
Pull Request Review Guidelines