Skip to content

Commit 29635e1

Browse files
paulmedynskiMichelZbenrr101edwardneal
authored
[6.0] Stabilize CI Pipelines (#3596)
* User Story 38467: Backport mac server name fix - Backported part of #3494 and all of #3591: - Added configurable test jobs timeout, defaulting to 90 minutes. - Reduced generated database names to 96 chars to try to fix macOS test failures.Increase test jobs timeout (#3591) - Fixed the unique name generators to: - Keep max lengths to 30 and 96 characters respectively. - Ensure uniqueness at the start of the names. - Added link to database identifier syntax. * User Story 38467: Backport mac server name fix - Added a new test that was erroneously removed in the earlier cherry-pick. - Added MDS_TEST_CONFIG environment variable to unit test config to override where the confi.json file is read from. - Updated xUnit to 2.9.3 to avoid transitive System.Net.Http vulnerability warnings. * Add retry on deadlock for sp_help (#3025) Add parameter to sp_help * User Story 38467: Backport mac server name fix - Fixed cherry-pick of old function name. * User Story 38467: Backport mac server name fix - Removed macOS Azure SQL test configuration that uses service principal based auth that our Azure tenant no longer supports. * User Story 38467: Backport mac server name fix - Adding console diagnostics to slow enclave tests. * User Story 38467: Backport mac server name fix - Adding console diagnostics to slow enclave tests. * User Story 38467: Backport mac server name fix - Adding console diagnostics to slow enclave tests. * Tests | Remove hardcoded credentials from ManualTests (#3204) * Initial removal of CertificateUtility.CreateCertificate One test implied that DataTestUtility.AKVUrl would point to an RSA key which aligned with the certificate's private key. Switching this to dynamically generate the key in places. * Hotfix for Azure Key Vault tests * Removed hardcoded references to Azure Key Vault key * Removed hardcoded references to CertificateUtilityWin These were mostly related to generating CSP keys. * Code review changes * Reorder properties and constructors * Move AEConnectionStringProviderWithCspParameters to its own file * Tweak to the AKV token acquisition * Code review Redundant bracket, alphabetised the ManualTesting csproj * Update src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/SQLSetupStrategy.cs Let's try @edwardneal's idea Co-authored-by: Edward Neal <[email protected]> * Update src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/SQLSetupStrategy.cs Co-authored-by: Edward Neal <[email protected]> * Fixes as per @edwardneal's suggestions * Fix as per @edwardneal's suggestion * Fix missing `new` Co-authored-by: Edward Neal <[email protected]> * Update src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/SQLSetupStrategyAzureKeyVault.cs Co-authored-by: Edward Neal <[email protected]> * Update src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/SQLSetupStrategyAzureKeyVault.cs Co-authored-by: Edward Neal <[email protected]> * Address comment that we don't need a CspParameters object as part of the test arguments * Move test arguments into property (the class was only used in a single location) * Cleanup test code * Tweak default provider discovery code to handle edge cases a bit better * Address comment regarding readonly member variables Apply long line chomping * Addressing the last of the comments. --------- Co-authored-by: Edward Neal <[email protected]> * - Fixed incorrect unique database object name function that doesn't compile normally. * Updated TestUtilities project to target the same framework as the test project(s) it is compiling with. * Removed diagnostic logging now that Enclave tests are passing. --------- Co-authored-by: Michel Zehnder <[email protected]> Co-authored-by: Benjamin Russell <[email protected]> Co-authored-by: Edward Neal <[email protected]>
1 parent c12134a commit 29635e1

File tree

61 files changed

+1256
-894
lines changed

Some content is hidden

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

61 files changed

+1256
-894
lines changed

eng/pipelines/common/templates/jobs/ci-run-tests-job.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,18 @@ parameters:
7373
- Project
7474
- Package
7575

76+
# The timeout, in minutes, for this job.
77+
- name: timeout
78+
type: string
79+
default: 90
80+
7681
jobs:
7782
- job: ${{ format('{0}', coalesce(parameters.jobDisplayName, parameters.image, 'unknown_image')) }}
7883

84+
# Some of our tests take longer than the default 60 minutes to run on some
85+
# OSes and configurations.
86+
timeoutInMinutes: ${{ parameters.timeout }}
87+
7988
pool:
8089
name: '${{ parameters.poolName }}'
8190
${{ if eq(parameters.hostedPool, true) }}:

eng/pipelines/common/templates/jobs/run-tests-package-reference-job.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,21 @@ parameters:
2020
- name: isPreview
2121
type: boolean
2222

23+
# The timeout, in minutes, for this job.
24+
- name: timeout
25+
type: string
26+
default: 90
27+
2328
jobs:
2429
- job: run_tests_package_reference
2530
displayName: 'Run tests with package reference'
2631
${{ if ne(parameters.dependsOn, 'empty')}}:
2732
dependsOn: '${{parameters.dependsOn }}'
33+
34+
# Some of our tests take longer than the default 60 minutes to run on some
35+
# OSes and configurations.
36+
timeoutInMinutes: ${{ parameters.timeout }}
37+
2838
pool:
2939
type: windows # read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs
3040
isCustom: true

eng/pipelines/common/templates/stages/ci-run-tests-stage.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ parameters:
3030
type: jobList
3131
default: []
3232

33+
# The timeout, in minutes, for each test job.
34+
- name: testsTimeout
35+
type: string
36+
default: 90
37+
3338
stages:
3439
- ${{ each config in parameters.testConfigurations }}:
3540
- ${{ each image in config.value.images }}:
@@ -47,6 +52,7 @@ stages:
4752
parameters:
4853
debug: ${{ parameters.debug }}
4954
buildType: ${{ parameters.buildType }}
55+
timeout: ${{ parameters.testsTimeout }}
5056
poolName: ${{ config.value.pool }}
5157
hostedPool: ${{ eq(config.value.hostedPool, true) }}
5258
image: ${{ image.value }}
@@ -72,6 +78,7 @@ stages:
7278
parameters:
7379
debug: ${{ parameters.debug }}
7480
buildType: ${{ parameters.buildType }}
81+
timeout: ${{ parameters.testsTimeout }}
7582
poolName: ${{ config.value.pool }}
7683
hostedPool: ${{ eq(config.value.hostedPool, true) }}
7784
image: ${{ image.value }}

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

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ parameters:
5757
type: string
5858
default: $(ci_var_defaultPoolName)
5959

60+
# The timeout, in minutes, for each test job.
61+
- name: testsTimeout
62+
type: string
63+
default: 90
64+
6065
variables:
6166
- template: libraries/ci-build-variables.yml@self
6267

@@ -78,6 +83,7 @@ stages:
7883
parameters:
7984
debug: ${{ parameters.debug }}
8085
buildType: ${{ parameters.buildType }}
86+
testsTimeout: ${{ parameters.testsTimeout }}
8187
${{ if eq(parameters.buildType, 'Package') }}:
8288
dependsOn: build_nugets
8389

@@ -459,26 +465,3 @@ stages:
459465
UserManagedIdentityClientId: $(UserManagedIdentityClientId)
460466
LocalDbAppName: $(LocalDbAppName)
461467
LocalDbSharedInstanceName: $(LocalDbSharedInstanceName)
462-
463-
# Azure Sql Server - Mac
464-
mac_azure_sql:
465-
pool: $(defaultHostedPoolName)
466-
hostedPool: true
467-
images:
468-
MacOSLatest_Azure_Sql: macos-latest
469-
TargetFrameworks: ${{parameters.targetFrameworksLinux }}
470-
netcoreVersionTestUtils: ${{parameters.netcoreVersionTestUtils }}
471-
buildPlatforms: [AnyCPU]
472-
testSets: ${{parameters.testSets }}
473-
useManagedSNI: [true]
474-
codeCovTargetFrameworks: ${{parameters.codeCovTargetFrameworks }}
475-
configSqlFor: azure
476-
operatingSystem: Mac
477-
configProperties:
478-
# config.json properties
479-
TCPConnectionString: $(AZURE_DB_SP_TCP_CONN_STRING)
480-
NPConnectionString: $(AZURE_DB_SP_NP_CONN_STRING)
481-
SupportsIntegratedSecurity: false
482-
ManagedIdentitySupported: false
483-
LocalDbAppName: $(LocalDbAppName)
484-
LocalDbSharedInstanceName: $(LocalDbSharedInstanceName)

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ parameters: # parameters are shown up in ADO UI in a build queue time
8181
- Project
8282
- Package
8383

84+
# The timeout, in minutes, for each test job.
85+
- name: testsTimeout
86+
displayName: 'Tests timeout (in minutes)'
87+
type: string
88+
default: 90
89+
8490
extends:
8591
template: dotnet-sqlclient-ci-core.yml@self
8692
parameters:
@@ -92,3 +98,4 @@ extends:
9298
useManagedSNI: ${{ parameters.useManagedSNI }}
9399
codeCovTargetFrameworks: ${{ parameters.codeCovTargetFrameworks }}
94100
buildType: ${{ parameters.buildType }}
101+
testsTimeout: ${{ parameters.testsTimeout }}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ parameters: # parameters are shown up in ADO UI in a build queue time
7373
- Project
7474
- Package
7575

76+
# The timeout, in minutes, for each test job.
77+
- name: testsTimeout
78+
displayName: 'Tests timeout (in minutes)'
79+
type: string
80+
default: 90
81+
7682
extends:
7783
template: dotnet-sqlclient-ci-core.yml@self
7884
parameters:
@@ -84,3 +90,4 @@ extends:
8490
useManagedSNI: ${{ parameters.useManagedSNI }}
8591
codeCovTargetFrameworks: ${{ parameters.codeCovTargetFrameworks }}
8692
buildType: ${{ parameters.buildType }}
93+
testsTimeout: ${{ parameters.testsTimeout }}

eng/pipelines/dotnet-sqlclient-signing-pipeline.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ parameters: # parameters are shown up in ADO UI in a build queue time
6767
type: boolean
6868
default: false
6969

70+
# The timeout, in minutes, for each test job.
71+
- name: testsTimeout
72+
displayName: 'Tests timeout (in minutes)'
73+
type: string
74+
default: 90
75+
7076
variables:
7177
- template: /eng/pipelines/libraries/variables.yml@self
7278
- name: packageFolderName
@@ -175,6 +181,7 @@ extends:
175181
parameters:
176182
packageFolderName: $(packageFolderName)
177183
isPreview: ${{ parameters['isPreview'] }}
184+
timeout: ${{ parameters.testsTimeout }}
178185
downloadPackageStep:
179186
download: current
180187
artifact: $(packageFolderName)

src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/AKVTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,15 @@ public void ForcedColumnDecryptErrorTestShouldFail()
133133
[PlatformSpecific(TestPlatforms.Windows)]
134134
public void TestRoundTripWithAKVAndCertStoreProvider()
135135
{
136-
using SQLSetupStrategyCertStoreProvider certStoreFixture = new();
136+
SqlColumnEncryptionCertificateStoreProvider certStoreProvider = new SqlColumnEncryptionCertificateStoreProvider();
137137
byte[] plainTextColumnEncryptionKey = ColumnEncryptionKey.GenerateRandomBytes(ColumnEncryptionKey.KeySizeInBytes);
138-
byte[] encryptedColumnEncryptionKeyUsingAKV = _fixture.AkvStoreProvider.EncryptColumnEncryptionKey(DataTestUtility.AKVUrl, @"RSA_OAEP", plainTextColumnEncryptionKey);
139-
byte[] columnEncryptionKeyReturnedAKV2Cert = certStoreFixture.CertStoreProvider.DecryptColumnEncryptionKey(certStoreFixture.CspColumnMasterKey.KeyPath, @"RSA_OAEP", encryptedColumnEncryptionKeyUsingAKV);
138+
byte[] encryptedColumnEncryptionKeyUsingAKV = _fixture.AkvStoreProvider.EncryptColumnEncryptionKey(_fixture.AkvKeyUrl, @"RSA_OAEP", plainTextColumnEncryptionKey);
139+
byte[] columnEncryptionKeyReturnedAKV2Cert = certStoreProvider.DecryptColumnEncryptionKey(_fixture.ColumnMasterKeyPath, @"RSA_OAEP", encryptedColumnEncryptionKeyUsingAKV);
140140
Assert.True(plainTextColumnEncryptionKey.SequenceEqual(columnEncryptionKeyReturnedAKV2Cert), @"Roundtrip failed");
141141

142142
// Try the opposite.
143-
byte[] encryptedColumnEncryptionKeyUsingCert = certStoreFixture.CertStoreProvider.EncryptColumnEncryptionKey(certStoreFixture.CspColumnMasterKey.KeyPath, @"RSA_OAEP", plainTextColumnEncryptionKey);
144-
byte[] columnEncryptionKeyReturnedCert2AKV = _fixture.AkvStoreProvider.DecryptColumnEncryptionKey(DataTestUtility.AKVUrl, @"RSA_OAEP", encryptedColumnEncryptionKeyUsingCert);
143+
byte[] encryptedColumnEncryptionKeyUsingCert = certStoreProvider.EncryptColumnEncryptionKey(_fixture.ColumnMasterKeyPath, @"RSA_OAEP", plainTextColumnEncryptionKey);
144+
byte[] columnEncryptionKeyReturnedCert2AKV = _fixture.AkvStoreProvider.DecryptColumnEncryptionKey(_fixture.AkvKeyUrl, @"RSA_OAEP", encryptedColumnEncryptionKeyUsingCert);
145145
Assert.True(plainTextColumnEncryptionKey.SequenceEqual(columnEncryptionKeyReturnedCert2AKV), @"Roundtrip failed");
146146
}
147147

0 commit comments

Comments
 (0)