From e4a94f504bf69dc6f3ccb6d5bf834e9d11963947 Mon Sep 17 00:00:00 2001 From: Chris Cummins Date: Wed, 6 Oct 2021 15:50:49 +0100 Subject: [PATCH] [tests] Automate Jupyter notebook tests using nbmake. This uses the nbmake pytest plugin to run the Jupyter notebooks in `make examples-test`. Fixes #450. --- Makefile | 2 +- tests/requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c12f88b63..bc99b57d0 100644 --- a/Makefile +++ b/Makefile @@ -319,7 +319,7 @@ install-test: | install-test-setup $(call pytest,--no-success-flaky-report --benchmark-disable -n auto -k "not fuzz" --durations=5) examples-test: - cd examples && pytest --no-success-flaky-report --benchmark-disable -n auto --durations=5 . --cov=compiler_gym --cov-report=xml:$(COV_REPORT) $(PYTEST_ARGS) + cd examples && pytest --nbmake --no-success-flaky-report --benchmark-disable -n auto --durations=5 . --cov=compiler_gym --cov-report=xml:$(COV_REPORT) $(PYTEST_ARGS) # Note we export $CI=1 so that the tests always run as if within the CI # environement. This is to ensure that the reported coverage matches that of diff --git a/tests/requirements.txt b/tests/requirements.txt index 623fd95ef..28c85e55e 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,4 +1,5 @@ flaky==3.7.0 +nbmake==0.10 psutil==5.8.0 # Implicit dependency of pytest-xdist pytest==6.1.0 pytest-benchmark==3.2.3