Skip to content

Commit 1e27ff4

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. - Modified tests moved from ManualTests to compile using the new Config helper. - Injecting config into pipeline runs via the config.json approach. - Simplified TestUtilities project. - Added ADO CI pool condition to some tests that require it. - Updated xunit.runner.json config to indicate which options are only available in xUnit v3+. - Fixed exception message check to account for OS differences. - Solved the mystery of SNI DLLs missing for .NET Framework project-reference-based builds. - Added ADO-CI-1ES pool jobs to test the Azure package on Linux and Windows. - Fixed Azure package pipelines to support pools in the ADO.Net and Public projects. - Added some new pipeline variables to handle the Workload Identity Federation test.
1 parent 87497dc commit 1e27ff4

File tree

51 files changed

+1925
-678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1925
-678
lines changed

eng/pipelines/common/templates/steps/ensure-dotnet-version.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
# Reason for not using UseDotNet task:
1111
# [BUG]: UseDotNet task installs x86 build on Windows arm64
1212
# https://github.com/microsoft/azure-pipelines-tasks/issues/20300
13+
#
14+
# A possible workaround is discussed here:
15+
#
16+
# https://github.com/microsoft/azure-pipelines-tasks/issues/16501
17+
#
18+
# TODO: See if we can eliminate this template and just use the above workaround
19+
# for the Windows x86 builds.
1320

1421
parameters:
1522
- # Directory where dotnet binaries should be installed. If not specified, defaults to the

eng/pipelines/common/templates/steps/update-config-file-step.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ parameters:
124124
type: boolean
125125
default: true
126126

127+
- name: WorkloadIdentityFederationServiceConnectionId
128+
type: string
129+
default: ''
130+
127131
steps:
128132
# All properties should be added here, and this template should be used for any manipulation of the config.json file.
129133
- pwsh: |
@@ -180,6 +184,7 @@ steps:
180184
$p.IsDNSCachingSupportedCR=[System.Convert]::ToBoolean("${{parameters.IsDNSCachingSupportedCR }}")
181185
$p.TracingEnabled=[System.Convert]::ToBoolean("${{parameters.TracingEnabled }}")
182186
$p.EnclaveEnabled=[System.Convert]::ToBoolean("${{parameters.EnclaveEnabled }}")
187+
$p.WorkloadIdentityFederationServiceConnectionId="${{parameters.WorkloadIdentityFederationServiceConnectionId }}"
183188
}
184189
$jdata | ConvertTo-Json | Set-Content "config.json"
185190
workingDirectory: src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities
@@ -196,4 +201,4 @@ steps:
196201
}
197202
}
198203
workingDirectory: src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities
199-
displayName: 'Read config.json [debug]'
204+
displayName: '[Debug] Read config.json'

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: 23 additions & 12 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,13 +74,14 @@ 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
7681
value: >-
7782
$(commonArguments)
7883
--configuration ${{ parameters.buildConfiguration }}
84+
-p:ForceMdsAssemblyNameSuffix=true
7985
-p:AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }}
8086
8187
# Explicitly unset the $PLATFORM environment variable that is set by the
@@ -102,6 +108,11 @@ jobs:
102108

103109
steps:
104110

111+
# Emit environment variables if debug is enabled.
112+
- ${{ if eq(parameters.debug, true) }}:
113+
- pwsh: 'Get-ChildItem Env: | Sort-Object Name'
114+
displayName: '[Debug] Print Environment Variables'
115+
105116
# Install the .NET 9.0 SDK.
106117
- task: UseDotNet@2
107118
displayName: Install .NET 9.0 SDK
@@ -112,18 +123,18 @@ jobs:
112123
# We use the 'custom' command because the DotNetCoreCLI@2 task doesn't
113124
# support all of our argument combinations for the different build steps.
114125

115-
# Restore the solution.
126+
# Restore the project.
116127
- task: DotNetCoreCLI@2
117-
displayName: Restore Solution
128+
displayName: Restore Project
118129
inputs:
119130
command: custom
120131
custom: restore
121132
projects: $(project)
122133
arguments: $(commonArguments)
123134

124-
# Build the solution.
135+
# Build the project.
125136
- task: DotNetCoreCLI@2
126-
displayName: Build Solution
137+
displayName: Build Project
127138
inputs:
128139
command: custom
129140
custom: build
@@ -144,5 +155,5 @@ jobs:
144155
displayName: Publish Pipeline Artifact
145156
inputs:
146157
targetPath: $(dotnetPackagesDir)
147-
artifactName: ${{ parameters.artifactName }}
158+
artifactName: ${{ parameters.abstractionsArtifactName }}
148159
publishLocation: pipeline

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

Lines changed: 27 additions & 16 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

@@ -152,18 +163,18 @@ jobs:
152163
# We use the 'custom' command because the DotNetCoreCLI@2 task doesn't
153164
# support all of our argument combinations for the different build steps.
154165

155-
# Restore the solution.
166+
# Restore the project.
156167
- task: DotNetCoreCLI@2
157-
displayName: Restore Solution
168+
displayName: Restore Project
158169
inputs:
159170
command: custom
160171
custom: restore
161172
projects: $(project)
162173
arguments: $(commonArguments)
163174

164-
# Build the solution.
175+
# Build the project.
165176
- task: DotNetCoreCLI@2
166-
displayName: Build Solution
177+
displayName: Build Project
167178
inputs:
168179
command: custom
169180
custom: build

0 commit comments

Comments
 (0)