diff --git a/.azure/pipelines/ci-outer-loop.yml b/.azure/pipelines/ci-outer-loop.yml new file mode 100644 index 0000000..58f1a5c --- /dev/null +++ b/.azure/pipelines/ci-outer-loop.yml @@ -0,0 +1,29 @@ +variables: + DOTNET_NOLOGO: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + CI_BUILD_NUMBER: $(Build.BuildId) + BRANCH_NAME: $(Build.SourceBranchName) + TAG_NAME: $(Build.SourceBranchName) + +trigger: none +# pr trigger must not be excluded, but in the UI for the pipeline definition a setting has to be made. +# See https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#comment-triggers +# for further info. + +schedules: + - cron: "0 0 * * *" + displayName: "Daily midnight build" + branches: + include: + - master + +stages: + - stage: Build_Test + jobs: + - template: jobs/build_and_test.yml + + - stage: E2E_Tests + dependsOn: + - Build_Test + jobs: + - template: jobs/e2e_tests_all.yml diff --git a/.azure/pipelines/jobs/e2e_tests_all.yml b/.azure/pipelines/jobs/e2e_tests_all.yml new file mode 100644 index 0000000..6e7a212 --- /dev/null +++ b/.azure/pipelines/jobs/e2e_tests_all.yml @@ -0,0 +1,95 @@ +jobs: + - job: e2e_tests + displayName: e2e tests + pool: + vmImage: 'ubuntu-20.04' + strategy: + matrix: + net60: + dotnetVersion: '6.x' + TRX2JUNIT_VECTORS_ENABLED: true + net31: + dotnetVersion: '3.1.x' + steps: + - task: UseDotNet@2 + inputs: + version: $(dotnetVersion) + installationPath: $(Agent.ToolsDirectory)/dotnet + includePreviewVersions: false + + - bash: | + sudo apt update + sudo apt install -y libxml2-utils + displayName: install xml-lint + + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: 'NuGet-Packed' + targetPath: './NuGet-Packed' + + - bash: | + chmod ugo+x -R *.sh + chmod ugo+x ./tests/scripts/*.sh + + dotnet --info + displayName: init + + - bash: | + # copied from build.sh (but modified) + if [[ -n "$TAG_NAME" ]]; then + if [[ "$TAG_NAME" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)(-(preview-[0-9]+))?$ ]]; then + export VersionMajor="${BASH_REMATCH[1]}" + export VersionMinor="${BASH_REMATCH[2]}" + export VersionPatch="${BASH_REMATCH[3]}" + export VersionSuffix="${BASH_REMATCH[5]}" + + ToolVersion="$VersionMajor.$VersionMinor.$VersionPatch" + + if [[ -n $VersionSuffix ]]; then + ToolVersion="$ToolVersion-$VersionSuffix" + fi + fi + fi + + # special handling for pre-releases (is a constraint by .NET Core global tools) + # and also to prevent installation from NuGet-feed (which may have higher version than the + # built tool) + if [[ -z "$ToolVersion" ]]; then + dotnet tool install --tool-path $(pwd)/tool --configfile=ci-nuget.config trx2junit + else + dotnet tool install --tool-path $(pwd)/tool --version="$ToolVersion" --configfile=ci-nuget.config trx2junit + fi + + echo "##vso[task.prependpath]$(pwd)/tool" + displayName: install built trx2junit-tool + + - bash: | + echo $PATH + echo "-------------------------------------------------" + dotnet tool list --tool-path $(pwd)/tool + echo "-------------------------------------------------" + trx2junit + + if [[ $? != 1 ]]; then + echo "hm, something strange" + exit 1 + fi + displayName: check tool installation + + - bash: ./tests/scripts/run-single-arg.sh + displayName: single-arg + + - bash: ./tests/scripts/run-multiple-args.sh + displayName: multiple-args + + - bash: ./tests/scripts/run-globbing.sh + displayName: globbing + + - bash: ./tests/scripts/run-no-globbing.sh + displayName: no-globbing + + - bash: ./tests/scripts/run-different-output-location.sh + displayName: different-output-location + + - bash: ./tests/scripts/run-junit2trx.sh + displayName: junit2trx diff --git a/trx2junit.sln b/trx2junit.sln index 30e8973..33e470e 100644 --- a/trx2junit.sln +++ b/trx2junit.sln @@ -82,6 +82,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".azure", ".azure", "{5101A9 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pipelines", "pipelines", "{8A80B7B0-F9B3-45C9-8796-C8049C43CD7E}" ProjectSection(SolutionItems) = preProject + .azure\pipelines\ci-outer-loop.yml = .azure\pipelines\ci-outer-loop.yml .azure\pipelines\ci-vectors.yml = .azure\pipelines\ci-vectors.yml .azure\pipelines\ci.yml = .azure\pipelines\ci.yml EndProjectSection @@ -93,6 +94,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "jobs", "jobs", "{BF2D34D4-5 .azure\pipelines\jobs\coverage.yml = .azure\pipelines\jobs\coverage.yml .azure\pipelines\jobs\deploy_nuget.yml = .azure\pipelines\jobs\deploy_nuget.yml .azure\pipelines\jobs\e2e_tests.yml = .azure\pipelines\jobs\e2e_tests.yml + .azure\pipelines\jobs\e2e_tests_all.yml = .azure\pipelines\jobs\e2e_tests_all.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "steps", "steps", "{947EBA33-4567-4F7D-AF42-6A986153577E}" @@ -102,7 +104,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "steps", "steps", "{947EBA33 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "trx2junit.Core", "source\trx2junit.Core\trx2junit.Core.csproj", "{C83D7D6F-0E77-4F79-8942-6BB9FCA822AD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "trx2junit.Core.Tests", "tests\trx2junit.Core.Tests\trx2junit.Core.Tests.csproj", "{C4EF7F3D-1923-4A3F-B780-96F6A62EDB82}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "trx2junit.Core.Tests", "tests\trx2junit.Core.Tests\trx2junit.Core.Tests.csproj", "{C4EF7F3D-1923-4A3F-B780-96F6A62EDB82}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution