-
Notifications
You must be signed in to change notification settings - Fork 93
/
unit-tests.yml
275 lines (233 loc) · 6.34 KB
/
unit-tests.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
trigger:
branches:
include:
- main
- refs/tags/*
exclude:
- refs/pull/*/head
paths:
exclude:
- docs/*
- .github/*
variables:
buildConfiguration: Debug
OTEL_DOTNET_TRACER_MSBUILD:
jobs:
- job: managed
strategy:
matrix:
windows:
imageName: windows-2019
linux:
imageName: ubuntu-18.04
pool:
vmImage: $(imageName)
steps:
# Install the tracer latest stable release to attach the profiler to the build and test steps.
# The script exposes the required environment variables to the following steps
#- task: PowerShell@2
# displayName: Install profiler latest release
# inputs:
# filePath: ./.azure-pipelines/setup_tracer.ps1
- task: UseDotNet@2
displayName: install dotnet core runtime 2.1
inputs:
packageType: runtime
version: 2.1.x
- task: UseDotNet@2
displayName: install dotnet core runtime 3.0
inputs:
packageType: runtime
version: 3.0.x
- task: UseDotNet@2
displayName: install dotnet core runtime 3.1
inputs:
packageType: runtime
version: 3.1.x
- task: UseDotNet@2
displayName: install dotnet core sdk 5.0
inputs:
packageType: sdk
version: 5.0.x
- task: DotNetCoreCLI@2
displayName: dotnet build
inputs:
command: build
configuration: $(buildConfiguration)
arguments: /nowarn:netsdk1138 #-l:DatadogLogger,"$(OTEL_DOTNET_TRACER_MSBUILD)"
projects: |
src/**/*.csproj
test/**/*.Tests.csproj
test/benchmarks/**/*.csproj
!src/Datadog.Trace.Tools.Runner/*.csproj
env:
OTEL_SERVICE_NAME: dd-trace-dotnet
- task: DotNetCoreCLI@2
displayName: dotnet test
inputs:
command: test
configuration: $(buildConfiguration)
projects: |
test/**/*.Tests.csproj
env:
OTEL_SERVICE_NAME: dd-tracer-dotnet
- job: managed_macos
pool:
vmImage: macOS-10.15
steps:
- task: UseDotNet@2
displayName: install dotnet core runtime 2.1
inputs:
packageType: runtime
version: 2.1.x
- task: UseDotNet@2
displayName: install dotnet core runtime 3.0
inputs:
packageType: runtime
version: 3.0.x
- task: UseDotNet@2
displayName: install dotnet core runtime 3.1
inputs:
packageType: runtime
version: 3.1.x
- task: UseDotNet@2
displayName: install dotnet core sdk 5.0
inputs:
packageType: sdk
version: 5.0.x
- task: DotNetCoreCLI@2
displayName: dotnet build
inputs:
command: build
configuration: $(buildConfiguration)
arguments: /nowarn:netsdk1138
projects: |
src/**/*.csproj
test/**/*.Tests.csproj
benchmarks/**/*.csproj
!src/Datadog.Trace.Tools.Runner/*.csproj
- task: DotNetCoreCLI@2
displayName: dotnet test
inputs:
command: test
configuration: $(buildConfiguration)
projects: test/**/*.Tests.csproj
env:
OTEL_SERVICE: dd-trace-dotnet
- job: windows_profiler
strategy:
matrix:
x64:
buildPlatform: x64
x86:
buildPlatform: x86
pool:
vmImage: windows-2019
steps:
- task: UseDotNet@2
displayName: install dotnet core runtime 3.1
inputs:
packageType: runtime
version: 3.1.x
- task: UseDotNet@2
displayName: install dotnet core sdk 5.0
inputs:
packageType: sdk
version: 5.0.x
- task: DotNetCoreCLI@2
displayName: dotnet build
inputs:
command: build
configuration: $(buildConfiguration)
arguments: /nowarn:netsdk1138
projects: |
src/Datadog.Trace.ClrProfiler.Managed.Loader/Datadog.Trace.ClrProfiler.Managed.Loader.csproj
sample-libs/**/Samples.ExampleLibrary*.csproj
- task: NuGetToolInstaller@1
displayName: install nuget
- task: NuGetCommand@2
displayName: nuget restore
inputs:
restoreSolution: Datadog.Trace.Native.sln
verbosityRestore: Normal
- task: MSBuild@1
displayName: msbuild
inputs:
solution: Datadog.Trace.proj
platform: $(buildPlatform)
configuration: $(buildConfiguration)
msbuildArguments: /t:BuildCpp;BuildCppTests
maximumCpuCount: true
- script: Datadog.Trace.ClrProfiler.Native.Tests.exe --gtest_output=xml
displayName: run tests
workingDirectory: $(System.DefaultWorkingDirectory)/test/Datadog.Trace.ClrProfiler.Native.Tests/bin/$(buildConfiguration)/$(buildPlatform)
- task: PublishTestResults@2
displayName: publish test results
inputs:
testResultsFiles: test/**/test*.xml
buildPlatform: $(buildPlatform)
buildConfiguration: $(buildConfiguration)
condition: succeededOrFailed()
- job: linux_profiler
pool:
vmImage: ubuntu-20.04
steps:
- task: UseDotNet@2
displayName: install dotnet core runtime 3.1
inputs:
packageType: runtime
version: 3.1.x
- task: UseDotNet@2
displayName: install dotnet core sdk 5.0
inputs:
packageType: sdk
version: 5.0.x
- task: DotNetCoreCLI@2
displayName: dotnet build
inputs:
command: build
configuration: $(buildConfiguration)
arguments: /nowarn:netsdk1138
projects: |
src/Datadog.Trace.ClrProfiler.Managed.Loader/Datadog.Trace.ClrProfiler.Managed.Loader.csproj
- script: |
sudo apt-get update
sudo apt-get install -y llvm clang
displayName: install_dependencies
- script: |
cd ./src/Datadog.Trace.ClrProfiler.Native
CXX=clang++ CC=clang cmake .
make
displayName: build_profiler
- script: |
cd ./src/Datadog.Trace.ClrProfiler.Native
CXX=clang++ CC=clang cmake .
make
displayName: build_profiler
- job: macos_profiler
pool:
vmImage: macOS-10.15
steps:
- task: UseDotNet@2
displayName: install dotnet core runtime 3.1
inputs:
packageType: runtime
version: 3.1.x
- task: UseDotNet@2
displayName: install dotnet core sdk 5.0
inputs:
packageType: sdk
version: 5.0.x
- task: DotNetCoreCLI@2
displayName: dotnet build
inputs:
command: build
configuration: $(buildConfiguration)
arguments: /nowarn:netsdk1138
projects: |
src/Datadog.Trace.ClrProfiler.Managed.Loader/Datadog.Trace.ClrProfiler.Managed.Loader.csproj
- script: |
cd ./src/Datadog.Trace.ClrProfiler.Native
cmake .
make
displayName: build_profiler