From 85e98f0e629d2b49ffd3f12917a3c0bacaa0ca68 Mon Sep 17 00:00:00 2001 From: Aidan Griffiths Date: Wed, 1 Nov 2023 15:47:14 +1100 Subject: [PATCH] feat: Add E2E tests to workflow and ignore notebooks with nc deps --- .github/workflows/python-app.yml | 5 ++++- pyproject.toml | 11 +++++++++-- ...pynb => Continuous_Ranked_Probability_Score.ipynb} | 0 ...tic.ipynb => Diebold_Mariano_Test_Statistic.ipynb} | 0 ... Data Fetching.ipynb => First_Data_Fetching.ipynb} | 0 ...Absolute Error.ipynb => Mean_Absolute_Error.ipynb} | 0 ...n Squared Error.ipynb => Mean_Squared_Error.ipynb} | 0 .../{Murphy Diagrams.ipynb => Murphy_Diagrams.ipynb} | 0 ...ared Error.ipynb => Root_Mean_Squared_Error.ipynb} | 0 ...eighting Results.ipynb => Weighting_Results.ipynb} | 0 10 files changed, 13 insertions(+), 3 deletions(-) rename tutorials/{Continuous Ranked Probability Score.ipynb => Continuous_Ranked_Probability_Score.ipynb} (100%) rename tutorials/{Diebold Mariano Test Statistic.ipynb => Diebold_Mariano_Test_Statistic.ipynb} (100%) rename tutorials/{First - Data Fetching.ipynb => First_Data_Fetching.ipynb} (100%) rename tutorials/{Mean Absolute Error.ipynb => Mean_Absolute_Error.ipynb} (100%) rename tutorials/{Mean Squared Error.ipynb => Mean_Squared_Error.ipynb} (100%) rename tutorials/{Murphy Diagrams.ipynb => Murphy_Diagrams.ipynb} (100%) rename tutorials/{Root Mean Squared Error.ipynb => Root_Mean_Squared_Error.ipynb} (100%) rename tutorials/{Weighting Results.ipynb => Weighting_Results.ipynb} (100%) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index d02955dd..f616a8a2 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 @@ -38,3 +38,6 @@ jobs: - name: Report test coverage run: | coverage report -m + - name: Test tutorial notebooks with pytest + run: | + coverage run -m pytest --nbmake tutorials/ diff --git a/pyproject.toml b/pyproject.toml index 394ff9a7..5dc5c114 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,12 +89,19 @@ addopts = [ '--cov-fail-under=100', '--cov-report=html', '--cov-report=term-missing', - '--junitxml=report.xml' + '--junitxml=report.xml', + # Ignore notebooks which depend on external data for E2E tests + '--ignore=tutorials/First_Data_Fetching.ipynb', + '--ignore=tutorials/Mean_Squared_Error.ipynb', + '--ignore=tutorials/Root_Mean_Squared_Error.ipynb', + '--ignore=tutorials/Weighting_Results.ipynb', + '--ignore=tutorials/Mean_Absolute_Error.ipynb' ] + [tool.pylint.master] # https://github.com/PyCQA/pylint/issues/4081#issuecomment-778242554 init-hook = 'import sys; sys.setrecursionlimit(3 * sys.getrecursionlimit())' -ignore-paths = [ +ignore-paths = [ 'docs/' ] diff --git a/tutorials/Continuous Ranked Probability Score.ipynb b/tutorials/Continuous_Ranked_Probability_Score.ipynb similarity index 100% rename from tutorials/Continuous Ranked Probability Score.ipynb rename to tutorials/Continuous_Ranked_Probability_Score.ipynb diff --git a/tutorials/Diebold Mariano Test Statistic.ipynb b/tutorials/Diebold_Mariano_Test_Statistic.ipynb similarity index 100% rename from tutorials/Diebold Mariano Test Statistic.ipynb rename to tutorials/Diebold_Mariano_Test_Statistic.ipynb diff --git a/tutorials/First - Data Fetching.ipynb b/tutorials/First_Data_Fetching.ipynb similarity index 100% rename from tutorials/First - Data Fetching.ipynb rename to tutorials/First_Data_Fetching.ipynb diff --git a/tutorials/Mean Absolute Error.ipynb b/tutorials/Mean_Absolute_Error.ipynb similarity index 100% rename from tutorials/Mean Absolute Error.ipynb rename to tutorials/Mean_Absolute_Error.ipynb diff --git a/tutorials/Mean Squared Error.ipynb b/tutorials/Mean_Squared_Error.ipynb similarity index 100% rename from tutorials/Mean Squared Error.ipynb rename to tutorials/Mean_Squared_Error.ipynb diff --git a/tutorials/Murphy Diagrams.ipynb b/tutorials/Murphy_Diagrams.ipynb similarity index 100% rename from tutorials/Murphy Diagrams.ipynb rename to tutorials/Murphy_Diagrams.ipynb diff --git a/tutorials/Root Mean Squared Error.ipynb b/tutorials/Root_Mean_Squared_Error.ipynb similarity index 100% rename from tutorials/Root Mean Squared Error.ipynb rename to tutorials/Root_Mean_Squared_Error.ipynb diff --git a/tutorials/Weighting Results.ipynb b/tutorials/Weighting_Results.ipynb similarity index 100% rename from tutorials/Weighting Results.ipynb rename to tutorials/Weighting_Results.ipynb