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

[MRG] Parallelize pytests where applicable #932

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

asoplata
Copy link
Collaborator

@asoplata asoplata commented Nov 8, 2024

No description provided.

@asoplata
Copy link
Collaborator Author

asoplata commented Nov 8, 2024

Based on comparison to other recent test runs, this appears to shave about 3 minutes off of running the tests on the Macos and Linux github action runners. This especially helps speed up local testing. I will test making the same changes to Windows after I try installing it on a local Windows machine.

@asoplata asoplata changed the title feat: add marks and change pytest runs for pll Parallelize pytests where applicable Nov 8, 2024
shell: bash -el {0}
run: |
python -m pytest ./hnn_core/tests/ --cov=hnn_core --cov-report=xml
python -m pytest ./hnn_core/tests/ -m "already_parallel" --cov=hnn_core --cov-report=xml --cov-append
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe we should add this to the Makefile: https://github.com/jonescompneurolab/hnn-core/blob/master/Makefile

then you use the same command locally too. E.g.:

$ make already_parallel_tests

Copy link
Collaborator

Choose a reason for hiding this comment

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

and the make test has a dependency on already_parallel_tests and parallel_tests like so:

tests : already_parallel parallel_tests

could you come up with slightly better names so the distinction between the two categories are clear?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What about @pytest.mark.uses_mpi? That way it is unique, easy to understand (and grep), but also distinct from the other valid decorator @requires_mpi4py.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes, I like that!

@asoplata asoplata changed the title Parallelize pytests where applicable [MRG]Parallelize pytests where applicable Nov 8, 2024
@asoplata asoplata changed the title [MRG]Parallelize pytests where applicable [MRG] Parallelize pytests where applicable Nov 8, 2024
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