Skip to content
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

Add CI job that fails PRs if tests are taking >1s #663

Open
DominicOram opened this issue Nov 19, 2024 · 2 comments
Open

Add CI job that fails PRs if tests are taking >1s #663

DominicOram opened this issue Nov 19, 2024 · 2 comments
Labels
good first issue Good for newcomers

Comments

@DominicOram
Copy link
Contributor

All unit tests should be fast running and so not take >1s each. If they are taking longer it is most likely due to an issue with poor mocking. To make sure we enforce this we should add a CI check on a PR that confirms that no tests individually took too long.

The durations can be found with pytest -m "not s03" --durations=0 but this isn't very machine readable so it may be worth a look around to see if we can get them out in a nicer way

Acceptance Criteria

  • CI blocks PRs where an individual test is taking longer than 1s
@DominicOram
Copy link
Contributor Author

@callumforrester, thoughts on doing something similar for dodal?

@DominicOram DominicOram added the good first issue Good for newcomers label Nov 19, 2024
@callumforrester
Copy link

I like this idea as long as it's reliable, not sure how consistent CI CPU time is, does it vary a lot depending on cloud load? If so, we could actually profile the tests. But regardless I'm keen on this.

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

No branches or pull requests

2 participants