@@ -6,53 +6,15 @@ schedules:
66 include :
77 - develop
88
9- resources :
10- repositories :
11- - repository : shared-code-scanning
12- type : git
13- name : Common/shared-code-scanning
14- ref : refs/heads/main
15- trigger : none
16-
179trigger :
1810 - develop
1911 - main
2012 - releases/*
21-
22- variables :
23- - group : PT-Pipeline-Common
24-
13+
2514pool :
26- name : mdp-mgmt-shared
27- demands :
28- - ImageOverride -equals $(PipelineHostLinuxImage)
15+ vmImage : ubuntu-latest
2916
3017steps :
31- - script : |
32- echo "Cleaning mock-register folder in temp"
33- ls $(Agent.BuildDirectory)/s/Source/_temp/mock-register-* 2>/dev/null || "No matching folders found"
34- sudo rm -rf $(Agent.BuildDirectory)/s/Source/_temp/mock-register-* 2> /dev/null
35- displayName : Clean temp mock-register folders
36- condition : always()
37-
38- - checkout : self
39- clean : true
40-
41- - task : UseDotNet@2
42- displayName : ' Use .NET 8 sdk'
43- condition : always()
44- inputs :
45- packageType : sdk
46- version : ' 8.0.x'
47- performMultiLevelLookup : true
48-
49- # Restore dotnet tooling
50- - task : CmdLine@2
51- displayName : ' Restore dotnet tooling'
52- condition : always()
53- inputs :
54- script : ' dotnet tool restore'
55-
5618# Build mock-register
5719- task : Docker@2
5820 displayName : Build mock-register image
@@ -63,11 +25,6 @@ steps:
6325 repository : mock-register
6426 tags : latest
6527
66- - template : templates/scan-image.yml@shared-code-scanning
67- parameters :
68- Repository : mock-register
69- Tag : latest
70-
7128# Build mock-register-unit-tests
7229- task : Docker@2
7330 displayName : Build mock-register-unit-tests image
@@ -126,22 +83,23 @@ steps:
12683
12784# Remove integration tests
12885- script : |
129- docker compose --file $(Build.SourcesDirectory)/Source/docker-compose.IntegrationTests.yml down
86+ docker compose --file $(Build.SourcesDirectory)/Source/docker-compose.IntegrationTests.yml down
13087 displayName : ' Integration Tests - Down'
13188 condition : always()
13289
133- # Generate Extent Report from Test Results
90+ # Run trx formatter to output .MD and .CSV
13491- script : |
135- dotnet TrxToExtentReport \
136- --output $(Build.ArtifactStagingDirectory)/test-results/mock-register-integration-tests/MR-$(Build.BuildNumber).html \
137- --trx $(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/results.trx \
138- --verbose
139- cp $(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/results.trx $(Build.ArtifactStagingDirectory)/test-results/mock-register-integration-tests/MR-$(Build.BuildNumber).trx
140- displayName : ' Format Test Results'
141- condition : always()
92+ docker run \
93+ -v=$(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/results.trx:/app/results.trx:ro \
94+ -v=$(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/formatted/:/app/out/:rw \
95+ $(SharedAcrBaseUrl).azurecr.io/trx-formatter -i results.trx -t "MR" --outputprefix "MR" -o out/
96+ displayName : ' Run trx-formatter'
97+ condition : always()
98+ env :
99+ TEST_FILTER : " Category!=CTSONLY"
142100
143101# Publish mock-register integration tests results
144- - publish : $(Build.ArtifactStagingDirectory)/test-results /mock-register-integration-tests
102+ - publish : Source/_temp /mock-register-integration-tests/testresults
145103 displayName : Publish MockRegister Integration tests
146104 condition : always()
147105 artifact : Mock-Register - Integration tests
@@ -159,7 +117,7 @@ steps:
159117# Run integration tests For CTS Only tests
160118# ****************************************************************************************************************
161119- script : |
162- docker compose --file $(Build.SourcesDirectory)/Source/docker-compose.IntegrationTests.yml up --abort-on-container-exit --exit-code-from mock-register-integration-tests
120+ docker compose --file $(Build.SourcesDirectory)/Source/docker-compose.IntegrationTests.yml up --abort-on-container-exit --exit-code-from mock-register-integration-tests
163121 displayName : ' Integration Tests Tests For CTS Only - Up'
164122 condition : always()
165123 env :
@@ -184,12 +142,11 @@ steps:
184142
185143# Run trx formatter to output .MD and .CSV
186144- script : |
187- dotnet TrxToExtentReport \
188- --output $(Build.ArtifactStagingDirectory)/test-results/mock-register-cts-integration-tests/MR-CTS-$(Build.BuildNumber).html \
189- --trx $(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/results.trx \
190- --verbose
191- cp $(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/results.trx $(Build.ArtifactStagingDirectory)/test-results/mock-register-cts-integration-tests/MR-CTS-$(Build.BuildNumber).trx
192- displayName : ' Format Test Results'
145+ docker run \
146+ -v=$(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/results.trx:/app/results.trx:ro \
147+ -v=$(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/formatted/:/app/out/:rw \
148+ $(SharedAcrBaseUrl).azurecr.io/trx-formatter -i results.trx -t "MR-CTS" --outputprefix "MR-CTS" -o out/
149+ displayName : ' Run trx-formatter'
193150 condition : always()
194151
195152# Remove integration tests For CTS Only tests
@@ -199,7 +156,7 @@ steps:
199156 condition : always()
200157
201158# Publish mock-register integration tests results
202- - publish : $(Build.ArtifactStagingDirectory)/test-results /mock-register-cts- integration-tests
159+ - publish : Source/_temp /mock-register-integration-tests/testresults
203160 displayName : Publish MockRegister CTS Integration tests
204161 condition : always()
205162 artifact : Mock-Register - CTS Integration tests
@@ -228,15 +185,36 @@ steps:
228185 displayName : Publish container images
229186 # condition: always()
230187 inputs :
231- path : $(build.artifactstagingdirectory)/mock-register.image.tar
188+ path : $(build.artifactstagingdirectory)
232189 artifact : Container Images
233190
191+ # FIXME - MJS - See dockercompose, volume no longer mapped as 1001:121 (vsts:docker) in build pipeline and causes issue with chown in dockerfile (appuser:appgroup), ie stops register from starting because of different user
192+ # # Publish mock-register logs
193+ # - publish: Source/_temp/mock-register/tmp
194+ # displayName: Publish MockRegister logs
195+ # condition: always()
196+ # artifact: Mock-Register - Logs
197+
234198# Publish mock-register unit tests results
235199- publish : Source/_temp/mock-register-unit-tests/testresults
236200 displayName : Publish unit tests
237201 condition : always()
238202 artifact : Mock-Register - Unit tests
239203
204+ - task : UseDotNet@2
205+ displayName : ' Use .NET 8 sdk'
206+ condition : always()
207+ inputs :
208+ packageType : sdk
209+ version : ' 8.0.x'
210+ performMultiLevelLookup : true
211+
212+ - task : CmdLine@2
213+ displayName : ' Restore dotnet tooling'
214+ condition : always()
215+ inputs :
216+ script : ' dotnet tool restore'
217+
240218- script : |
241219 cd Source/CDR.Register.Repository
242220 dotnet ef migrations bundle --context RegisterDatabaseContext --verbose --self-contained
0 commit comments