-
Notifications
You must be signed in to change notification settings - Fork 537
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
Split tests for faster execution #22318
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KevinMind
force-pushed
the
parallel-tests
branch
30 times, most recently
from
June 6, 2024 17:33
a10509b
to
fdb5987
Compare
KevinMind
force-pushed
the
parallel-tests
branch
2 times, most recently
from
June 11, 2024 14:32
5f02e40
to
a505868
Compare
This comment was marked as outdated.
This comment was marked as outdated.
KevinMind
force-pushed
the
parallel-tests
branch
2 times, most recently
from
June 11, 2024 17:44
986a556
to
7cf2af0
Compare
KevinMind
force-pushed
the
parallel-tests
branch
3 times, most recently
from
June 12, 2024 13:45
b19d037
to
586926b
Compare
KevinMind
force-pushed
the
parallel-tests
branch
from
June 12, 2024 14:14
586926b
to
95847e7
Compare
diox
reviewed
Jun 12, 2024
diox
reviewed
Jun 12, 2024
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
diox
approved these changes
Jun 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow up of: mozilla/addons#14821
Description
This pull request splits the
test_main
into multiple groups to improve execution time. It introduces thepytest-split
library to distribute the tests across multiple processes. This change will significantly reduce the overall test duration and improve the efficiency of the testing process.Context
We rely on pytest markers to identify tests that should run in a particular group
make test_main
ignores all of the markers we use and can thus be considered the "standard" or "main" tests. The split is only applying to those tests as the largest group with 7k+ tests. Even splitting this group with-n auto
results in 4 cores running 7k tests in roughly 15 or so minutes. by splitting using pytest-split we can get the time down to almost any number we want.Currently the split is somewhat arbitrarily set to 14 but we could even add logic (another PR) to determine the appropriate split based on how many tests there are and how big we want the groups to be. Say no more than 500 tests in a group.
This gives us a lot of control on the time it takes to run the longest test job and let's us scale without creeping up on the runtime.