#2620: publish result of test and checking if pipeline fails

This commit is contained in:
Czar Echavez
2024-07-01 12:00:17 +01:00
parent ce58f3960c
commit ee4e152f13
3 changed files with 20 additions and 3 deletions

View File

@@ -128,6 +128,13 @@ stages:
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml' summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
# Run the notebooks to make sure that they work # Run the notebooks to make sure that they work
- script: | - script: |
pytest --nbmake -n=auto src/primaite/notebooks pytest --nbmake -n=auto src/primaite/notebooks --junit-xml=./notebook-tests/notebooks.xml
pytest --nbmake -n=auto src/primaite/simulator/_package_data pytest --nbmake -n=auto src/primaite/simulator/_package_data --junit-xml=./notebook-tests/package-notebooks.xml
displayName: 'Run notebooks' displayName: 'Run notebooks'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: 'notebook-tests/**.xml'
testRunTitle: 'Publish Notebook run'
failTaskOnFailedTests: true

1
.gitignore vendored
View File

@@ -54,6 +54,7 @@ cover/
tests/assets/**/*.png tests/assets/**/*.png
tests/assets/**/tensorboard_logs/ tests/assets/**/tensorboard_logs/
tests/assets/**/checkpoints/ tests/assets/**/checkpoints/
notebook-tests/*.xml
# Translations # Translations
*.mo *.mo

View File

@@ -18,6 +18,15 @@
"Import packages and read config file." "Import packages and read config file."
] ]
}, },
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"1/0"
]
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
@@ -143,7 +152,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.12" "version": "3.10.11"
} }
}, },
"nbformat": 4, "nbformat": 4,