From 9f9744b319b4f409c2f5633196c9af0720116e5c Mon Sep 17 00:00:00 2001 From: Medeni Baykal <433724+Haplois@users.noreply.github.com> Date: Sun, 24 Jan 2021 23:38:31 +0100 Subject: [PATCH] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 20 ++++++++++++++++++-- scripts/test.sh | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b8b5333e1d..e59f2b8b75 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -33,6 +33,13 @@ jobs: modifyEnvironment: false failOnStandardError: true + - task: PublishTestResults@2 + displayName: 'Publish Test Results **\*.trx' + inputs: + testResultsFormat: VSTest + testResultsFiles: '**\*.trx' + condition: succeededOrFailed() + - task: PublishPipelineArtifact@1 inputs: targetPath: '$(Build.SourcesDirectory)\artifacts' @@ -124,16 +131,25 @@ jobs: steps: - script: ./build.sh -c $(buildConfiguration) displayName: 'Build' + - script: ./test.sh -c $(buildConfiguration) -p Unit displayName: 'Unit tests' + - task: DownloadPipelineArtifact@2 inputs: buildType: 'current' artifactName: 'testArtifacts' targetPath: '$(Build.SourcesDirectory)/artifacts' + - script: ./tools/dotnet-linux/dotnet build -c $(buildConfiguration) ./test/TestAssets/TestAssets.sln displayName: 'Build test assets' + - script: ./test.sh -c $(buildConfiguration) -p Acceptance displayName: 'Acceptance tests' - - + + - task: PublishTestResults@2 + displayName: 'Publish Test Results **/*.trx' + inputs: + testResultsFormat: VSTest + testResultsFiles: '**/*.trx' + condition: succeededOrFailed() \ No newline at end of file diff --git a/scripts/test.sh b/scripts/test.sh index 282926b727..31ee9d3fee 100644 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -120,7 +120,7 @@ function invoke_test() local dotnet=$(_get_dotnet_path) local vstest=$TP_OUT_DIR/$TPB_Configuration/$TPB_TargetFrameworkCore/vstest.console.dll - find ./test -path $PROJECT_NAME_PATTERNS | xargs $dotnet $vstest --parallel --testcasefilter:"TestCategory!=Windows&TestCategory!=Windows-Review" + find ./test -path $PROJECT_NAME_PATTERNS | xargs $dotnet $vstest --parallel --testcasefilter:"TestCategory!=Windows&TestCategory!=Windows-Review" --logger:"trx" } #