Skip to content

Commit

Permalink
Merge pull request #297 from firedrakeproject/JDBetteridge/various_ci…
Browse files Browse the repository at this point in the history
…_fixes

Fixed failing notebook tests, updated CI, made tests DRYer
  • Loading branch information
ta440 authored Aug 29, 2022
2 parents 726f372 + 269f540 commit 4639883
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 40 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ jobs:
run: |
cd ..
rm -rf build
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Gusto
run: |
. /home/firedrake/firedrake/bin/activate
Expand All @@ -38,23 +34,19 @@ jobs:
- name: Gusto unit-tests
run: |
. /home/firedrake/firedrake/bin/activate
python $(which firedrake-clean)
python -m pytest -n 12 -v unit-tests
make unit_test PYTEST_ARGS="-n 12 -v"
- name: Gusto integration-tests
run: |
. /home/firedrake/firedrake/bin/activate
python $(which firedrake-clean)
python -m pytest -n 12 -v integration-tests
make integration_test PYTEST_ARGS="-n 12 -v"
- name: Gusto examples
run: |
. /home/firedrake/firedrake/bin/activate
python $(which firedrake-clean)
python -m pytest -n 12 -v examples
- name: Gusto jupyter_notebooks
make example PYTEST_ARGS="-n 12 -v"
- name: Gusto jupyter_notebooks
run: |
. /home/firedrake/firedrake/bin/activate
python $(which firedrake-clean)
python -m pytest --nbval-lax -n 12 -v jupyter_notebooks
make notebook_test PYTEST_ARGS="-n 4 -v"
- name: Lint
if: ${{ always() }}
run: |
Expand Down
20 changes: 13 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,24 @@ lint:
@echo " Linting gusto plotting scripts"
@python3 -m flake8 plotting

test:
@echo " Running all tests"
@python3 -m pytest unit-tests integration-tests examples $(PYTEST_ARGS)
test: unit_test integration_test example notebook_test

unit_test:
clean_cache:
@echo " Cleaning caches"
@firedrake-clean

unit_test: clean_cache
@echo " Running all unit-tests"
@python3 -m pytest unit-tests $(PYTEST_ARGS)

integration_test:
integration_test: clean_cache
@echo " Running all integration-tests"
@python3 -m pytest integration-tests $(PYTEST_ARGS)

example:
example: clean_cache
@echo " Running all examples"
@python3 -m pytest examples $(PYTEST_ARGS)
@python3 -m pytest examples $(PYTEST_ARGS)

notebook_test: clean_cache
@echo " Running all Jupyter notebooks"
@python3 -m pytest --nbval-lax -n 4 --dist loadscope jupyter_notebooks $(PYTEST_ARGS)
20 changes: 0 additions & 20 deletions jupyter_notebooks/test_gusto_notebooks.py

This file was deleted.

0 comments on commit 4639883

Please sign in to comment.