Skip to content

Set up custom coldfront test runner to set fake seed and stress level. #727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Eric-Butcher
Copy link
Contributor

@Eric-Butcher Eric-Butcher commented Jul 15, 2025

This PR includes a custom test runner for coldfront which is a subclass of the default DiscoverRunner. This custom test runner adds flags on the command line to specify the seed used for the random value generation with faker as well as an argument to give a stress level to the tests. This custom test runner will also generate and report each time the test suite is ran what the seed used for faker was regardless of whether or user specified it or not. This closes issue #721.

The only concern with this is that even when specifying a seed manually, there might be an issue if tests are ever run in parallel that might cause inconsistencies.

Some things that might want to be modified:

  1. What to name the file that stores the new test runner code
  2. Whether float or int would be preferred for the seed
  3. Whether to keep the constants for FAKE_SEED and STRESS_LEVEL as variables imported from the module or to make these settings using django.conf.settings

If you like it as is then it should be ok to merge in.

@Eric-Butcher Eric-Butcher marked this pull request as draft July 15, 2025 15:06
@Eric-Butcher Eric-Butcher force-pushed the feature/custom-test-runner branch from 9d8adf8 to e923d17 Compare July 17, 2025 19:23
@Eric-Butcher Eric-Butcher force-pushed the feature/custom-test-runner branch from e923d17 to ad70cb8 Compare July 17, 2025 19:24
@Eric-Butcher Eric-Butcher marked this pull request as ready for review July 17, 2025 19:28
Copy link
Collaborator

@ANekhai ANekhai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just have one quick formatting question. The actual content of the test_runner file looks good to merge for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants