Skip to content

CI allow to run only selected tests but on all random seeds #23026

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

Merged
merged 37 commits into from
Apr 20, 2022

Conversation

jeremiedbb
Copy link
Member

When using the global_random_seed fixture in new tests, we check that it works locally on all random seeds but it can happen that some seeds still fail on different platform (see #23014).

This PR gives the possibility to run the CI (azure) on only a given set of tests, for all random seeds, based on the commit message. It will trigger if the commit message is of the form:

<title> [all random seeds]
<test_name_1>
<test_name_2>
...

@jeremiedbb
Copy link
Member Author

TODO: skip azure linting (partially because next jobs depend on its success)
TODO: skip circleci

@jeremiedbb
Copy link
Member Author

@thomasjpfan do you think it would be possible to create a workflow that triggers on some comment in the PR and pushes to the branch ?

Also do you know why the linux docker job fails because I'm just trying to add a new env var ?

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

@thomasjpfan do you think it would be possible to create a workflow that triggers on some comment in the PR and pushes to the branch ?

Yes. The easiest way to do it is with GitHub Actions. Although, we would need to be careful about who can activate the command tho.

@@ -37,6 +37,7 @@ jobs:
TEST_DOCSTRINGS: 'false'
CREATE_ISSUE_ON_TRACKER: 'false'
SHOW_SHORT_SUMMARY: 'false'
SELECTED_TESTS: $[ dependencies.git_commit.outputs['commit.selected'] ]
Copy link
Member

Choose a reason for hiding this comment

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

Rather than having git_commit parses the commit message and pass it here, can we have a new step in poxis.yml that parses the commit message and pass it along to the next steps?

The upside is that the test configuration is responsible for parsing the commit to select tests and not the git_commit job. The downside is that we need to repeat a little bit of code for extracting the commit, but I think it's easier for future maintainers compared to using a dependencies.git_commit.

@@ -84,6 +85,7 @@ jobs:
-e OPENBLAS_NUM_THREADS=$OPENBLAS_NUM_THREADS
-e SKLEARN_SKIP_NETWORK_TESTS=$SKLEARN_SKIP_NETWORK_TESTS
-e BLAS=$BLAS
-e SELECTED_TESTS=$SELECTED_TESTS
Copy link
Member

Choose a reason for hiding this comment

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

Also do you know why the linux docker job fails because I'm just trying to add a new env var ?

The error is weird. My guess is that the brackets ([]) in $SELECTED_TESTS is making bash parse the command weirdly. Maybe this works:

Suggested change
-e SELECTED_TESTS=$SELECTED_TESTS
-e SELECTED_TESTS="$SELECTED_TESTS"

test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
# <test_name_2>
# ...
if [[ "$COMMIT_MESSAGE" =~ \[all\ random\ seeds\] ]]; then
message=$(echo $COMMIT_MESSAGE | sed -n -e 's/^.*all\ random\ seeds\] //p')
Copy link
Member

@thomasjpfan thomasjpfan Apr 5, 2022

Choose a reason for hiding this comment

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

I think unix commands harder to maintain in the long run. What do you think of using a simple Python script to parse the commit message and return the selected tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, I moved that in a python script

test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
@jeremiedbb jeremiedbb changed the title WIP CI allow to run only selected tests but on all random seeds CI allow to run only selected tests but on all random seeds Apr 11, 2022
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
test_kmeans_plusplus_norms
test_kmeans_elkan_results
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

LGTM as well!

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

Successfully merging this pull request may close these issues.

3 participants