forked from DataDog/dd-trace-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
2095 lines (1828 loc) · 76.3 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
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
trigger:
branches:
include:
- master
- release/*
- hotfix/*
exclude:
- refs/pull/*/head
- refs/tags/*
paths:
exclude:
- .azure-pipelines/noop-pipeline.yml
- .azure-pipelines/monitoring.yml
- .github/
- docs/
- tracer/README.MD
- tracer/dependabot/
- tracer/tools/PipelineMonitor
- LICENSE
- LICENSE-3rdparty.csv
- NOTICE
- .vsconfig
# The following is a list of shared asset locations.
# This is the config for the Tracer CI pipeline,
# so we are excluding shared assets that are not currently used by the Tracer.
# We make this list granular, rather than catch-all, on purpose.
# It makes it easier to selectively remove items from the list, once the Tracer starts using them.
# - The Managed Loader:
- shared/samples/Datadog.AutoInstrumentation.ManagedLoader.Demo/
- shared/src/managed-lib/ManagedLoader/
# - Dynamic Bindings for DiagnosticSource:
- shared/samples/Datadog.DynamicDiagnosticSourceBindings.Demo/
- shared/src/managed-lib/DynamicDiagnosticSourceBindings/
# - Logging damo samples:
- shared/samples/Datadog.Logging.Demo/
# - Managed utility APIs (may be used transitively):
- shared/src/managed-src/Datadog.Collections/
- shared/src/managed-src/Datadog.Util/
# - Managed Logging APIs (may be used transitively):
- shared/src/managed-src/Datadog.Logging.Emission/
- shared/src/managed-src/Datadog.Logging.Composition/
- shared/src/managed-src/Datadog.Logging/
# - Fmt lib:
- shared/src/native-lib/fmt_x64-windows-static/
- shared/src/native-lib/fmt_x86-windows-static/
# - Spdlob lib:
- shared/src/native-lib/spdlog/
# - Mics common native sources:
- shared/src/native-src/
pr:
branches:
include:
- '*' # default
paths:
exclude:
- .azure-pipelines/noop-pipeline.yml
- .azure-pipelines/monitoring.yml
- .github/
- .gitlab-ci.yml
- blog/
- docs/
- tracer/dependabot/
- tracer/README.MD
- tracer/src/Datadog.Trace/DuckTyping/README.md
- tracer/samples
- tracer/build/_build/Build.GitHub.cs
- tracer/build/_build/Build.Gitlab.cs
- tracer/tools/PipelineMonitor
- LICENSE
- LICENSE-3rdparty.csv
- NOTICE
- profiler/
schedules:
- cron: "0 3 * * *"
displayName: Daily 3am (UTC) build
branches:
include:
- master
- release/*
- hotfix/*
- /benchmarks/*
always: true
# Global variables
variables:
buildConfiguration: Release
dotnetCoreSdkLatestVersion: 6.0.100
relativeTracerHome: /shared/bin/monitoring-home/tracer
relativeArtifacts: /tracer/src/bin/artifacts
ddTracerHome: $(System.DefaultWorkingDirectory)/tracer/src/bin/dd-tracer-home
tracerHome: $(System.DefaultWorkingDirectory)/shared/bin/monitoring-home/tracer
profilerSrcDirectory: $(System.DefaultWorkingDirectory)/../dd-continuous-profiler-dotnet
profilerHome: $(System.DefaultWorkingDirectory)/profiler/bin/profiler-home # Important, put the profiler assets into the working directory so it can be saved across build stages more easily
monitoringHome: $(System.DefaultWorkingDirectory)/shared/bin/monitoring-home
artifacts: $(System.DefaultWorkingDirectory)/tracer/src/bin/artifacts
relativeRunnerTool: tracer/src/bin/runnerTool
relativeRunnerStandalone: tracer/src/bin/runnerStandalone
ddApiKey: $(DD_API_KEY)
isMainRepository: $[eq(variables['GITHUB_REPOSITORY_NAME'], 'dd-trace-dotnet')]
isMainBranch: $[in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/main')]
isMainOrReleaseBranch: $[or(in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/hostfix/'))]
isPullRequest: $[eq(variables['Build.Reason'], 'PullRequest')]
DD_DOTNET_TRACER_MSBUILD:
NugetPackageDirectory: $(System.DefaultWorkingDirectory)/packages
relativeNugetPackageDirectory: packages
# For scheduled builds, only run benchmarks and crank (and deps).
isScheduledBuild: ${{ eq(variables['Build.Reason'], 'Schedule') }} # only works if you have a main branch
dotnetToolTag: build-dotnet-tool
Verify_DisableClipboard: true
DiffEngine_Disabled: true
OriginalCommitId: $[coalesce(variables['System.PullRequest.SourceCommitId'], variables['Build.SourceVersion'])]
NUGET_ENABLE_EXPERIMENTAL_HTTP_RETRY: true
# Declare the datadog agent as a resource to be used as a pipeline service
resources:
containers:
- container: dd_agent
image: datadog/agent
ports:
- 8126:8126
env:
DD_API_KEY: $(ddApiKey)
DD_INSIDE_CI: true
# Stages
stages:
# This step grabs the current commit of master, and records it for subsequent stages
# We use it to ensure that we are always running PRs against the same commit, even
# if master is updated while the build is in progress. This guards against CI flakiness
# where the first stages of the build execute against one merge commit, and later stages
# run against another
- stage: master_commit_id
dependsOn: []
jobs:
- job: fetch
pool:
vmImage: ubuntu-18.04
steps:
- checkout: none
- bash: |
git clone --quiet --no-checkout --depth 1 --branch master $BUILD_REPOSITORY_URI ./s
cd s
MASTER_SHA=$(git rev-parse origin/master)
echo "Using master commit ID $MASTER_SHA"
echo "##vso[task.setvariable variable=master;isOutput=true]$MASTER_SHA"
failOnStderr: true
displayName: Fetch master id
name: set_sha
- stage: generate_variables
dependsOn: [master_commit_id]
variables:
masterCommitId: $[ stageDependencies.master_commit_id.fetch.outputs['set_sha.master']]
jobs:
- template: steps/update-github-status-jobs.yml
parameters:
jobs: [generate_variables_job]
- job: generate_variables_job
dependsOn: []
pool:
vmImage: windows-2019
steps:
- template: steps/clone-repo.yml
parameters:
masterCommitId: $(masterCommitId)
- template: steps/install-latest-dotnet-sdk.yml
- powershell: |
tracer/build.ps1 GenerateVariables
displayName: Generate Matrices
name: generate_variables_step
- stage: build_windows_tracer
dependsOn: [master_commit_id]
variables:
masterCommitId: $[ stageDependencies.master_commit_id.fetch.outputs['set_sha.master']]
jobs:
- template: steps/update-github-status-jobs.yml
parameters:
jobs: [build]
- job: build
pool:
vmImage: windows-2019
steps:
- template: steps/clone-repo.yml
parameters:
masterCommitId: $(masterCommitId)
- template: steps/install-latest-dotnet-sdk.yml
- script: tracer\build.cmd BuildTracerHome
displayName: Build tracer home
- script: tracer\build.cmd BuildNativeLoader
displayName: Build monitoring home
- publish: $(tracerHome)
displayName: Upload Windows tracer home directory
artifact: windows-tracer-home
- publish: $(System.DefaultWorkingDirectory)
displayName: Upload working directory after the managed build
artifact: build-windows-working-directory
- stage: build_windows_profiler
dependsOn: [master_commit_id]
variables:
masterCommitId: $[ stageDependencies.master_commit_id.fetch.outputs['set_sha.master']]
jobs:
- template: steps/update-github-status-jobs.yml
parameters:
jobs: [build]
- job: build
pool:
vmImage: windows-2019
steps:
- template: steps/clone-repo.yml
parameters:
masterCommitId: $(masterCommitId)
- template: steps/install-latest-dotnet-sdk.yml
- script: tracer\build.cmd BuildProfilerHome
displayName: Build profiler home
- publish: $(System.DefaultWorkingDirectory)/profiler/_build/DDProf-Deploy
displayName: Upload Windows profiler home directory
artifact: windows-profiler-home
- stage: build_linux
dependsOn: [master_commit_id]
variables:
masterCommitId: $[ stageDependencies.master_commit_id.fetch.outputs['set_sha.master']]
jobs:
- template: steps/update-github-status-jobs.yml
parameters:
jobs: [build]
- job: build
dependsOn: []
strategy:
matrix:
debian:
baseImage: debian
alpine:
baseImage: alpine
pool:
name: azure-linux-scale-set
steps:
- template: steps/clone-repo.yml
parameters:
masterCommitId: $(masterCommitId)
- template: steps/run-in-docker.yml
parameters:
build: true
target: builder
baseImage: $(baseImage)
command: "Clean BuildTracerHome ZipTracerHome"
- publish: $(tracerHome)
displayName: Uploading linux tracer home artifact
artifact: linux-tracer-home-$(baseImage)
- publish: $(artifacts)/linux-x64
displayName: Upload linux-x64 packages
artifact: linux-packages-$(baseImage)
- publish: $(System.DefaultWorkingDirectory)
displayName: Upload working directory after the build
artifact: build-linux-$(baseImage)-working-directory
- stage: build_arm64
dependsOn: [master_commit_id]
variables:
masterCommitId: $[ stageDependencies.master_commit_id.fetch.outputs['set_sha.master']]
jobs:
- template: steps/update-github-status-jobs.yml
parameters:
jobs: [build]
- job: build
dependsOn: []
pool:
name: aws-arm64-auto-scaling
workspace:
clean: all
steps:
- template: steps/clone-repo.yml
parameters:
masterCommitId: $(masterCommitId)
- template: steps/run-in-docker.yml
parameters:
build: true
target: builder
baseImage: debian
command: "Clean BuildTracerHome ZipTracerHome"
- publish: $(tracerHome)
displayName: Uploading linux tracer home artifact
artifact: linux-tracer-home-arm64
- publish: $(artifacts)/linux-arm64
displayName: Upload linux-arm64 packages
artifact: linux-packages-arm64
- publish: $(System.DefaultWorkingDirectory)
displayName: Upload working directory after the build
artifact: build-linux-arm64-working-directory
- stage: build_macos
condition: and(succeeded(), eq(variables['isScheduledBuild'], 'False'))
dependsOn: [master_commit_id]
variables:
masterCommitId: $[ stageDependencies.master_commit_id.fetch.outputs['set_sha.master']]
jobs:
- template: steps/update-github-status-jobs.yml
parameters:
jobs: [build]
- job: build
dependsOn: [ ]
pool:
vmImage: macOS-10.15
steps:
- template: steps/clone-repo.yml
parameters:
masterCommitId: $(masterCommitId)
- template: steps/install-latest-dotnet-sdk.yml
- script: ./tracer/build.sh BuildTracerHome
displayName: Build tracer home
- publish: $(tracerHome)
displayName: Uploading macos profiler artifact
artifact: macos-tracer-home
- publish: $(System.DefaultWorkingDirectory)
displayName: Upload working directory after the build
artifact: build-macos-working-directory
- stage: package_windows
condition: and(succeeded(), eq(variables['isScheduledBuild'], 'False'))
dependsOn: [ build_windows_tracer, build_windows_profiler, master_commit_id]
variables:
masterCommitId: $[ stageDependencies.master_commit_id.fetch.outputs['set_sha.master']]
pool:
vmImage: windows-2019
jobs:
- template: steps/update-github-status-jobs.yml
parameters:
jobs: [msi_and_pack]
- job: msi_and_pack
variables:
# Temporarily use the profiling repo's commit hash for the beta MSI's filename
BetaMsiSuffix: $[ stageDependencies.build_windows_profiler.build.outputs['SetMsiSuffix.BetaMsiSuffix']]
steps:
- template: steps/clone-repo.yml
parameters:
masterCommitId: $(masterCommitId)
- template: steps/install-latest-dotnet-sdk.yml
- template: steps/restore-working-directory.yml
- script: echo $(BetaMsiSuffix) # TODO Remove
- task: DownloadPipelineArtifact@2
displayName: Download windows profiler home
inputs:
artifact: windows-profiler-home
path: $(profilerHome)
- script: tracer\build.cmd PackageTracerHome
displayName: Build MSI and Tracer home
- script: tracer\build.cmd PackageMonitoringHomeBeta
displayName: Build beta MSI
- publish: $(artifacts)/windows-tracer-home.zip
displayName: Publish tracer-home.zip
artifact: windows-tracer-home.zip
- publish: $(artifacts)/x86/en-us
displayName: Publish Windows x86 MSI
artifact: windows-msi-x86
- publish: $(artifacts)/x64/en-us
displayName: Publish Windows x64 MSI
artifact: windows-msi-x64
- publish: $(artifacts)/nuget
displayName: Publish NuGet packages
artifact: nuget-packages
- stage: unit_tests_windows
condition: and(succeeded(), eq(variables['isScheduledBuild'], 'False'))
dependsOn: [build_windows_tracer, master_commit_id]
variables:
masterCommitId: $[ stageDependencies.master_commit_id.fetch.outputs['set_sha.master']]
pool:
vmImage: windows-2019
jobs:
- template: steps/update-github-status-jobs.yml
parameters:
jobs: [managed, native]
- job: managed
steps:
- template: steps/clone-repo.yml
parameters:
masterCommitId: $(masterCommitId)
- template: steps/install-dotnet.yml
- template: steps/restore-working-directory.yml
- script: tracer\build.cmd BuildAndRunManagedUnitTests --code-coverage
displayName: Build and Test
- publish: tracer/build_data
artifact: profiler-logs_unit_tests_windows_$(System.JobAttempt)
condition: succeededOrFailed()
continueOnError: true
- task: PublishTestResults@2
displayName: publish test results
inputs:
testResultsFormat: VSTest
testResultsFiles: tracer/build_data/results/**/*.trx
condition: succeededOrFailed()
- job: native
steps:
- template: steps/clone-repo.yml
parameters:
masterCommitId: $(masterCommitId)
- template: steps/install-dotnet.yml
- template: steps/restore-working-directory.yml
- script: tracer\build.cmd BuildAndRunNativeUnitTests
displayName: Build and Test
- task: PublishTestResults@2
displayName: publish test results
inputs:
testResultsFiles: tracer/test/**/test*.xml
condition: succeededOrFailed()
- stage: unit_tests_macos
condition: and(succeeded(), eq(variables['isScheduledBuild'], 'False'))
dependsOn: [build_macos, master_commit_id]
variables:
masterCommitId: $[ stageDependencies.master_commit_id.fetch.outputs['set_sha.master']]
jobs:
- template: steps/update-github-status-jobs.yml
parameters:
jobs: [managed]
- job: managed
pool:
vmImage: macOS-10.15
steps:
- template: steps/install-dotnet.yml
- template: steps/restore-working-directory.yml
parameters:
artifact: build-macos-working-directory
- script: ./tracer/build.sh BuildAndRunManagedUnitTests --code-coverage
displayName: Build and Test
- publish: tracer/build_data
artifact: profiler-logs_unit_tests_macos_$(System.JobAttempt)
condition: succeededOrFailed()
continueOnError: true
- task: PublishTestResults@2
displayName: publish test results
inputs:
testResultsFormat: VSTest
testResultsFiles: tracer/build_data/results/**/*.trx
condition: succeededOrFailed()
- stage: unit_tests_linux
condition: and(succeeded(), eq(variables['isScheduledBuild'], 'False'))
dependsOn: [build_linux, master_commit_id]
variables:
masterCommitId: $[ stageDependencies.master_commit_id.fetch.outputs['set_sha.master']]
jobs:
- template: steps/update-github-status-jobs.yml
parameters:
jobs: [test]
- job: test
strategy:
matrix:
debian:
baseImage: debian
alpine:
baseImage: alpine
pool:
name: azure-linux-scale-set
steps:
- template: steps/clone-repo.yml
parameters:
masterCommitId: $(masterCommitId)
- template: steps/restore-working-directory.yml
parameters:
artifact: build-linux-$(baseImage)-working-directory
- template: steps/run-in-docker.yml
parameters:
build: true
baseImage: $(baseImage)
command: "BuildAndRunManagedUnitTests --code-coverage"
- publish: tracer/build_data
artifact: profiler-logs_unit_tests_linux_$(Agent.JobName)_$(System.JobAttempt)
condition: succeededOrFailed()
continueOnError: true
- task: PublishTestResults@2
displayName: publish test results
inputs:
testResultsFormat: VSTest
testResultsFiles: tracer/build_data/results/**/*.trx
condition: succeededOrFailed()
- stage: unit_tests_arm64
condition: and(succeeded(), eq(variables['isScheduledBuild'], 'False'))
dependsOn: [build_arm64, master_commit_id]
variables:
masterCommitId: $[ stageDependencies.master_commit_id.fetch.outputs['set_sha.master']]
jobs:
- template: steps/update-github-status-jobs.yml
parameters:
jobs: [test]
- job: test
pool:
name: aws-arm64-auto-scaling
workspace:
clean: all
steps:
- template: steps/clone-repo.yml
parameters:
masterCommitId: $(masterCommitId)
- template: steps/restore-working-directory.yml
parameters:
artifact: build-linux-arm64-working-directory
- template: steps/run-in-docker.yml
parameters:
build: true
baseImage: debian
command: "BuildAndRunManagedUnitTests"
- publish: tracer/build_data
artifact: profiler-logs_unit_tests_linux_$(Agent.JobName)_$(System.JobAttempt)
condition: succeededOrFailed()
continueOnError: true
- task: PublishTestResults@2
displayName: publish test results
inputs:
testResultsFormat: VSTest
testResultsFiles: tracer/build_data/results/**/*.trx
condition: succeededOrFailed()
- stage: integration_tests_windows
condition: and(succeeded(), eq(variables['isScheduledBuild'], 'False'))
dependsOn: [build_windows_tracer, generate_variables, master_commit_id]
variables:
masterCommitId: $[ stageDependencies.master_commit_id.fetch.outputs['set_sha.master']]
jobs:
- template: steps/update-github-status-jobs.yml
parameters:
jobs: [Win]
- job: Win
pool:
name: azure-windows-scale-set
timeoutInMinutes: 100
strategy:
matrix: $[stageDependencies.generate_variables.generate_variables_job.outputs['generate_variables_step.integration_tests_windows_matrix'] ]
variables:
USE_NATIVE_LOADER: true
steps:
- template: steps/clone-repo.yml
parameters:
masterCommitId: $(masterCommitId)
- template: steps/install-dotnet-sdks.yml
parameters:
includeX86: true
- template: steps/restore-working-directory.yml
# Cosmos is _way_ to flaky at the moment. Try enabling again at a later time
# - powershell: |
# Write-Host "Starting CosmosDB Emulator"
# Import-Module "C:/Program Files/Azure Cosmos DB Emulator/PSModules/Microsoft.Azure.CosmosDB.Emulator"
# Start-CosmosDbEmulator -Timeout 300
# displayName: 'Start CosmosDB Emulator'
# workingDirectory: $(Pipeline.Workspace)
# retryCountOnTaskFailure: 5
- powershell: |
Write-Host "Initializing LocalDB"
sqllocaldb.exe start
sqlcmd.exe -S "(localdb)\MSSQLLocalDB" -i $(Build.Repository.LocalPath)\.azure-pipelines\prepare_localdb.sql
displayName: 'Initialize LocalDB'
workingDirectory: $(Build.Repository.LocalPath)
- script: tracer\build.cmd BuildAndRunWindowsIntegrationTests BuildAndRunWindowsRegressionTests -Framework $(framework) --PrintDriveSpace --code-coverage
displayName: Run integration tests
- task: PublishTestResults@2
displayName: publish test results
inputs:
testResultsFormat: VSTest
testResultsFiles: tracer/build_data/results/**/*.trx
condition: succeededOrFailed()
- publish: tracer/build_data
displayName: Uploading integration_tests_windows tracer logs
artifact: integration_tests_windows_tracer_logs_$(targetPlatform)_$(framework)_$(System.JobAttempt)
condition: succeededOrFailed()
continueOnError: true
- publish: tracer/test/snapshots
displayName: Uploading snapshots
artifact: integration_tests_windows_snapshots_$(targetPlatform)_$(framework)_$(System.JobAttempt)
condition: succeededOrFailed()
continueOnError: true
- script: tracer\build.cmd CheckBuildLogsForErrors
displayName: Check logs for errors
- stage: integration_tests_windows_iis
condition: and(succeeded(), eq(variables['isScheduledBuild'], 'False'))
dependsOn: [build_windows_tracer, package_windows, generate_variables, master_commit_id]
variables:
masterCommitId: $[ stageDependencies.master_commit_id.fetch.outputs['set_sha.master']]
jobs:
- template: steps/update-github-status-jobs.yml
parameters:
jobs: [IIS]
- job: IIS
timeoutInMinutes: 100
strategy:
matrix: $[stageDependencies.generate_variables.generate_variables_job.outputs['generate_variables_step.integration_tests_windows_iis_matrix'] ]
pool:
name: azure-windows-scale-set
variables:
relativeMsiOutputDirectory: $(relativeArtifacts)/$(targetPlatform)/en-us
USE_NATIVE_LOADER: true
steps:
- template: steps/clone-repo.yml
parameters:
masterCommitId: $(masterCommitId)
- template: steps/install-dotnet-sdks.yml
parameters:
includeX86: true
- template: steps/restore-working-directory.yml
- task: DownloadPipelineArtifact@2
displayName: Download MSI
inputs:
artifact: windows-msi-$(targetPlatform)
patterns: '**/*-$(targetPlatform).msi'
path: $(System.DefaultWorkingDirectory)/$(relativeMsiOutputDirectory)
- script: tracer\build.cmd BuildWindowsIntegrationTests -Framework $(framework)
displayName: BuildWindowsIntegrationTests
- script: |
docker-compose build --build-arg dotnet_tracer_msi=.$(relativeMsiOutputDirectory)/*.msi --build-arg ENABLE_32_BIT=$(enable32bit) IntegrationTests.IIS
docker-compose up -d IntegrationTests.IIS
displayName: docker-compose start IntegrationTests.IIS
retryCountOnTaskFailure: 5
- script: tracer\build.cmd RunWindowsIisIntegrationTests -Framework $(framework) --code-coverage
displayName: RunWindowsIisIntegrationTests
- task: PublishTestResults@2
displayName: publish test results
inputs:
testResultsFormat: VSTest
testResultsFiles: tracer/build_data/results/**/*.trx
condition: succeededOrFailed()
- task: DockerCompose@0
displayName: docker-compose stop services
inputs:
containerregistrytype: Container Registry
dockerComposeCommand: down
condition: succeededOrFailed()
- publish: tracer/build_data
displayName: Uploading integration_tests_windows_iis tracer logs
artifact: integration_tests_windows_iis_tracer_logs_$(targetPlatform)_$(framework)
condition: succeededOrFailed()
continueOnError: true
- publish: tracer/test/snapshots
displayName: Uploading snapshots
artifact: integration_tests_windows_iis_snapshots_$(targetPlatform)_$(framework)_$(System.JobAttempt)
condition: succeededOrFailed()
continueOnError: true
- script: tracer\build.cmd CheckBuildLogsForErrors
displayName: Check logs for errors
- stage: integration_tests_linux
condition: and(succeeded(), eq(variables['isScheduledBuild'], 'False'))
dependsOn: [build_linux, generate_variables, master_commit_id]
variables:
masterCommitId: $[ stageDependencies.master_commit_id.fetch.outputs['set_sha.master']]
jobs:
- template: steps/update-github-status-jobs.yml
parameters:
jobs: [Test]
- job: Test
strategy:
matrix: $[stageDependencies.generate_variables.generate_variables_job.outputs['generate_variables_step.integration_tests_linux_matrix']]
variables:
TestAllPackageVersions: true
IncludeMinorPackageVersions: $[eq(variables.perform_comprehensive_testing, 'true')]
pool:
name: azure-linux-scale-set
steps:
- template: steps/clone-repo.yml
parameters:
masterCommitId: $(masterCommitId)
# Doing a clean of obj files _before_ restore to remove build output from previous runs
# Can't do a full clean, as otherwise restore-working-directory fails
# Only necessary for ARM64, but shouldn't cause any harm on others
# Can't ifdef it as depends on a matrix variable
- template: steps/run-in-docker.yml
parameters:
build: true
baseImage: $(baseImage)
command: "CleanObjFiles"
- template: steps/restore-working-directory.yml
parameters:
artifact: build-linux-$(baseImage)-working-directory
- template: steps/run-in-docker.yml
parameters:
build: true
baseImage: $(baseImage)
command: "BuildLinuxIntegrationTests --framework $(publishTargetFramework)"
- task: DownloadPipelineArtifact@2
displayName: Download linux tracer home
inputs:
artifact: linux-tracer-home-$(baseImage)
path: $(System.DefaultWorkingDirectory)/tracer/serverlessArtifacts
- script: |
docker-compose -p ddtrace_$(Build.BuildNumber) build --build-arg baseImage=$(baseImage) --build-arg framework=$(publishTargetFramework) IntegrationTests
docker-compose -p ddtrace_$(Build.BuildNumber) run --rm StartDependencies
env:
baseImage: $(baseImage)
framework: $(publishTargetFramework)
displayName: docker-compose build IntegrationTests and run StartDependencies
retryCountOnTaskFailure: 5
- task: DockerCompose@0
displayName: docker-compose run IntegrationTests
inputs:
containerregistrytype: Container Registry
dockerComposeFileArgs: |
baseImage=$(baseImage)
framework=$(publishTargetFramework)
dockerComposeCommand: run --rm -e baseImage=$(baseImage) -e framework=$(publishTargetFramework) IntegrationTests
projectName: ddtrace_$(Build.BuildNumber)
- task: DockerCompose@0
displayName: docker-compose stop services
inputs:
containerregistrytype: Container Registry
dockerComposeCommand: down
condition: succeededOrFailed()
- publish: tracer/build_data
artifact: profiler-logs_integration_tests_linux_$(baseImage)_$(publishTargetFramework)_$(System.JobAttempt)
condition: succeededOrFailed()
continueOnError: true
- task: PublishTestResults@2
displayName: publish test results
inputs:
testResultsFormat: VSTest
testResultsFiles: tracer/build_data/results/**/*.trx
condition: succeededOrFailed()
- publish: tracer/test/snapshots
displayName: Uploading snapshots
artifact: integration_tests_linux_snapshots_$(baseImage)_$(publishTargetFramework)_$(System.JobAttempt)
condition: succeededOrFailed()
continueOnError: true
- template: steps/run-in-docker.yml
parameters:
baseImage: $(baseImage)
command: "CheckBuildLogsForErrors"
- stage: integration_tests_arm64
condition: and(succeeded(), eq(variables['isScheduledBuild'], 'False'))
dependsOn: [build_arm64, master_commit_id]
variables:
masterCommitId: $[ stageDependencies.master_commit_id.fetch.outputs['set_sha.master']]
jobs:
- template: steps/update-github-status-jobs.yml
parameters:
jobs: [Test]
- job: Test
strategy:
matrix:
net5_0:
publishTargetFramework: net5.0
net6_0:
publishTargetFramework: net6.0
variables:
TestAllPackageVersions: true
IncludeMinorPackageVersions: $[eq(variables.perform_comprehensive_testing, 'true')]
baseImage: debian
workspace:
clean: all
pool:
name: aws-arm64-auto-scaling
steps:
- template: steps/clone-repo.yml
parameters:
masterCommitId: $(masterCommitId)
# Doing a clean of obj files _before_ restore to remove build output from previous runs
# Can't do a full clean, as otherwise restore-working-directory fails
# Only necessary for ARM64, but shouldn't cause any harm on others
- template: steps/run-in-docker.yml
parameters:
build: true
baseImage: $(baseImage)
command: "CleanObjFiles"
- template: steps/restore-working-directory.yml
parameters:
artifact: build-linux-arm64-working-directory
- template: steps/run-in-docker.yml
parameters:
build: true
baseImage: $(baseImage)
command: "BuildLinuxIntegrationTests --framework $(publishTargetFramework)"
- script: |
docker-compose -p ddtrace_$(Build.BuildNumber) build --build-arg baseImage=$(baseImage) --build-arg framework=$(publishTargetFramework) IntegrationTests.ARM64
docker-compose -p ddtrace_$(Build.BuildNumber) run --rm StartDependencies.ARM64
env:
baseImage: $(baseImage)
framework: $(publishTargetFramework)
displayName: docker-compose build IntegrationTests and run StartDependencies
retryCountOnTaskFailure: 5
- task: DockerCompose@0
displayName: docker-compose run IntegrationTests
inputs:
containerregistrytype: Container Registry
dockerComposeFileArgs: |
baseImage=$(baseImage)
framework=$(publishTargetFramework)
dockerComposeCommand: run --rm -e baseImage=$(baseImage) -e framework=$(publishTargetFramework) IntegrationTests.ARM64
projectName: ddtrace_$(Build.BuildNumber)
- task: DockerCompose@0
displayName: docker-compose stop services
inputs:
containerregistrytype: Container Registry
dockerComposeCommand: down
projectName: ddtrace_$(Build.BuildNumber)
condition: succeededOrFailed()
- publish: tracer/build_data
artifact: profiler-logs_integration_tests_linux_arm64_$(publishTargetFramework)_$(System.JobAttempt)
condition: succeededOrFailed()
continueOnError: true
- task: PublishTestResults@2
displayName: publish test results
inputs:
testResultsFormat: VSTest
testResultsFiles: tracer/build_data/results/**/*.trx
condition: succeededOrFailed()
- publish: tracer/test/snapshots
displayName: Uploading snapshots
artifact: integration_tests_linux_snapshots_arm64_$(publishTargetFramework)_$(System.JobAttempt)
condition: succeededOrFailed()
continueOnError: true
- template: steps/run-in-docker.yml
parameters:
baseImage: $(baseImage)
command: "CheckBuildLogsForErrors"
- stage: exploration_tests_windows
condition: >
and(
succeeded(),
eq(variables['isScheduledBuild'], 'False'),
or(
eq(dependencies.generate_variables.outputs['generate_variables_job.generate_variables_step.IsTracerChanged'],'True'),
eq(dependencies.generate_variables.outputs['generate_variables_job.generate_variables_step.IsProfilerChanged'], 'True'),
eq(dependencies.generate_variables.outputs['generate_variables_job.generate_variables_step.IsDebuggerChanged'], 'True')
)
)
dependsOn: [build_windows_tracer, generate_variables, master_commit_id]
variables:
masterCommitId: $[ stageDependencies.master_commit_id.fetch.outputs['set_sha.master']]
jobs:
- template: steps/update-github-status-jobs.yml
parameters:
jobs: [ExplorationTest]
- job: ExplorationTest
timeoutInMinutes: 100
strategy:
matrix: $[ stageDependencies.generate_variables.generate_variables_job.outputs['generate_variables_step.exploration_tests_windows_matrix'] ]
pool:
vmImage: windows-2019
# Enable the Datadog Agent service for this job
services:
dd_agent: dd_agent
steps:
- template: steps/clone-repo.yml
parameters:
masterCommitId: $(masterCommitId)
- template: steps/install-dotnet-sdks.yml
parameters:
includeX86: true
- template: steps/restore-working-directory.yml
- script: tracer\build.cmd SetupExplorationTests -ExplorationTestUseCase $(explorationTestUseCase) -ExplorationTestName $(explorationTestName)
displayName: SetupExplorationTest $(explorationTestUseCase) $(explorationTestName)
- script: tracer\build.cmd RunExplorationTests -ExplorationTestUseCase $(explorationTestUseCase) -ExplorationTestName $(explorationTestName)
displayName: RunExplorationTest
- publish: tracer/build_data
displayName: Uploading exploration_tests_windows tracer logs
artifact: exploration_tests_windows_tracer_logs_$(explorationTestUseCase)_$(explorationTestName)
condition: succeededOrFailed()
continueOnError: true
- script: tracer\build.cmd CheckBuildLogsForErrors
displayName: Check logs for errors
- stage: exploration_tests_linux
condition: >
and(
succeeded(),
eq(variables['isScheduledBuild'], 'False'),
or(
eq(dependencies.generate_variables.outputs['generate_variables_job.generate_variables_step.IsTracerChanged'],'True'),
eq(dependencies.generate_variables.outputs['generate_variables_job.generate_variables_step.IsProfilerChanged'], 'True'),
eq(dependencies.generate_variables.outputs['generate_variables_job.generate_variables_step.IsDebuggerChanged'], 'True')
)
)
dependsOn: [build_linux, generate_variables, master_commit_id]
variables:
masterCommitId: $[ stageDependencies.master_commit_id.fetch.outputs['set_sha.master']]
jobs:
- template: steps/update-github-status-jobs.yml
parameters:
jobs: [Test]
- job: Test
strategy:
matrix: $[ stageDependencies.generate_variables.generate_variables_job.outputs['generate_variables_step.exploration_tests_linux_matrix'] ]
pool:
vmImage: ubuntu-18.04
# Enable the Datadog Agent service for this job
services:
dd_agent: dd_agent
steps:
- template: steps/clone-repo.yml
parameters:
masterCommitId: $(masterCommitId)
# Doing a clean of obj files _before_ restore to remove build output from previous runs