Publish test-failure artifacts.

This commit is contained in:
Rune Tynan 2024-03-30 18:27:38 -07:00
parent 419e9af9c4
commit 533a2f448d
No known key found for this signature in database
GPG Key ID: 7ECC932F8B2C731E
1 changed files with 16 additions and 0 deletions

View File

@ -62,6 +62,22 @@ steps:
- ${{ if parameters.testIt }}:
- bash: cargo test --all --target $TARGET --release $CARGO_FEATURES_FLAGS --features="$CARGO_FEATURES_EXPLICIT"
displayName: cargo test
- bash: |
artifact_dir="$(Build.ArtifactStagingDirectory)/test_failures"
mkdir -p "$artifact_dir"
mv *.observed "$artifact_dir"
mv *.expected "$artifact_dir"
if [ -n "$(ls -A $artifact_dir)" ]; then
echo "##vso[task.setvariable variable=TEST_FAILURE_ARTIFACTS;]true"
fi
displayName: Package test failure files
condition: failed()
- task: PublishPipelineArtifact@1
displayName: Publish packaged test failures
condition: eq(variables['TEST_FAILURE_ARTIFACTS'], true)
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/test_failures'
artifactName: test-failures-$(TARGET)
# For non-canary builds, export artifacts.