Skip to content

Commit

Permalink
CI with outerloop for e2e tests for all supported runtimes (#94)
Browse files Browse the repository at this point in the history
* CI with outerloop for e2e tests for all supported runtimes

* Specify docker images as resource

Ah, too tired :-(

* Don't use docker .NET SDK

* Don't build as target for .NET 6 is missing in .NET Core 3.1 run
  • Loading branch information
gfoidl authored Dec 1, 2021
1 parent 7db08ec commit c3c82c7
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .azure/pipelines/ci-outer-loop.yml
Original file line number Diff line number Diff line change
@@ -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
95 changes: 95 additions & 0 deletions .azure/pipelines/jobs/e2e_tests_all.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion trx2junit.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}"
Expand All @@ -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
Expand Down

0 comments on commit c3c82c7

Please sign in to comment.