Skip to content

Commit 66afc3f

Browse files
committed
User Story 39839: Move existing MDS tests to Azure package
- Moved existing tests that use ActiveDirectoryAuthenticationProvider into Azure tests. - Updated some MDS tests that unnecessarily used ActiveDirectoryAuthenticationProvider. - Fixed project-based builds so we can restore MDS netcore and netfx projects at the same time. - Added a Managed Identity provider that is installed by default for the Manual Tests suite. - Moved some tests from ManualTests to Azure that require the provider. - Avoiding calling SetProvider with a null value, since it isn't possible to unset a provider once set. - Added caching to the managed identity provider for the ManualTest project. - Added environment variable debug logging to Abstractions and Azure pipeline jobs. - Moved username/password Entra auth provider into its own file for sharing across tests. - Added ADO service connection for test tasks that require access to Azure resources. - Added workload identity federation tests. - Disabling xUnit shadow copy to prevent strong name varification failures.
1 parent 48e5eb7 commit 66afc3f

36 files changed

+1382
-510
lines changed

eng/pipelines/dotnet-sqlclient-ci-core.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,17 @@ parameters:
8989
type: string
9090
default: 90
9191

92+
- name: dotnetVerbosity
93+
displayName: dotnet CLI Verbosity
94+
type: string
95+
default: normal
96+
values:
97+
- quiet
98+
- minimal
99+
- normal
100+
- detailed
101+
- diagnostic
102+
92103
variables:
93104
- template: libraries/ci-build-variables.yml@self
94105

@@ -110,11 +121,11 @@ stages:
110121
# under the given artifact name.
111122
- template: stages/build-abstractions-package-ci-stage.yml@self
112123
parameters:
113-
buildConfiguration: ${{ parameters.buildConfiguration }}
124+
abstractionsArtifactName: $(abstractionsArtifactName)
114125
abstractionsPackageVersion: $(abstractionsPackageVersion)
115-
artifactName: $(abstractionsArtifactName)
116-
${{if eq(parameters.debug, 'true')}}:
117-
verbosity: diagnostic
126+
buildConfiguration: ${{ parameters.buildConfiguration }}
127+
debug: ${{ parameters.debug }}
128+
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
118129

119130
# Build MDS and its NuGet packages.
120131
- stage: build_mds_akv_packages_stage
@@ -153,25 +164,29 @@ stages:
153164
azureArtifactName: $(azureArtifactName)
154165
azurePackageVersion: $(azurePackageVersion)
155166
buildConfiguration: ${{ parameters.buildConfiguration }}
167+
debug: ${{ parameters.debug }}
168+
mdsArtifactName: $(mdsArtifactName)
169+
mdsPackageVersion: $(mdsPackageVersion)
156170
# When building via package references, we must depend on the Abstractions
157-
# package.
171+
# and MDS packages
158172
${{ if eq(parameters.referenceType, 'Package') }}:
159173
dependsOn:
160174
- build_abstractions_package_stage
175+
- build_mds_akv_packages_stage
161176
referenceType: ${{ parameters.referenceType }}
162-
${{if eq(parameters.debug, 'true')}}:
163-
verbosity: diagnostic
177+
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
164178

165179
# Run the stress tests, if desired.
166180
- ${{ if eq(parameters.enableStressTests, true) }}:
167181
- template: stages/stress-tests-ci-stage.yml@self
168182
parameters:
169183
buildConfiguration: ${{ parameters.buildConfiguration }}
170-
dependsOn: [build_mds_akv_packages_stage]
184+
dependsOn:
185+
- build_mds_akv_packages_stage
186+
- build_azure_package_stage
171187
pipelineArtifactName: $(artifactName)
172188
mdsPackageVersion: $(mdsPackageVersion)
173-
${{ if eq(parameters.debug, 'true') }}:
174-
verbosity: 'detailed'
189+
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
175190

176191
# Run the MDS and AKV tests.
177192
- template: common/templates/stages/ci-run-tests-stage.yml@self

eng/pipelines/dotnet-sqlclient-ci-package-reference-pipeline.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,18 @@ parameters: # parameters are shown up in ADO UI in a build queue time
133133
type: string
134134
default: 90
135135

136+
# Dotnet CLI verbosity level.
137+
- name: dotnetVerbosity
138+
displayName: dotnet CLI Verbosity
139+
type: string
140+
default: normal
141+
values:
142+
- quiet
143+
- minimal
144+
- normal
145+
- detailed
146+
- diagnostic
147+
136148
extends:
137149
template: dotnet-sqlclient-ci-core.yml@self
138150
parameters:
@@ -147,3 +159,4 @@ extends:
147159
buildConfiguration: ${{ parameters.buildConfiguration }}
148160
enableStressTests: ${{ parameters.enableStressTests }}
149161
testsTimeout: ${{ parameters.testsTimeout }}
162+
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}

eng/pipelines/dotnet-sqlclient-ci-project-reference-pipeline.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,18 @@ parameters: # parameters are shown up in ADO UI in a build queue time
133133
type: string
134134
default: 90
135135

136+
# Dotnet CLI verbosity level.
137+
- name: dotnetVerbosity
138+
displayName: dotnet CLI Verbosity
139+
type: string
140+
default: normal
141+
values:
142+
- quiet
143+
- minimal
144+
- normal
145+
- detailed
146+
- diagnostic
147+
136148
extends:
137149
template: dotnet-sqlclient-ci-core.yml@self
138150
parameters:
@@ -147,3 +159,4 @@ extends:
147159
buildConfiguration: ${{ parameters.buildConfiguration }}
148160
enableStressTests: ${{ parameters.enableStressTests }}
149161
testsTimeout: ${{ parameters.testsTimeout }}
162+
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}

eng/pipelines/jobs/pack-abstractions-package-ci-job.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,34 @@
1212

1313
parameters:
1414

15-
# The version to apply to the Abstractions NuGet package and its assemblies.
16-
- name: abstractionsPackageVersion
17-
type: string
18-
1915
# The name to apply to the published pipeline artifact.
20-
- name: artifactName
16+
- name: abstractionsArtifactName
2117
type: string
2218
default: Abstractions.Artifact
2319

20+
# The version to apply to the Abstractions NuGet package and its assemblies.
21+
- name: abstractionsPackageVersion
22+
type: string
23+
2424
# The type of build to test (Release or Debug)
2525
- name: buildConfiguration
2626
type: string
2727
values:
2828
- Release
2929
- Debug
30+
31+
# True to enable extra debug steps and logging.
32+
- name: debug
33+
type: boolean
34+
default: false
3035

3136
# The list of upstream jobs to depend on.
3237
- name: dependsOn
3338
type: object
3439
default: []
3540

3641
# The verbosity level for the dotnet CLI commands.
37-
- name: verbosity
42+
- name: dotnetVerbosity
3843
type: string
3944
default: normal
4045
values:
@@ -69,7 +74,7 @@ jobs:
6974
# dotnet CLI arguments common to all commands.
7075
- name: commonArguments
7176
value: >-
72-
--verbosity ${{ parameters.verbosity }}
77+
--verbosity ${{ parameters.dotnetVerbosity }}
7378
7479
# dotnet CLI arguments for build/test/pack commands
7580
- name: buildArguments
@@ -102,6 +107,11 @@ jobs:
102107

103108
steps:
104109

110+
# Emit environment variables if debug is enabled.
111+
- ${{ if eq(parameters.debug, true) }}:
112+
- pwsh: 'Get-ChildItem Env: | Sort-Object Name'
113+
displayName: '[Debug] Print Environment Variables'
114+
105115
# Install the .NET 9.0 SDK.
106116
- task: UseDotNet@2
107117
displayName: Install .NET 9.0 SDK
@@ -144,5 +154,5 @@ jobs:
144154
displayName: Publish Pipeline Artifact
145155
inputs:
146156
targetPath: $(dotnetPackagesDir)
147-
artifactName: ${{ parameters.artifactName }}
157+
artifactName: ${{ parameters.abstractionsArtifactName }}
148158
publishLocation: pipeline

eng/pipelines/jobs/pack-azure-package-ci-job.yml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,28 @@ parameters:
4040
values:
4141
- Release
4242
- Debug
43+
44+
# True to enable extra debug steps and logging.
45+
- name: debug
46+
type: boolean
47+
default: false
4348

4449
# The list of upstream jobs to depend on.
4550
- name: dependsOn
4651
type: object
4752
default: []
4853

54+
# The verbosity level for the dotnet CLI commands.
55+
- name: dotnetVerbosity
56+
type: string
57+
default: normal
58+
values:
59+
- quiet
60+
- minimal
61+
- normal
62+
- detailed
63+
- diagnostic
64+
4965
# The reference type to use:
5066
#
5167
# Project - dependent projects are referenced directly.
@@ -57,17 +73,6 @@ parameters:
5773
- Package
5874
- Project
5975

60-
# The verbosity level for the dotnet CLI commands.
61-
- name: verbosity
62-
type: string
63-
default: normal
64-
values:
65-
- quiet
66-
- minimal
67-
- normal
68-
- detailed
69-
- diagnostic
70-
7176
jobs:
7277

7378
- job: pack_azure_package_job
@@ -93,8 +98,9 @@ jobs:
9398
# dotnet CLI arguments common to all commands.
9499
- name: commonArguments
95100
value: >-
96-
--verbosity ${{ parameters.verbosity }}
101+
--verbosity ${{ parameters.dotnetVerbosity }}
97102
-p:ReferenceType=${{ parameters.referenceType }}
103+
-p:ForceMdsAssemblyNameSuffix=true
98104
-p:AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }}
99105
100106
# dotnet CLI arguments for build/test/pack commands
@@ -128,6 +134,11 @@ jobs:
128134

129135
steps:
130136

137+
# Emit environment variables if debug is enabled.
138+
- ${{ if eq(parameters.debug, true) }}:
139+
- pwsh: 'Get-ChildItem Env: | Sort-Object Name'
140+
displayName: '[Debug] Print Environment Variables'
141+
131142
# We have a few extra steps for Package reference builds.
132143
- ${{ if eq(parameters.referenceType, 'Package') }}:
133144

eng/pipelines/jobs/test-abstractions-package-ci-job.yml

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,29 @@ parameters:
1919
- Release
2020
- Debug
2121

22+
# True to enable extra debug steps and logging.
23+
- name: debug
24+
type: boolean
25+
default: false
26+
2227
# The prefix to prepend to the job's display name:
2328
#
2429
# [<prefix>] Run Stress Tests
2530
#
2631
- name: displayNamePrefix
2732
type: string
2833

34+
# The verbosity level for the dotnet CLI commands.
35+
- name: dotnetVerbosity
36+
type: string
37+
default: normal
38+
values:
39+
- quiet
40+
- minimal
41+
- normal
42+
- detailed
43+
- diagnostic
44+
2945
# The suffix to append to the job name.
3046
- name: jobNameSuffix
3147
type: string
@@ -44,17 +60,6 @@ parameters:
4460
- name: poolName
4561
type: string
4662

47-
# The verbosity level for the dotnet CLI commands.
48-
- name: verbosity
49-
type: string
50-
default: normal
51-
values:
52-
- quiet
53-
- minimal
54-
- normal
55-
- detailed
56-
- diagnostic
57-
5863
# The pool VM image to use.
5964
- name: vmImage
6065
type: string
@@ -83,7 +88,7 @@ jobs:
8388
# dotnet CLI arguments common to all commands.
8489
- name: commonArguments
8590
value: >-
86-
--verbosity ${{ parameters.verbosity }}
91+
--verbosity ${{ parameters.dotnetVerbosity }}
8792
8893
# dotnet CLI arguments for build/test/pack commands
8994
- name: buildArguments
@@ -115,6 +120,11 @@ jobs:
115120

116121
steps:
117122

123+
# Emit environment variables if debug is enabled.
124+
- ${{ if eq(parameters.debug, true) }}:
125+
- pwsh: 'Get-ChildItem Env: | Sort-Object Name'
126+
displayName: '[Debug] Print Environment Variables'
127+
118128
# Install the .NET 9.0 SDK.
119129
- task: UseDotNet@2
120130
displayName: Install .NET 9.0 SDK

0 commit comments

Comments
 (0)