diff --git a/.azure/azure-ci-build-pipeline.yaml b/.azure/azure-ci-build-pipeline.yaml index 9217748b..47daa10f 100644 --- a/.azure/azure-ci-build-pipeline.yaml +++ b/.azure/azure-ci-build-pipeline.yaml @@ -109,8 +109,27 @@ stages: # Run the notebooks to make sure that they work - script: | - pytest --nbmake -n=auto src/primaite/notebooks --junit-xml=./notebook-tests/notebooks.xml - pytest --nbmake -n=auto src/primaite/simulator/_package_data --junit-xml=./notebook-tests/package-notebooks.xml + # Detect OS + if [ "$(uname)" = "Linux" ] || [ "$(uname)" = "Darwin" ]; then + # Commands for Linux and macOS + pytest --nbmake -n=auto src/primaite/notebooks --junit-xml=./notebook-tests/notebooks.xml + notebooks_exit_code=$? + pytest --nbmake -n=auto src/primaite/simulator/_package_data --junit-xml=./notebook-tests/package-notebooks.xml + package_notebooks_exit_code=$? + # Fail step if either of these do not have exit code 0 + if [ $notebooks_exit_code -ne 0 ] || [ $package_notebooks_exit_code -ne 0 ]; then + exit 1 + fi + else + # Commands for Windows + pytest --nbmake -n=auto src/primaite/notebooks --junit-xml=./notebook-tests/notebooks.xml + set notebooks_exit_code=%ERRORLEVEL% + pytest --nbmake -n=auto src/primaite/simulator/_package_data --junit-xml=./notebook-tests/package-notebooks.xml + set package_notebooks_exit_code=%ERRORLEVEL% + # Fail step if either of these do not have exit code 0 + if %notebooks_exit_code% NEQ 0 exit /b 1 + if %package_notebooks_exit_code% NEQ 0 exit /b 1 + fi displayName: 'Run notebooks' - task: PublishTestResults@2 diff --git a/pyproject.toml b/pyproject.toml index cd4436bf..a0c2e3eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,9 +37,7 @@ dependencies = [ "typer[all]==0.9.0", "pydantic==2.7.0", "ipywidgets", - "deepdiff", - "nbmake==1.5.4", - "pytest-xdist==3.3.1" + "deepdiff" ] [tool.setuptools.dynamic] @@ -74,7 +72,9 @@ dev = [ "Sphinx==7.1.2", "sphinx-copybutton==0.5.2", "wheel==0.38.4", - "nbsphinx==0.9.4" + "nbsphinx==0.9.4", + "nbmake==1.5.4", + "pytest-xdist==3.3.1" ] [project.scripts]