-
Notifications
You must be signed in to change notification settings - Fork 33
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
run notebook tests automatically if any notebooks have changed #615
base: main
Are you sure you want to change the base?
run notebook tests automatically if any notebooks have changed #615
Conversation
e086b1d
to
17d2218
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. One clarifying question though.
.github/workflows/unit-tests.yml
Outdated
- name: Check for notebook changes | ||
id: check_notebooks | ||
run: | | ||
if git diff --quiet main HEAD -- '*.ipynb'; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you comment what this if line is doing? Based on the variable getting set on the next line it's the opposite of what I would expect (looking for a match).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'm not sure it's working yet 🤣
Signed-off-by: Peter St. John <pstjohn@nvidia.com>
17d2218
to
361b106
Compare
if: ${{ contains(github.event.pull_request.labels.*.name, 'INCLUDE_NOTEBOOKS_TESTS') }} | ||
if: | | ||
${{ env.STATE_check_notebooks == 'true' || | ||
contains(github.event.pull_request.labels.*.name, 'INCLUDE_NOTEBOOKS_TESTS') }} | ||
env: | ||
BIONEMO_DATA_SOURCE: ngc | ||
run: pytest --nbval-lax -p no:python docs/ sub-packages/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cant we use here
run: ./ci/scripts/run_pytest.sh --skip-slow
instead of
pytest --nbval-lax -p no:python docs/ sub-packages/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there's no option in run_pytest to only run the notebook tests, right? This is currently only running the notebook tests in this step, since the previous step ran all the pytests.
It just seemed more complicated to try to conditionally add that flag than to conditionally run another step
.github/workflows/unit-tests.yml
Outdated
@@ -113,13 +113,19 @@ jobs: | |||
with: | |||
path: ${{ github.run_id }} | |||
|
|||
- name: Check for notebook changes | |||
id: check_notebooks | |||
run: check_notebooks=$(git diff --quiet main HEAD -- '*.ipynb' && echo false || echo true) >> $GITHUB_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would be correct
check_notebooks=$(git diff --quiet main HEAD -- '*.ipynb' && echo false || echo true)
echo "check_notebooks=$check_notebooks" >> $GITHUB_ENV
Signed-off-by: Peter St. John <peterc.stjohn@gmail.com>
Signed-off-by: Peter St. John <peterc.stjohn@gmail.com>
Description
Check and run notebook tests automatically if any *.ipynb files have changed.
Type of changes
CI Pipeline Configuration
Configure CI behavior by applying the relevant labels:
Note
By default, the notebooks validation tests are skipped unless explicitly enabled.
Usage
Pre-submit Checklist