Skip to content
31 changes: 20 additions & 11 deletions eng/pipelines/pr/jobs/test-buildproj-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,26 @@ jobs:
- imageOverride -equals ${{ parameters.platformImage }}

steps:
# Install the version of the dotnet runtime we will use to execute the test target.
- template: /eng/pipelines/pr/steps/install-dotnet.yml@self
# Install dotnet and the runtime that will run the tests (if it is not netframework)
- template: /eng/pipelines/common/steps/install-dotnet.yml@self
parameters:
runtimeVersion: ${{ parameters.platformDotnet }}
${{ if not(contains(parameters.platformDotnet, 'net4')) }}:
runtimes:
- "${{ replace(parameters.platformDotnet, 'net', '') }}.x"

# Execute the test target
- template: /eng/pipelines/pr/steps/test-buildproj-step.yml
parameters:
buildConfiguration: ${{ parameters.buildConfiguration }}
buildSuffix: ${{ parameters.buildSuffix }}
# Restore dotnet tools
- template: /eng/pipelines/common/steps/restore-dotnet-tools.yml@self

packageShortName: ${{ parameters.packageShortName }}
testFramework: ${{ parameters.platformDotnet }}
testProject: ${{ parameters.testProject }}
# Execute the test target
- task: DotNetCoreCLI@2
displayName: 'Test: ${{ parameters.packageShortName }}${{ parameters.testProject }}'
inputs:
command: build
projects: build.proj
Comment on lines +87 to +91
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

verbosity: detailed
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we want a top-level parameter for this (like the other pipelines), and default to normal.

arguments: >-
-t:Test${{ parameters.packageShortName }}${{ parameters.testProject }}
-p:Configuration=${{ parameters.buildConfiguration }}
-p:BuildNumber='$(Build.BuildNumber)'
-p:BuildSuffix='${{ parameters.buildSuffix }}'
-p:TestFramework=${{ parameters.platformDotnet }}
Comment on lines +86 to +98
61 changes: 43 additions & 18 deletions eng/pipelines/pr/jobs/test-sqlclientmanual-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ parameters:
- name: azureKeyVaultUrl
type: string

# Display name for the config being used for this execution of the manual jobs. This will be used
# for the job name, so it may only contain alphanumeric and '_' characters.
- name: configDisplayName
type: string

# Connection string using named pipes that will be set in the config.json file.
- name: connectionStringNp
type: string
Expand All @@ -71,6 +76,11 @@ parameters:
- name: fileStreamDirectory
type: string

# Whether the server that tests will be executed against is local to the job agent. If `true`
# server configuration steps will be executed prior to running the tests.
- name: isLocalServer
type: boolean

# Name of the local DB application name for localdb tests, this value will be stored in the
# config.json
- name: localDbAppName
Expand All @@ -81,9 +91,13 @@ parameters:
- name: localDbSharedInstanceName
type: string

# Manual test set to execute.
- name: testSet
type: string

jobs:
- job: "test_${{ parameters.platformDisplayName }}_sqlclient_manual"
displayName: "sqlclient_manual_${{ parameters.platformDisplayName }}"
- job: "test_${{ parameters.platformDisplayName }}_${{ parameters.configDisplayName }}_${{ parameters.testSet }}_sqlclient_manual"
displayName: "sqlclient_manual_${{ parameters.configDisplayName}}_${{ parameters.testSet }}_${{ parameters.platformDisplayName }}"

pool:
name: ${{ parameters.poolName }}
Expand All @@ -97,17 +111,23 @@ jobs:
value: $[stageDependencies.${{ parameters.stageNameSecrets }}.secrets_job.outputs['SaPassword.Value']]

steps:
# Install the version of the dotnet runtime we will use to execute the test target.
- template: /eng/pipelines/pr/steps/install-dotnet.yml@self
# Install dotnet and the runtime that will run the tests (if it is not netframework)
- template: /eng/pipelines/common/steps/install-dotnet.yml@self
parameters:
runtimeVersion: ${{ parameters.platformDotnet }}
${{ if not(contains(parameters.platformDotnet, 'net4')) }}:
runtimes:
- "${{ replace(parameters.platformDotnet, 'net', '') }}.x"

# Restore dotnet tools
- template: /eng/pipelines/common/steps/restore-dotnet-tools.yml@self

# Configure the local SQL Server instance
- template: /eng/pipelines/pr/steps/configure-sqlserver-step.yml@self
parameters:
fileStreamDirectory: ${{ parameters.fileStreamDirectory }}
operatingSystem: ${{ parameters.platformOperatingSystem }}
saPassword: $(saPassword)
- ${{ if eq(parameters.isLocalServer, true) }}:
- template: /eng/pipelines/pr/steps/configure-sqlserver-step.yml@self
parameters:
fileStreamDirectory: ${{ parameters.fileStreamDirectory }}
operatingSystem: ${{ parameters.platformOperatingSystem }}
saPassword: $(saPassword)

# Assign the generated SA password to the $Password field. This will allow $(Password) to be
# be replaced in connection strings with whatever set in the secrets stage.
Expand Down Expand Up @@ -149,12 +169,17 @@ jobs:
displayName: 'Generate manual test config'

# Execute TestSqlClientManual target from build.proj
- template: /eng/pipelines/pr/steps/test-buildproj-step.yml
parameters:
buildConfiguration: ${{ parameters.buildConfiguration }}
buildSuffix: ${{ parameters.buildSuffix }}

packageShortName: "SqlClient"
testFramework: ${{ parameters.platformDotnet }}
testProject: "Manual"
- task: DotNetCoreCLI@2
displayName: 'Test: SqlClientManual ${{ parameters.testSet }}'
inputs:
command: build
projects: build.proj
Comment on lines +172 to +176
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

verbosity: detailed
arguments: >-
-t:TestSqlClientManual
-p:Configuration=${{ parameters.buildConfiguration }}
-p:BuildNumber='$(Build.BuildNumber)'
-p:BuildSuffix='${{ parameters.buildSuffix }}'
-p:TestFramework=${{ parameters.platformDotnet }}
-p:TestSet=${{ parameters.testSet }}

7 changes: 5 additions & 2 deletions eng/pipelines/pr/stages/pack-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ stages:
vmImage: 'ubuntu-latest'

steps:
# Install dotnet SDK and restore tools
- template: /eng/pipelines/pr/steps/install-dotnet.yml@self
# Install dotnet
- template: /eng/pipelines/common/steps/install-dotnet.yml@self

# Restore dotnet tools
- template: /eng/pipelines/common/steps/restore-dotnet-tools.yml@self

# ################################################################
# Build/Pack Microsoft.Data.SqlClient
Expand Down
69 changes: 50 additions & 19 deletions eng/pipelines/pr/stages/test-stages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,31 +156,62 @@ stages:

azureKeyVaultTenantId: ${{ parameters.manualTestAzureKeyVaultTenantId }}
azureKeyVaultUrl: ${{ parameters.manualTestAzureKeyVaultUrl }}
configDisplayName: "localhost"
connectionStringNp: ${{ parameters.manualTestConnectionStringNpLocalhost }}
connectionStringTcp: ${{ parameters.manualTestConnectionStringTcpLocalhost }}
fileStreamDirectory: ${{ parameters.manualTestFileStreamDirectory }}
isLocalServer: true
localDbAppName: ${{ parameters.manualTestLocalDbAppName }}
localDbSharedInstanceName: ${{ parameters.manualTestLocalDbSharedInstanceName }}
testSet: "123"

# @TODO:
# # TestSqlClientManual - Azure
# - template: /eng/pipelines/pr/jobs/test-sqlclientmanual-job.yml@self
# parameters:
# buildConfiguration: ${{ parameters.buildConfiguration }}
# buildSuffix: ${{ parameters.buildSuffix }}
# platformDisplayName: ${{ platform.displayName }}
# platformDotnet: ${{ platform.dotnet }}
# platformImage: ${{ platform.image }}
# poolName: ${{ parameters.poolName }}
#
# azureKeyVaultTenantId: ${{ parameters.manualTestAzureKeyVaultTenantId }}
# azureKeyVaultUrl: ${{ parameters.manualTestAzureKeyVaultUrl }}
# connectionStringNp: ${{ parameters.manualTestConnectionStringNpAzure }}
# connectionStringTcp: ${{ parameters.manualTestConnectionStringTcpAzure }}
# fileStreamDirectory: ${{ parameters.manualTestFileStreamDirectory }}
# localDbAppName: ${{ parameters.manualTestLocalDbAppName }}
# localDbSharedInstanceName: ${{ parameters.manualTestLocalDbSharedInstanceName }}
# saPassword: $(manualTestSaPassword)
# TestSqlClientManual - Azure
- template: /eng/pipelines/pr/jobs/test-sqlclientmanual-job.yml@self
parameters:
buildConfiguration: ${{ parameters.buildConfiguration }}
buildSuffix: ${{ parameters.buildSuffix }}
stageNameSecrets: ${{ parameters.stageNameSecrets }}

platformDisplayName: ${{ platform.displayName }}
platformDotnet: ${{ platform.dotnet }}
platformImage: ${{ platform.image }}
platformOperatingSystem: ${{ platform.operatingSystem }}
poolName: ${{ parameters.poolName }}

azureKeyVaultTenantId: ${{ parameters.manualTestAzureKeyVaultTenantId }}
azureKeyVaultUrl: ${{ parameters.manualTestAzureKeyVaultUrl }}
configDisplayName: "azure"
connectionStringNp: ${{ parameters.manualTestConnectionStringNpAzure }}
connectionStringTcp: ${{ parameters.manualTestConnectionStringTcpAzure }}
fileStreamDirectory: ${{ parameters.manualTestFileStreamDirectory }}
isLocalServer: false
localDbAppName: ${{ parameters.manualTestLocalDbAppName }}
localDbSharedInstanceName: ${{ parameters.manualTestLocalDbSharedInstanceName }}
testSet: "123"

# TestSqlClientManual - Localhost Always Encrypted
- template: /eng/pipelines/pr/jobs/test-sqlclientmanual-job.yml@self
parameters:
buildConfiguration: "Release" # AE tests are not stable enough to run in DEBUG mode (as of 5/29/26)
buildSuffix: ${{ parameters.buildSuffix }}
stageNameSecrets: ${{ parameters.stageNameSecrets }}

platformDisplayName: ${{ platform.displayName }}
platformDotnet: ${{ platform.dotnet }}
platformImage: ${{ platform.image }}
platformOperatingSystem: ${{ platform.operatingSystem }}
poolName: ${{ parameters.poolName }}

azureKeyVaultTenantId: ${{ parameters.manualTestAzureKeyVaultTenantId }}
azureKeyVaultUrl: ${{ parameters.manualTestAzureKeyVaultUrl }}
configDisplayName: "localhost_ae"
connectionStringNp: ${{ parameters.manualTestConnectionStringNpLocalhost }}
connectionStringTcp: ${{ parameters.manualTestConnectionStringTcpLocalhost }}
fileStreamDirectory: ${{ parameters.manualTestFileStreamDirectory }}
isLocalServer: true
localDbAppName: ${{ parameters.manualTestLocalDbAppName }}
localDbSharedInstanceName: ${{ parameters.manualTestLocalDbSharedInstanceName }}
testSet: "AE"

# TestSqlClientUnit
- template: /eng/pipelines/pr/jobs/test-buildproj-job.yml@self
Expand Down
46 changes: 0 additions & 46 deletions eng/pipelines/pr/steps/build-buildproj-step.yml

This file was deleted.

27 changes: 0 additions & 27 deletions eng/pipelines/pr/steps/install-dotnet.yml

This file was deleted.

2 changes: 1 addition & 1 deletion eng/pipelines/pr/steps/pack-buildproj-step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ parameters:

steps:
- task: DotNetCoreCLI@2
displayName: 'build.proj - Build${{ parameters.packageShortName }}'
displayName: 'Pack: ${{ parameters.packageShortName }}'
condition: ${{ parameters.condition }}
inputs:
command: build
Expand Down
59 changes: 0 additions & 59 deletions eng/pipelines/pr/steps/test-buildproj-step.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ namespace Microsoft.Data.SqlClient.ManualTests.BulkCopy
{
public class CopyAllFromReaderConnectionClosedOnEventAsync
{
[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup))]
[Trait("Category", "flaky")] // Hangs and crashes on occasion
[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureServer))]
public void Test()
{
string srcConstr = DataTestUtility.TCPConnectionString;
Expand Down
Loading
Loading