Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions eng/pipelines/common/templates/jobs/ci-run-tests-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,18 @@ parameters:
- Project
- Package

# The timeout, in minutes, for this job.
- name: timeout
type: string
default: 90

jobs:
- job: ${{ format('{0}', coalesce(parameters.jobDisplayName, parameters.image, 'unknown_image')) }}

# Some of our tests take longer than the default 60 minutes to run on some
# OSes and configurations.
timeoutInMinutes: ${{ parameters.timeout }}

pool:
name: '${{ parameters.poolName }}'
${{ if eq(parameters.hostedPool, true) }}:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,21 @@ parameters:
- name: isPreview
type: boolean

# The timeout, in minutes, for this job.
- name: timeout
type: string
default: 90

jobs:
- job: run_tests_package_reference
displayName: 'Run tests with package reference'
${{ if ne(parameters.dependsOn, 'empty')}}:
dependsOn: '${{parameters.dependsOn }}'

# Some of our tests take longer than the default 60 minutes to run on some
# OSes and configurations.
timeoutInMinutes: ${{ parameters.timeout }}

pool:
type: windows # read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs
isCustom: true
Expand Down
7 changes: 7 additions & 0 deletions eng/pipelines/common/templates/stages/ci-run-tests-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ parameters:
type: jobList
default: []

# The timeout, in minutes, for each test job.
- name: testsTimeout
type: string
default: 90

stages:
- ${{ each config in parameters.testConfigurations }}:
- ${{ each image in config.value.images }}:
Expand All @@ -47,6 +52,7 @@ stages:
parameters:
debug: ${{ parameters.debug }}
buildType: ${{ parameters.buildType }}
timeout: ${{ parameters.testsTimeout }}
poolName: ${{ config.value.pool }}
hostedPool: ${{ eq(config.value.hostedPool, true) }}
image: ${{ image.value }}
Expand All @@ -72,6 +78,7 @@ stages:
parameters:
debug: ${{ parameters.debug }}
buildType: ${{ parameters.buildType }}
timeout: ${{ parameters.testsTimeout }}
poolName: ${{ config.value.pool }}
hostedPool: ${{ eq(config.value.hostedPool, true) }}
image: ${{ image.value }}
Expand Down
29 changes: 6 additions & 23 deletions eng/pipelines/dotnet-sqlclient-ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ parameters:
type: string
default: $(ci_var_defaultPoolName)

# The timeout, in minutes, for each test job.
- name: testsTimeout
type: string
default: 90

variables:
- template: libraries/ci-build-variables.yml@self

Expand All @@ -78,6 +83,7 @@ stages:
parameters:
debug: ${{ parameters.debug }}
buildType: ${{ parameters.buildType }}
testsTimeout: ${{ parameters.testsTimeout }}
${{ if eq(parameters.buildType, 'Package') }}:
dependsOn: build_nugets

Expand Down Expand Up @@ -459,26 +465,3 @@ stages:
UserManagedIdentityClientId: $(UserManagedIdentityClientId)
LocalDbAppName: $(LocalDbAppName)
LocalDbSharedInstanceName: $(LocalDbSharedInstanceName)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to remove this entirely since our tenant just doesn't support Service Principal based auth any more. We can add something back for macOS later if necessary.

# Azure Sql Server - Mac
mac_azure_sql:
pool: $(defaultHostedPoolName)
hostedPool: true
images:
MacOSLatest_Azure_Sql: macos-latest
TargetFrameworks: ${{parameters.targetFrameworksLinux }}
netcoreVersionTestUtils: ${{parameters.netcoreVersionTestUtils }}
buildPlatforms: [AnyCPU]
testSets: ${{parameters.testSets }}
useManagedSNI: [true]
codeCovTargetFrameworks: ${{parameters.codeCovTargetFrameworks }}
configSqlFor: azure
operatingSystem: Mac
configProperties:
# config.json properties
TCPConnectionString: $(AZURE_DB_SP_TCP_CONN_STRING)
NPConnectionString: $(AZURE_DB_SP_NP_CONN_STRING)
SupportsIntegratedSecurity: false
ManagedIdentitySupported: false
LocalDbAppName: $(LocalDbAppName)
LocalDbSharedInstanceName: $(LocalDbSharedInstanceName)
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ parameters: # parameters are shown up in ADO UI in a build queue time
- Project
- Package

# The timeout, in minutes, for each test job.
- name: testsTimeout
displayName: 'Tests timeout (in minutes)'
type: string
default: 90

extends:
template: dotnet-sqlclient-ci-core.yml@self
parameters:
Expand All @@ -92,3 +98,4 @@ extends:
useManagedSNI: ${{ parameters.useManagedSNI }}
codeCovTargetFrameworks: ${{ parameters.codeCovTargetFrameworks }}
buildType: ${{ parameters.buildType }}
testsTimeout: ${{ parameters.testsTimeout }}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ parameters: # parameters are shown up in ADO UI in a build queue time
- Project
- Package

# The timeout, in minutes, for each test job.
- name: testsTimeout
displayName: 'Tests timeout (in minutes)'
type: string
default: 90

extends:
template: dotnet-sqlclient-ci-core.yml@self
parameters:
Expand All @@ -84,3 +90,4 @@ extends:
useManagedSNI: ${{ parameters.useManagedSNI }}
codeCovTargetFrameworks: ${{ parameters.codeCovTargetFrameworks }}
buildType: ${{ parameters.buildType }}
testsTimeout: ${{ parameters.testsTimeout }}
7 changes: 7 additions & 0 deletions eng/pipelines/dotnet-sqlclient-signing-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ parameters: # parameters are shown up in ADO UI in a build queue time
type: boolean
default: false

# The timeout, in minutes, for each test job.
- name: testsTimeout
displayName: 'Tests timeout (in minutes)'
type: string
default: 90

variables:
- template: /eng/pipelines/libraries/variables.yml@self
- name: packageFolderName
Expand Down Expand Up @@ -175,6 +181,7 @@ extends:
parameters:
packageFolderName: $(packageFolderName)
isPreview: ${{ parameters['isPreview'] }}
timeout: ${{ parameters.testsTimeout }}
downloadPackageStep:
download: current
artifact: $(packageFolderName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ public void SqlParameterProperties(string connection)
const string firstColumnName = @"firstColumn";
const string secondColumnName = @"secondColumn";
const string thirdColumnName = @"thirdColumn";
string inputProcedureName = DataTestUtility.GetUniqueName("InputProc").ToString();
string outputProcedureName = DataTestUtility.GetUniqueName("OutputProc").ToString();
string inputProcedureName = DataTestUtility.GetShortName("InputProc").ToString();
string outputProcedureName = DataTestUtility.GetShortName("OutputProc").ToString();
const int charColumnSize = 100;
const int decimalColumnPrecision = 10;
const int decimalColumnScale = 4;
Expand Down Expand Up @@ -694,7 +694,7 @@ public void TestExecuteReader(string connection)
[ClassData(typeof(AEConnectionStringProvider))]
public async Task TestExecuteReaderAsyncWithLargeQuery(string connectionString)
{
string randomName = DataTestUtility.GetUniqueName(Guid.NewGuid().ToString().Replace("-", ""), false);
string randomName = DataTestUtility.GetShortName(Guid.NewGuid().ToString().Replace("-", ""), false);
if (randomName.Length > 50)
{
randomName = randomName.Substring(0, 50);
Expand Down Expand Up @@ -878,8 +878,8 @@ public void TestEnclaveStoredProceduresWithAndWithoutParameters(string connectio
using SqlCommand sqlCommand = new("", sqlConnection, transaction: null,
columnEncryptionSetting: SqlCommandColumnEncryptionSetting.Enabled);

string procWithoutParams = DataTestUtility.GetUniqueName("EnclaveWithoutParams", withBracket: false);
string procWithParam = DataTestUtility.GetUniqueName("EnclaveWithParams", withBracket: false);
string procWithoutParams = DataTestUtility.GetShortName("EnclaveWithoutParams", withBracket: false);
string procWithParam = DataTestUtility.GetShortName("EnclaveWithParams", withBracket: false);

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void TestRoundTripWithCSPAndCertStoreProvider()
public void TestEncryptDecryptWithCSP(string connectionString)
{
string providerName = @"Microsoft Enhanced RSA and AES Cryptographic Provider";
string keyIdentifier = DataTestUtility.GetUniqueNameForSqlServer("CSP");
string keyIdentifier = DataTestUtility.GetLongName("CSP");

try
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using Xunit;

namespace Microsoft.Data.SqlClient.ManualTesting.Tests.AlwaysEncrypted
Expand All @@ -11,11 +13,49 @@ public class TestTrustedMasterKeyPaths : IClassFixture<SQLSetupStrategyCertStore
private readonly string tableName;
private readonly string columnMasterKeyPath;

private static void Log(
string message,
[CallerMemberName] string who = "")
{
StringBuilder builder = new();
builder.Append(DateTime.UtcNow.ToString("HH:mm:ss.fff"));
builder.Append(' ');
builder.Append(nameof(TestTrustedMasterKeyPaths));
builder.Append('.');
builder.Append(who);
builder.Append("(): ");
builder.Append(message);
Console.WriteLine(builder.ToString());
}

private static void LogStart(
[CallerMemberName] string who = "")
{
Log("Start", who);
}
private static void LogEnd(
[CallerMemberName] string who = "")
{
Log("End", who);
}

public TestTrustedMasterKeyPaths(SQLSetupStrategyCertStoreProvider fixture)
{
columnMasterKeyPath = string.Format(@"{0}/{1}/{2}", StoreLocation.CurrentUser.ToString(), @"my", CertificateUtility.CreateCertificate().Thumbprint);
LogStart();

Log("Getting store location current user...");
var user = StoreLocation.CurrentUser.ToString();
Log($"Store location current user: {user}");

Log("Creating certificate...");
var cert = CertificateUtility.CreateCertificate();
Log($"Created certificate with thumbprint {cert.Thumbprint}");

columnMasterKeyPath = $"{user}/my/{cert.Thumbprint}";
this.fixture = fixture;
tableName = fixture.TrustedMasterKeyPathsTestTable.Name;

LogEnd();
}

/// <summary>
Expand All @@ -24,6 +64,7 @@ public TestTrustedMasterKeyPaths(SQLSetupStrategyCertStoreProvider fixture)
/// <param name="sqlDataReader"></param>
private void ValidateResultSet(SqlDataReader sqlDataReader)
{
LogStart();
// Validate the result set
int rowsFound = 0;
while (sqlDataReader.Read())
Expand All @@ -42,13 +83,15 @@ private void ValidateResultSet(SqlDataReader sqlDataReader)
rowsFound++;
}
Assert.True(rowsFound == 1, "Incorrect number of rows returned in first execution.");
LogEnd();
}

[PlatformSpecific(TestPlatforms.Windows)]
[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringSetupForAE))]
[ClassData(typeof(AEConnectionStringProvider))]
public void TestTrustedColumnEncryptionMasterKeyPathsWithNullDictionary(string connection)
{
LogStart();
SqlConnectionStringBuilder connBuilder = new SqlConnectionStringBuilder(connection);
connBuilder.ConnectTimeout = 10000;
string connStringNow = connBuilder.ToString();
Expand Down Expand Up @@ -81,13 +124,15 @@ FROM [{tableName}]
}
// Clear out trusted key paths
SqlConnection.ColumnEncryptionTrustedMasterKeyPaths.Clear();
LogEnd();
}

[PlatformSpecific(TestPlatforms.Windows)]
[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringSetupForAE))]
[ClassData(typeof(AEConnectionStringProvider))]
public void TestTrustedColumnEncryptionMasterKeyPathsWithOneServer(string connection)
{
LogStart();
SqlConnectionStringBuilder connBuilder = new SqlConnectionStringBuilder(connection);
connBuilder.ConnectTimeout = 10000;
string connStringNow = connBuilder.ToString();
Expand Down Expand Up @@ -127,13 +172,15 @@ FROM [{tableName}]
}
// Clear out trusted key paths
SqlConnection.ColumnEncryptionTrustedMasterKeyPaths.Clear();
LogEnd();
}

[PlatformSpecific(TestPlatforms.Windows)]
[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringSetupForAE))]
[ClassData(typeof(AEConnectionStringProvider))]
public void TestTrustedColumnEncryptionMasterKeyPathsWithMultipleServers(string connection)
{
LogStart();
SqlConnectionStringBuilder connBuilder = new SqlConnectionStringBuilder(connection);
connBuilder.ConnectTimeout = 10000;
string connStringNow = connBuilder.ToString();
Expand Down Expand Up @@ -190,13 +237,15 @@ FROM [{tableName}]
}
// Clear out trusted key paths
SqlConnection.ColumnEncryptionTrustedMasterKeyPaths.Clear();
LogEnd();
}

[PlatformSpecific(TestPlatforms.Windows)]
[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringSetupForAE))]
[ClassData(typeof(AEConnectionStringProvider))]
public void TestTrustedColumnEncryptionMasterKeyPathsWithInvalidInputs(string connection)
{
LogStart();
SqlConnectionStringBuilder connBuilder = new SqlConnectionStringBuilder(connection);
connBuilder.ConnectTimeout = 10000;
string connStringNow = connBuilder.ToString();
Expand Down Expand Up @@ -303,6 +352,7 @@ FROM [{tableName}]

// Clear out trusted key paths
SqlConnection.ColumnEncryptionTrustedMasterKeyPaths.Clear();
LogEnd();
}
}
}
Loading
Loading