Skip to content

Commit

Permalink
Fail pipeline if test results file is missing
Browse files Browse the repository at this point in the history
This will make sure that the pipeline will not report success if for
some reason the test results file is not generated.

Issue #580
  • Loading branch information
bothzoli committed Dec 6, 2024
1 parent 0d8259f commit 983d18a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ stages:
- script: |
docker create --name build-container build-image
docker cp build-container:./app/CSharpFunctionalExtensions.Tests/TestResults ./testresults
# This will make sure that the pipeline fails if the tests were not executed for any reason
if [ ./testresults/testresults.trx ] && [ $(grep -E "<UnitTestResult" ./testresults/testresults.trx -c) -gt 0 ]; then
echo "Test results results found"
else
echo "No test results found"
exit 1
fi
displayName: Extract test results
- task: PublishTestResults@2
Expand Down

0 comments on commit 983d18a

Please sign in to comment.