From 52e0eeb393d0a35d0ff92459d2529f41decd88f2 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 3 Nov 2021 10:54:43 -0700 Subject: [PATCH] Add test result uploading (#3017) * Add test result uploading * Use -T * Add displayName and buildConfiguration * Add live testing result upload * buildConfiguration -> testRunTitle * Live tests 'Validate' -> 'ValidateLive' to differentiate job names in Test results output --- .../templates/jobs/archetype-sdk-tests.yml | 15 +++++++++++++-- eng/pipelines/templates/jobs/ci.tests.yml | 13 ++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-tests.yml b/eng/pipelines/templates/jobs/archetype-sdk-tests.yml index d236f3cc3..775a9c890 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-tests.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-tests.yml @@ -27,7 +27,7 @@ parameters: # https://github.com/Azure/azure-sdk-for-cpp/issues/2944 jobs: -- job: Validate +- job: ValidateLive condition: and(succeededOrFailed(), ne(variables['Skip.LiveTest'], 'true')) timeoutInMinutes: ${{ parameters.TimeoutInMinutes }} strategy: @@ -198,10 +198,21 @@ jobs: Location: ${{ parameters.Location }} SubscriptionConfiguration: ${{ parameters.SubscriptionConfiguration }} - - script: ctest -C Debug -V --tests-regex ${{ parameters.CtestRegex }} + - script: ctest -C Debug --tests-regex ${{ parameters.CtestRegex }} --no-compress-output -T Test workingDirectory: build displayName: ctest + - task: PublishTestResults@2 + inputs: + testResultsFormat: cTest + testResultsFiles: Testing/*/Test.xml + testRunTitle: $(Agent.JobName) + searchFolder: build + mergeTestResults: true + publishRunAttachments: true + displayName: Publish test results + condition: succeededOrFailed() + # Make coverage targets (specified in coverage_targets.txt) and assemble # coverage report - bash: | diff --git a/eng/pipelines/templates/jobs/ci.tests.yml b/eng/pipelines/templates/jobs/ci.tests.yml index fc3c0fcc4..59ea2758a 100644 --- a/eng/pipelines/templates/jobs/ci.tests.yml +++ b/eng/pipelines/templates/jobs/ci.tests.yml @@ -109,9 +109,20 @@ jobs: BuildArgs: "$(BuildArgs)" Env: "$(CmakeEnvArg)" - - script: ctest -C Debug -V --tests-regex ${{ parameters.CtestRegex }} + - script: ctest -C Debug --tests-regex ${{ parameters.CtestRegex }} --no-compress-output -T Test workingDirectory: build + - task: PublishTestResults@2 + inputs: + testResultsFormat: cTest + testResultsFiles: Testing/*/Test.xml + testRunTitle: $(Agent.JobName) + searchFolder: build + mergeTestResults: true + publishRunAttachments: true + displayName: Publish test results + condition: succeededOrFailed() + - ${{ if eq(parameters.CoverageEnabled, true) }}: - pwsh: | $toolsDirectory = "$(Agent.TempDirectory)/coveragetools"