Skip to content

Commit c3c82c7

Browse files
authored
CI with outerloop for e2e tests for all supported runtimes (#94)
* 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
1 parent 7db08ec commit c3c82c7

File tree

3 files changed

+127
-1
lines changed

3 files changed

+127
-1
lines changed

.azure/pipelines/ci-outer-loop.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
variables:
2+
DOTNET_NOLOGO: 1
3+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
4+
CI_BUILD_NUMBER: $(Build.BuildId)
5+
BRANCH_NAME: $(Build.SourceBranchName)
6+
TAG_NAME: $(Build.SourceBranchName)
7+
8+
trigger: none
9+
# pr trigger must not be excluded, but in the UI for the pipeline definition a setting has to be made.
10+
# See https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#comment-triggers
11+
# for further info.
12+
13+
schedules:
14+
- cron: "0 0 * * *"
15+
displayName: "Daily midnight build"
16+
branches:
17+
include:
18+
- master
19+
20+
stages:
21+
- stage: Build_Test
22+
jobs:
23+
- template: jobs/build_and_test.yml
24+
25+
- stage: E2E_Tests
26+
dependsOn:
27+
- Build_Test
28+
jobs:
29+
- template: jobs/e2e_tests_all.yml
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
jobs:
2+
- job: e2e_tests
3+
displayName: e2e tests
4+
pool:
5+
vmImage: 'ubuntu-20.04'
6+
strategy:
7+
matrix:
8+
net60:
9+
dotnetVersion: '6.x'
10+
TRX2JUNIT_VECTORS_ENABLED: true
11+
net31:
12+
dotnetVersion: '3.1.x'
13+
steps:
14+
- task: UseDotNet@2
15+
inputs:
16+
version: $(dotnetVersion)
17+
installationPath: $(Agent.ToolsDirectory)/dotnet
18+
includePreviewVersions: false
19+
20+
- bash: |
21+
sudo apt update
22+
sudo apt install -y libxml2-utils
23+
displayName: install xml-lint
24+
25+
- task: DownloadPipelineArtifact@2
26+
inputs:
27+
artifactName: 'NuGet-Packed'
28+
targetPath: './NuGet-Packed'
29+
30+
- bash: |
31+
chmod ugo+x -R *.sh
32+
chmod ugo+x ./tests/scripts/*.sh
33+
34+
dotnet --info
35+
displayName: init
36+
37+
- bash: |
38+
# copied from build.sh (but modified)
39+
if [[ -n "$TAG_NAME" ]]; then
40+
if [[ "$TAG_NAME" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)(-(preview-[0-9]+))?$ ]]; then
41+
export VersionMajor="${BASH_REMATCH[1]}"
42+
export VersionMinor="${BASH_REMATCH[2]}"
43+
export VersionPatch="${BASH_REMATCH[3]}"
44+
export VersionSuffix="${BASH_REMATCH[5]}"
45+
46+
ToolVersion="$VersionMajor.$VersionMinor.$VersionPatch"
47+
48+
if [[ -n $VersionSuffix ]]; then
49+
ToolVersion="$ToolVersion-$VersionSuffix"
50+
fi
51+
fi
52+
fi
53+
54+
# special handling for pre-releases (is a constraint by .NET Core global tools)
55+
# and also to prevent installation from NuGet-feed (which may have higher version than the
56+
# built tool)
57+
if [[ -z "$ToolVersion" ]]; then
58+
dotnet tool install --tool-path $(pwd)/tool --configfile=ci-nuget.config trx2junit
59+
else
60+
dotnet tool install --tool-path $(pwd)/tool --version="$ToolVersion" --configfile=ci-nuget.config trx2junit
61+
fi
62+
63+
echo "##vso[task.prependpath]$(pwd)/tool"
64+
displayName: install built trx2junit-tool
65+
66+
- bash: |
67+
echo $PATH
68+
echo "-------------------------------------------------"
69+
dotnet tool list --tool-path $(pwd)/tool
70+
echo "-------------------------------------------------"
71+
trx2junit
72+
73+
if [[ $? != 1 ]]; then
74+
echo "hm, something strange"
75+
exit 1
76+
fi
77+
displayName: check tool installation
78+
79+
- bash: ./tests/scripts/run-single-arg.sh
80+
displayName: single-arg
81+
82+
- bash: ./tests/scripts/run-multiple-args.sh
83+
displayName: multiple-args
84+
85+
- bash: ./tests/scripts/run-globbing.sh
86+
displayName: globbing
87+
88+
- bash: ./tests/scripts/run-no-globbing.sh
89+
displayName: no-globbing
90+
91+
- bash: ./tests/scripts/run-different-output-location.sh
92+
displayName: different-output-location
93+
94+
- bash: ./tests/scripts/run-junit2trx.sh
95+
displayName: junit2trx

trx2junit.sln

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".azure", ".azure", "{5101A9
8282
EndProject
8383
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pipelines", "pipelines", "{8A80B7B0-F9B3-45C9-8796-C8049C43CD7E}"
8484
ProjectSection(SolutionItems) = preProject
85+
.azure\pipelines\ci-outer-loop.yml = .azure\pipelines\ci-outer-loop.yml
8586
.azure\pipelines\ci-vectors.yml = .azure\pipelines\ci-vectors.yml
8687
.azure\pipelines\ci.yml = .azure\pipelines\ci.yml
8788
EndProjectSection
@@ -93,6 +94,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "jobs", "jobs", "{BF2D34D4-5
9394
.azure\pipelines\jobs\coverage.yml = .azure\pipelines\jobs\coverage.yml
9495
.azure\pipelines\jobs\deploy_nuget.yml = .azure\pipelines\jobs\deploy_nuget.yml
9596
.azure\pipelines\jobs\e2e_tests.yml = .azure\pipelines\jobs\e2e_tests.yml
97+
.azure\pipelines\jobs\e2e_tests_all.yml = .azure\pipelines\jobs\e2e_tests_all.yml
9698
EndProjectSection
9799
EndProject
98100
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
102104
EndProject
103105
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "trx2junit.Core", "source\trx2junit.Core\trx2junit.Core.csproj", "{C83D7D6F-0E77-4F79-8942-6BB9FCA822AD}"
104106
EndProject
105-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "trx2junit.Core.Tests", "tests\trx2junit.Core.Tests\trx2junit.Core.Tests.csproj", "{C4EF7F3D-1923-4A3F-B780-96F6A62EDB82}"
107+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "trx2junit.Core.Tests", "tests\trx2junit.Core.Tests\trx2junit.Core.Tests.csproj", "{C4EF7F3D-1923-4A3F-B780-96F6A62EDB82}"
106108
EndProject
107109
Global
108110
GlobalSection(SolutionConfigurationPlatforms) = preSolution

0 commit comments

Comments
 (0)