Skip to content

Commit 0e241e3

Browse files
committed
CI: make sure we don't pytest non-notebook documentation pages
1 parent c058dfe commit 0e241e3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ commands =
6969
# Make a list of all the tutorials to be reused in multiple filtering commands below
7070
bash -c 'find tutorials -name "*md" | xargs grep kernelspec: | awk -F :kernelspec: "{print \$1}" > all_tutorials'
7171

72-
# Make a list of the tutorials changed, we only need this in CI. Also deal with grep's non-zero exit code.
73-
bash -c 'if [[ $CI == true ]]; then git fetch origin main --depth=1; git diff origin/main --name-only tutorials | grep ".md" || true; fi > changed_tutorials'
72+
# Make a list of the tutorials changed, we only need this in CI. Also deal with grep's non-zero exit code. Deleted files are ignored.
73+
bash -c 'if [[ $CI == true ]]; then git fetch origin main --depth=1; git diff origin/main --name-only --diff-filter=d tutorials | grep ".md" || true; fi > changed_tutorials'
7474

75-
# We only skip testing untouched tutorials in PRs; in cron and dispatch all should be tested
76-
!buildhtml: bash -c 'if [[ $GITHUB_EVENT_NAME == pull_request && -z "$(grep force_run:all_tests ${GITHUB_EVENT_PATH})" ]]; then cat changed_tutorials; else cat all_tutorials; fi | grep -vf ignore_testing | xargs jupytext --to notebook '
75+
# We only skip testing untouched tutorials in PRs; in cron and dispatch all should be tested. Make sure we don't jupytext non-notebook files.
76+
!buildhtml: bash -c 'if [[ $GITHUB_EVENT_NAME == pull_request && -z "$(grep force_run:all_tests ${GITHUB_EVENT_PATH})" ]]; then grep -f changed_tutorials all_tutorials; else cat all_tutorials; fi | grep -vf ignore_testing | xargs jupytext --to notebook '
7777

7878
!buildhtml: bash -c "echo 'Notebooks ignored (not tested/executed) in this job:\n'; cat ignore_testing | sort | uniq"
7979
!buildhtml: pytest --nbval-lax -vv --suppress-no-test-exit-code --durations=10 tutorials

0 commit comments

Comments
 (0)