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

run notebook tests automatically if any notebooks have changed #615

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator

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


- name: Run tests
env:
BIONEMO_DATA_SOURCE: ngc
run: ./ci/scripts/run_pytest.sh --no-nbval --skip-slow

- name: Run notebook tests
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/
Copy link
Collaborator

@dorotat-nv dorotat-nv Jan 17, 2025

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/

Copy link
Collaborator Author

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

Expand All @@ -146,6 +152,5 @@ jobs:
steps:
- name: clean up image
run: docker rmi nemoci.azurecr.io/bionemo:${{ github.run_id }}

# TODO: exclude tests from base image; run tests from github workspace mounted in the image.
# TODO: figure out way of cleaning up working directory (requires sudo or for us to fix file ownership from release container)
Loading