#2620: Going around azure dev ops to fail the script

This commit is contained in:
Czar Echavez
2024-07-01 15:57:15 +01:00
parent 4dd50be11a
commit a47a14b86e
2 changed files with 25 additions and 6 deletions

View File

@@ -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