forked from microsoft/vstest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
155 lines (136 loc) · 4.52 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# Pipeline YAML for PR
jobs:
- job: Windows
timeoutInMinutes: 120
pool:
vmImage: 'vs2017-win2016'
variables:
buildConfiguration: 'Release'
steps:
- task: BatchScript@1
displayName: 'Run script build.cmd'
inputs:
filename: build.cmd
arguments: '-verbose -configuration $(buildConfiguration) -steps "InstallDotnet, Restore, UpdateLocalization, Build, Publish"'
modifyEnvironment: false
failOnStandardError: true
- task: CmdLine@1
displayName: 'Delete stale pdb files'
inputs:
filename: del
arguments: '/S /F *.pdb'
workingFolder: '$(SystemRoot)'
continueOnError: true
condition: always()
- task: BatchScript@1
displayName: 'Run Unit Tests'
inputs:
filename: test.cmd
arguments: '-verbose -configuration $(buildConfiguration)'
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'
artifact: 'testArtifacts'
publishLocation: 'pipeline'
- job: WindowsAcceptance
dependsOn: Windows
timeoutInMinutes: 120
pool:
vmImage: 'vs2017-win2016'
variables:
buildConfiguration: 'Release'
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'testArtifacts'
targetPath: '$(Build.SourcesDirectory)\artifacts'
- task: PowerShell@2
inputs:
targetType: 'inline'
script: 'ls "$(Build.SourcesDirectory)\artifacts\" -Recurse -Dir'
- task: BatchScript@1
displayName: 'Run script build.cmd'
inputs:
filename: build.cmd
# build should not be needed in the end, we are copying the build task from the build folder, but we should get
# it either from artifacts, if present, or from extracted package file
# Adding it at the moment to avoid this error: #[error]Copy-Item : Cannot find path 'D:\a\1\s\src\Microsoft.TestPlatform.Build\bin\Release\netstandard2.0' because it does not exist.
arguments: '-verbose -configuration $(buildConfiguration) -steps "InstallDotnet, Restore, Build, PrepareAcceptanceTests"'
modifyEnvironment: false
failOnStandardError: true
- task: PowerShell@2
inputs:
targetType: 'inline'
script: 'ls "$(Build.SourcesDirectory)\artifacts\Release\packages"'
- task: BatchScript@1
displayName: 'Run Acceptance Tests'
inputs:
filename: test.cmd
arguments: '-verbose -configuration $(buildConfiguration) -p AcceptanceTests -f net451'
modifyEnvironment: false
failOnStandardError: true
- task: BatchScript@1
displayName: 'Run Platform Tests'
inputs:
filename: test.cmd
arguments: '-verbose -configuration $(buildConfiguration) -p platformtests'
modifyEnvironment: false
failOnStandardError: true
- task: BatchScript@1
displayName: 'Run Smoke Tests'
inputs:
filename: test.cmd
arguments: '-verbose -configuration $(buildConfiguration) -p smoke'
modifyEnvironment: false
failOnStandardError: true
- task: PublishTestResults@2
displayName: 'Publish Test Results **\*.trx'
inputs:
testResultsFormat: VSTest
testResultsFiles: '**\*.trx'
condition: succeededOrFailed()
- job: OtherOSes
dependsOn: Windows
workspace:
clean: all
strategy:
matrix:
Ubuntu_18_04:
vmImage: ubuntu-18.04
pwsh: true
macOS_10_15_Catalina:
vmImage: macOS-10.15
pwsh: true
pool:
vmImage: $[ variables['vmImage'] ]
variables:
buildConfiguration: 'Release'
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()