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 flags to run CI tests locally #596

Merged
merged 4 commits into from
May 30, 2024

Conversation

thibaultdvx
Copy link
Collaborator

@thibaultdvx thibaultdvx commented May 28, 2024

I propose to add two flags to the pytest command lines to enable developers to run functional tests locally without changing the CI data:

  • --no-gpu enables to run successfully a test on a cpu-only device without changing gpu to false in the maps.json file.
  • --adapt-base-dir enables to run successfully a test without changing the paths in the maps.json file.

A developer could then run a test with something like:

poetry run pytest --verbose \ 
 --basetemp=/tmp/train \
 --input_data_directory=/Users/thibault.devarax/Desktop/code/clinicadl_data_ci/data_ci/ \
 --no-gpu \
 --adapt-base-dir \
 tests/test_train_ae.py

These two options work by virtually modifying the CI data (e.g. gpu will be set to false). So, I do agree that this is risky. But, I find this solution better than concretely modifying the CI data.
Let me stress that these flags should not be used for the final CI tests run on GitHub and should be only helpful when a developer wants to run the tests locally.

Anyways, this is just a suggestion, so feel free to comment or offer other solutions. Once we agree on a solution, I will extend it to all the tests.

@thibaultdvx thibaultdvx added the enhancement New feature or request label May 28, 2024
Copy link
Collaborator

@camillebrianceau camillebrianceau left a comment

Choose a reason for hiding this comment

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

LGTM!

@thibaultdvx thibaultdvx merged commit 52d7561 into aramis-lab:dev May 30, 2024
21 checks passed
@thibaultdvx thibaultdvx deleted the flag_for_local_tests branch May 30, 2024 09:34
@thibaultdvx thibaultdvx mentioned this pull request May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants