Skip to content

Commit a5bee07

Browse files
authored
Fix public build ci not picking up latest built test assembly (#1217)
1 parent 81aa432 commit a5bee07

File tree

3 files changed

+43
-7
lines changed

3 files changed

+43
-7
lines changed

eng/ci/public-build.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ extends:
7070
# Run tests
7171
- template: /eng/templates/test.yml@self
7272
parameters:
73-
testAssembly: '**\bin\**\DurableTask.Core.Tests.dll'
73+
testAssembly: 'tests/**/DurableTask.Core.Tests.dll'
74+
artifactName: 'CoreTests'
7475
- stage: DTFxASValidate
7576
dependsOn: []
7677
jobs:
@@ -89,7 +90,8 @@ extends:
8990
# Run tests
9091
- template: /eng/templates/test.yml@self
9192
parameters:
92-
testAssembly: '**\bin\**\DurableTask.AzureStorage.Tests.dll'
93+
testAssembly: 'tests/**/DurableTask.AzureStorage.Tests.dll'
94+
artifactName: 'AzureStorageTests'
9395
- stage: DTFxEmulatorValidate
9496
dependsOn: []
9597
jobs:
@@ -108,4 +110,5 @@ extends:
108110
# Run tests
109111
- template: /eng/templates/test.yml@self
110112
parameters:
111-
testAssembly: '**\bin\**\DurableTask.Emulator.Tests.dll'
113+
testAssembly: 'tests/**/DurableTask.Emulator.Tests.dll'
114+
artifactName: 'EmulatorTests'

eng/templates/build-steps.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ steps:
8888
configuration: ${{ parameters.buildConfiguration }}
8989
msbuildArgs: /p:FileVersionRevision=$(Build.BuildId) /p:ContinuousIntegrationBuild=true
9090

91+
- task: 1ES.PublishPipelineArtifact@1
92+
displayName: 'Publish Core Tests Artifact'
93+
inputs:
94+
path: $(Build.SourcesDirectory)/Test/DurableTask.Core.Tests/bin/${{ parameters.buildConfiguration }}
95+
artifact: CoreTests
96+
9197
- task: VSBuild@1
9298
displayName: 'Build (AzureStorage Tests)'
9399
inputs:
@@ -96,6 +102,12 @@ steps:
96102
logFileVerbosity: minimal
97103
configuration: ${{ parameters.buildConfiguration }}
98104
msbuildArgs: /p:FileVersionRevision=$(Build.BuildId) /p:ContinuousIntegrationBuild=true
105+
106+
- task: 1ES.PublishPipelineArtifact@1
107+
displayName: 'Publish AzureStorage Tests Artifact'
108+
inputs:
109+
path: $(Build.SourcesDirectory)/Test/DurableTask.AzureStorage.Tests/bin/${{ parameters.buildConfiguration }}
110+
artifact: AzureStorageTests
99111

100112
- task: VSBuild@1
101113
displayName: 'Build (Emulator Tests)'
@@ -104,4 +116,10 @@ steps:
104116
vsVersion: '17.0'
105117
logFileVerbosity: minimal
106118
configuration: ${{ parameters.buildConfiguration }}
107-
msbuildArgs: /p:FileVersionRevision=$(Build.BuildId) /p:ContinuousIntegrationBuild=true
119+
msbuildArgs: /p:FileVersionRevision=$(Build.BuildId) /p:ContinuousIntegrationBuild=true
120+
121+
- task: 1ES.PublishPipelineArtifact@1
122+
displayName: 'Publish Emulator Tests Artifact'
123+
inputs:
124+
path: $(Build.SourcesDirectory)/Test/DurableTask.Emulator.Tests/bin/${{ parameters.buildConfiguration }}
125+
artifact: EmulatorTests

eng/templates/test.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,22 @@ parameters:
22
- name: testAssembly
33
type: string
44
default: ''
5-
5+
- name: artifactName
6+
type: string
7+
default: ''
68

79
steps:
10+
- task: DownloadPipelineArtifact@2
11+
displayName: 'Download Tests Artifact'
12+
inputs:
13+
artifactName: '${{ parameters.artifactName }}'
14+
targetPath: '$(System.DefaultWorkingDirectory)/tests'
15+
16+
- bash: |
17+
echo "Listing downloaded test DLLs:"
18+
find "$(System.DefaultWorkingDirectory)/tests" -name '*Test*.dll'
19+
displayName: 'List Test DLLs'
20+
821
# Install Azurite
922
- bash: |
1023
echo "Installing azurite"
@@ -20,7 +33,8 @@ steps:
2033
- task: VSTest@2
2134
displayName: 'Run tests'
2235
inputs:
23-
testAssemblyVer2: ${{ parameters.testAssembly }}
36+
testAssemblyVer2: |
37+
$(System.DefaultWorkingDirectory)/${{ parameters.testAssembly }}
2438
testFiltercriteria: 'TestCategory!=DisabledInCI'
2539
vsTestVersion: 17.0
2640
distributionBatchType: basedOnExecutionTime
@@ -30,4 +44,5 @@ steps:
3044
collectDumpOn: always
3145
rerunFailedTests: true
3246
rerunFailedThreshold: 30
33-
rerunMaxAttempts: 3
47+
rerunMaxAttempts: 3
48+
runInParallel: true

0 commit comments

Comments
 (0)