CCF/.azure-pipelines-templates/test.yml

38 строки
1.3 KiB
YAML

parameters:
suite_name_suffix: ''
ctest_filter: ''
steps:
- script: |
./tests.sh -VV --timeout 240 --no-compress-output -T Test ${{ parameters.ctest_filter }}
env:
METRICS_MONGO_CONNECTION: $(METRICS_MONGO_CONNECTION)
displayName: CTest
workingDirectory: build
# If a test fails, crudely upload nodes' logs for all tests
- task: CopyFiles@2
inputs:
contents: '**/?(*out|*err)'
sourceFolder: $(Build.SourcesDirectory)/build/workspace
targetFolder: $(Build.ArtifactStagingDirectory)
condition: or(failed(), canceled())
displayName: 'Copy logs (only on failure)'
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)
artifactName: 'workspace ${{ parameters.suite_name_suffix }}'
condition: or(failed(), canceled())
displayName: 'Upload logs (only on failure)'
- script: 'xsltproc --stringparam suiteName "$(Agent.MachineName) ${{ parameters.suite_name_suffix }}" ../tests/infra/ctest_to_junit.xslt Testing/*/Test.xml | sed -r "s/\[NON-XML-CHAR-0x1B\]\[([0-9]*)m//g"> JUnit.xml'
displayName: XSLT
workingDirectory: build
condition: succeededOrFailed()
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/JUnit.xml'
publishRunAttachments: true
condition: succeededOrFailed()