From 048de75d7db5f507df547077b67f2e6a65d980eb Mon Sep 17 00:00:00 2001 From: Paul Medynski <31868385+paulmedynski@users.noreply.github.com> Date: Mon, 5 Jan 2026 10:11:28 -0400 Subject: [PATCH 1/6] Task 40503: Create stress test pipeline - Added initial placeholder pipeline entry point file. - Wired up the new top-level stress test pipeline to the existing stages/jobs. - Using human friendly triggering pipeline names. - Removed PR pipeline as upstream trigger. - When triggered manually, we must choose one of the upstream pipelines to use for artifact download. - Temporarily added PR-SqlClient-Package to help with PR-based testing. - Sorted template parameters alphabetically. - Added debugging for artifact details. --- eng/pipelines/dotnet-sqlclient-ci-core.yml | 26 +- ...qlclient-ci-package-reference-pipeline.yml | 7 - ...qlclient-ci-project-reference-pipeline.yml | 7 - eng/pipelines/jobs/stress-tests-ci-job.yml | 390 +++++++++++------- .../sqlclient-pr-package-ref-pipeline.yml | 7 - .../sqlclient-pr-project-ref-pipeline.yml | 7 - .../stages/stress-tests-ci-stage.yml | 106 +++-- eng/pipelines/stress-tests-pipeline.yml | 101 +++-- 8 files changed, 391 insertions(+), 260 deletions(-) diff --git a/eng/pipelines/dotnet-sqlclient-ci-core.yml b/eng/pipelines/dotnet-sqlclient-ci-core.yml index f9ead686ff..17c3d30dea 100644 --- a/eng/pipelines/dotnet-sqlclient-ci-core.yml +++ b/eng/pipelines/dotnet-sqlclient-ci-core.yml @@ -78,11 +78,6 @@ parameters: type: string default: $(ci_var_defaultPoolName) - # True to add a Stress Test stage to the pipeline. - - name: enableStressTests - type: boolean - default: false - # The timeout, in minutes, for each test job. - name: testJobTimeout type: number @@ -212,19 +207,6 @@ stages: loggingArtifactsName: $(loggingArtifactsName) mdsArtifactsName: $(mdsArtifactsName) - # Run the stress tests, if desired. - - ${{ if eq(parameters.enableStressTests, true) }}: - - template: /eng/pipelines/stages/stress-tests-ci-stage.yml@self - parameters: - buildConfiguration: ${{ parameters.buildConfiguration }} - additionalDependsOn: - - build_sqlclient_package_stage - - build_azure_package_stage - mdsArtifactsName: $(mdsArtifactsName) - mdsPackageVersion: $(mdsPackageVersion) - azurePackageVersion: $(azurePackageVersion) - dotnetVerbosity: ${{ parameters.dotnetVerbosity }} - # Run the MDS and AKV tests. - template: /eng/pipelines/common/templates/stages/ci-run-tests-stage.yml@self parameters: @@ -260,6 +242,14 @@ stages: - pwsh: "Get-ChildItem env: | Sort-Object Name" displayName: "[Debug] List Environment Variables" + - template: common/templates/stages/ci-run-tests-stage.yml@self + parameters: + debug: ${{ parameters.debug }} + buildConfiguration: ${{ parameters.buildConfiguration }} + testJobTimeout: ${{ parameters.testJobTimeout }} + ${{ if eq(parameters.buildType, 'Package') }}: + dependsOn: build_nugets + # Include the code coverage job if the build type is Project. ${{ if eq(parameters.referenceType, 'Project') }}: # Jobs to run as part of the tests stage, after the tests are done. diff --git a/eng/pipelines/dotnet-sqlclient-ci-package-reference-pipeline.yml b/eng/pipelines/dotnet-sqlclient-ci-package-reference-pipeline.yml index 262c2b909a..d38fb14d57 100644 --- a/eng/pipelines/dotnet-sqlclient-ci-package-reference-pipeline.yml +++ b/eng/pipelines/dotnet-sqlclient-ci-package-reference-pipeline.yml @@ -103,12 +103,6 @@ parameters: type: boolean default: false - # True to run the stress tests stage. - - name: enableStressTests - displayName: Enable Stress Tests - type: boolean - default: false - # The target frameworks to build and run tests for on Windows. # # These are _not_ the target frameworks to build the driver packages for. @@ -173,7 +167,6 @@ extends: referenceType: Package debug: ${{ parameters.debug }} dotnetVerbosity: ${{ parameters.dotnetVerbosity }} - enableStressTests: ${{ parameters.enableStressTests }} targetFrameworks: ${{ parameters.targetFrameworks }} targetFrameworksUnix: ${{ parameters.targetFrameworksUnix }} testJobTimeout: ${{ parameters.testJobTimeout }} diff --git a/eng/pipelines/dotnet-sqlclient-ci-project-reference-pipeline.yml b/eng/pipelines/dotnet-sqlclient-ci-project-reference-pipeline.yml index a5a78f0f8b..7fef476e59 100644 --- a/eng/pipelines/dotnet-sqlclient-ci-project-reference-pipeline.yml +++ b/eng/pipelines/dotnet-sqlclient-ci-project-reference-pipeline.yml @@ -103,12 +103,6 @@ parameters: type: boolean default: false - # True to run the stress tests stage. - - name: enableStressTests - displayName: Enable Stress Tests - type: boolean - default: false - # The target frameworks to build and run tests for on Windows. # # These are _not_ the target frameworks to build the driver packages for. @@ -173,7 +167,6 @@ extends: referenceType: Project debug: ${{ parameters.debug }} dotnetVerbosity: ${{ parameters.dotnetVerbosity }} - enableStressTests: ${{ parameters.enableStressTests }} targetFrameworks: ${{ parameters.targetFrameworks }} targetFrameworksUnix: ${{ parameters.targetFrameworksUnix }} testJobTimeout: ${{ parameters.testJobTimeout }} diff --git a/eng/pipelines/jobs/stress-tests-ci-job.yml b/eng/pipelines/jobs/stress-tests-ci-job.yml index 7477295f54..119973dab8 100644 --- a/eng/pipelines/jobs/stress-tests-ci-job.yml +++ b/eng/pipelines/jobs/stress-tests-ci-job.yml @@ -15,10 +15,22 @@ # depended on by downstream jobs. parameters: - # The suffix to append to the job name. - - name: jobNameSuffix + + # dotnet CLI arguments for the build and run steps. + - name: buildArguments type: string - default: '' + + # The stress test config file contents to write to the config file. + # + # This should point to the SQL Server configured via the sqlSetupStep + # parameter, with user 'sa' and password of $(Password). + - name: configContent + type: string + + # True to enable debugging steps. + - name: debug + type: boolean + default: false # The prefix to prepend to the job's display name: # @@ -26,169 +38,257 @@ parameters: # - name: displayNamePrefix type: string - default: '' - # The name of the Azure Pipelines pool to use. - - name: poolName + # The suffix to append to the job name. + - name: jobNameSuffix type: string - default: '' - # The pool VM image to use. - - name: vmImage + # The MDS package version to stress test. This version must be available in + # one of the configured NuGet sources. + # + # If empty, the MDS version will be parsed from the NuGet package filename + # downloaded from the pipeline artifact. + - name: mdsPackageVersion type: string default: '' - # The pipeline step to run to configure SQL Server. - - name: sqlSetupStep - type: step + # The list of .NET Framework runtimes to test against. + - name: netFrameworkTestRuntimes + type: object + default: [] - # The name of the MDS pipeline artifacts to download. - - name: mdsArtifactsName + # The list of .NET runtimes to test against. + - name: netTestRuntimes + type: object + default: [] + + # The alias of the pipeline whose artifacts we should download. This is the + # name given to a pipeline resource in the resources definition section of the + # top-level pipeline, for example: + # + # resources: + # pipelines: + # - pipeline: + # + # See: + # + # https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/resources-pipelines-pipeline?view=azure-pipelines#the-pipeline-resource-metadata-as-predefined-variables + # + - name: pipelineAlias type: string - default: '' - # The solution file to restore/build. - - name: solution + # The name of the pipeline artifact to download that contains the MDS package + # to stress test. + - name: pipelineArtifactName type: string - default: '' - # The test project to run. - - name: testProject + # The name of the Azure Pipelines pool to use. + - name: poolName type: string - default: '' # dotnet CLI arguments for the restore step. - name: restoreArguments type: string - default: '' - # dotnet CLI arguments for the build and run steps. - - name: buildArguments + # The solution file to restore/build. + - name: solution type: string - default: '' - # The list of .NET runtimes to test against. - - name: netTestRuntimes - type: object - default: [] + # The filename (absolute path) of a template step to run to configure SQL + # Server. + # + # This step is expected to require no parameters. It must configure a SQL + # Server instance listening on localhost for SQL auth via the 'sa' user with + # the pipeline variable $(Password) as the password. + - name: sqlSetupStep + type: string - # The list of .NET Framework runtimes to test against. - - name: netFrameworkTestRuntimes - type: object - default: [] + # The test project to run. + - name: testProject + type: string - # The stress test config file contents to write to the config file. - - name: configContent + # The verbosity level for the dotnet CLI commands. + - name: verbosity + type: string + default: normal + values: + - quiet + - minimal + - normal + - detailed + - diagnostic + + # The pool VM image to use. + - name: vmImage type: string - default: '' jobs: -- job: run_stress_tests_job_${{ parameters.jobNameSuffix }} - displayName: '[${{ parameters.displayNamePrefix }}] Run Stress Tests' - pool: - name: ${{ parameters.poolName }} - ${{ if eq(parameters.poolName, 'Azure Pipelines') }}: - vmImage: ${{ parameters.vmImage }} - ${{ else }}: - demands: - - imageOverride -equals ${{ parameters.vmImage }} - - variables: - # Stress test command-line arguments. - - name: testArguments - value: -a SqlClient.Stress.Tests -console - - # Explicitly unset the $PLATFORM environment variable that is set by the - # 'ADO Build properties' Library in the ADO SqlClientDrivers public project. - # This is defined with a non-standard Platform of 'AnyCPU', and will fail - # the builds if left defined. The stress tests solution does not require - # any specific Platform, and so its solution file doesn't support any - # non-standard platforms. - # - # Note that Azure Pipelines will inject this variable as PLATFORM into the - # environment of all tasks in this job. - # - # See: - # https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch - # - - name: Platform - value: '' - - # Do the same for $CONFIGURATION since we explicitly set it using our - # 'buildConfiguration' parameter, and we don't want the environment to - # override us. - - name: Configuration - value: '' - - steps: - - # Install the .NET SDK and Runtimes. - - template: /eng/pipelines/steps/install-dotnet.yml@self - parameters: - runtimes: [8.x, 9.x] - - # Download the pipeline artifact that contains the MDS package to test. - - task: DownloadPipelineArtifact@2 - displayName: Download MDS Artifacts - inputs: - artifactName: ${{ parameters.mdsArtifactsName }} - targetPath: $(Build.SourcesDirectory)/packages - - # Setup the local SQL Server. - - ${{ parameters.sqlSetupStep }} - - # We use the 'custom' command because the DotNetCoreCLI@2 task doesn't support - # all of our argument combinations for the different build steps. - - # Restore the solution. - - task: DotNetCoreCLI@2 - displayName: Restore Solution - inputs: - command: custom - custom: restore - projects: ${{ parameters.solution }} - arguments: ${{ parameters.restoreArguments }} - - # Build the solution. - - task: DotNetCoreCLI@2 - displayName: Build Solution - inputs: - command: custom - custom: build - projects: ${{ parameters.solution }} - arguments: ${{ parameters.buildArguments }} --no-restore - - # Write the config file. - - task: PowerShell@2 - displayName: Write Config File - inputs: - pwsh: true - targetType: inline - script: | - # Capture the multi-line JSON content into a variable. - $content = @" - ${{ parameters.configContent }} - "@ - - # Write the JSON content to the config file. - $content | Out-File -FilePath "config.json" - - # Run the stress tests for each .NET runtime. - - ${{ each runtime in parameters.netTestRuntimes }}: - - task: DotNetCoreCLI@2 - displayName: Test [${{runtime}}] - inputs: - command: custom - custom: run - projects: ${{ parameters.testProject }} - arguments: ${{ parameters.buildArguments }} --no-build -f ${{runtime}} -e STRESS_CONFIG_FILE=config.json -- $(testArguments) - - # Run the stress tests for each .NET Framework runtime. - - ${{ each runtime in parameters.netFrameworkTestRuntimes }}: - - task: DotNetCoreCLI@2 - displayName: Test [${{runtime}}] - inputs: - command: custom - custom: run - projects: ${{ parameters.testProject }} - arguments: ${{ parameters.buildArguments }} --no-build -f ${{runtime}} -e STRESS_CONFIG_FILE=config.json -- $(testArguments) + - job: run_stress_tests_job_${{ parameters.jobNameSuffix }} + displayName: '[${{ parameters.displayNamePrefix }}] Run Stress Tests' + pool: + name: ${{ parameters.poolName }} + ${{ if eq(parameters.poolName, 'Azure Pipelines') }}: + vmImage: ${{ parameters.vmImage }} + ${{ else }}: + demands: + - imageOverride -equals ${{ parameters.vmImage }} + + variables: + + # Stress test command-line arguments. + - name: testArguments + value: -a SqlClient.Stress.Tests -console + + # The MDS package version to use. + # + # We assign the parameter to a variable so we can update it later via a + # PowerShell script that parses the version from the package filename. + - name: mdsVersion + value: ${{ parameters.mdsPackageVersion }} + + # Variables for the specific pipeline run to download artifacts from. We + # must expand these values here; they don't expand properly if used + # directly in the download task step below. + - name: artifactProjectId + value: $[variables['resources.pipeline.${{ parameters.pipelineAlias }}.projectID']] + - name: artifactPipelineId + value: $[variables['resources.pipeline.${{ parameters.pipelineAlias }}.pipelineID']] + - name: artifactRunId + value: $[variables['resources.pipeline.${{ parameters.pipelineAlias }}.runID']] + + steps: + + # Install the .NET SDK and Runtimes. + - template: /eng/pipelines/steps/install-dotnet.yml@self + parameters: + runtimes: [8.x, 9.x] + + # Emit the artifact details. + - ${{ if eq(parameters.debug, true) }}: + - pwsh: | + Write-Host "Downloading artifact from pipeline alias: ${{ parameters.pipelineAlias }}" + Write-Host " Project ID: $(artifactProjectId)" + Write-Host " Pipeline ID: $(artifactPipelineId)" + Write-Host " Run ID: $(artifactRunId)" + displayName: '[Debug] Emit Artifact Details' + + # Download the pipeline artifact that contains the MDS package to test. + - task: DownloadPipelineArtifact@2 + displayName: Download Pipeline Artifact + inputs: + buildType: specific + artifactName: ${{ parameters.pipelineArtifactName }} + # The stress tests solution has a NuGet.config file that configures + # sources to look in this packages/ directory. + targetPath: $(Build.SourcesDirectory)/packages + # If we were triggered by an upstream pipeline run, download the + # artifacts from that specific run. + preferTriggeringPipeline: true + # Otherwise, use the pipeline alias to explicitly choose the + # artifacts. + project: $(artifactProjectId) + pipeline: $(artifactPipelineId) + runVersion: specific + runId: $(artifactRunId) + + # Determine the MDS package version if not specified. + # + # This will clobber the $(mdsVersion) variable. + # + - ${{ if eq(parameters.mdsPackageVersion, '') }}: + - task: PowerShell@2 + displayName: Determine MDS Package Version + inputs: + pwsh: true + targetType: inline + script: | + # Get the list of MDS package files in the packages directory. + $packageFiles = Get-ChildItem -Path "$(Build.SourcesDirectory)/packages" -Filter "Microsoft.Data.SqlClient.*.nupkg" + + if ($packageFiles.Count -eq 0) + { + throw "No Microsoft.Data.SqlClient NuGet package found in packages directory." + } + elseif ($packageFiles.Count -gt 1) + { + throw "Multiple Microsoft.Data.SqlClient NuGet packages found in packages directory." + } + else + { + # Extract the version from the package filename. + $packageFile = $packageFiles[0] + if ($packageFile.Name -match 'Microsoft\.Data\.SqlClient\.(?.+)\.nupkg') + { + $version = $matches['version'] + Write-Host "##vso[task.setvariable variable=mdsVersion]$version" + Write-Host "Determined MDS package version: $version" + } + else + { + throw "Failed to parse version from package filename: $($packageFile.Name)" + } + } + + # Emit the MDS version under test. + - pwsh: | + Write-Host "Testing MDS package version: $(mdsVersion)" + displayName: Emit MDS Version + + # Setup the local SQL Server. + - template: ${{ parameters.sqlSetupStep }}@self + + # We use the 'custom' command because the DotNetCoreCLI@2 task doesn't + # support all of our argument combinations for the different build steps. + + # Restore the solution. + - task: DotNetCoreCLI@2 + displayName: Restore Solution + inputs: + command: custom + custom: restore + projects: ${{ parameters.solution }} + arguments: ${{ parameters.restoreArguments }} -p:MdsPackageVersion=$(mdsVersion) + + # Build the solution. + - task: DotNetCoreCLI@2 + displayName: Build Solution + inputs: + command: custom + custom: build + projects: ${{ parameters.solution }} + arguments: ${{ parameters.buildArguments }} --no-restore -p:MdsPackageVersion=$(mdsVersion) + + # Write the config file. + - task: PowerShell@2 + displayName: Write Config File + inputs: + pwsh: true + targetType: inline + script: | + # Capture the multi-line JSON content into a variable. + $content = @" + ${{ parameters.configContent }} + "@ + + # Write the JSON content to the config file. + $content | Out-File -FilePath "config.json" + + # Run the stress tests for each .NET runtime. + - ${{ each runtime in parameters.netTestRuntimes }}: + - task: DotNetCoreCLI@2 + displayName: Test [${{runtime}}] + inputs: + command: custom + custom: run + projects: ${{ parameters.testProject }} + arguments: ${{ parameters.buildArguments }} --no-build -p:MdsPackageVersion=$(mdsVersion) -f ${{runtime}} -e STRESS_CONFIG_FILE=config.json -- $(testArguments) + + # Run the stress tests for each .NET Framework runtime. + - ${{ each runtime in parameters.netFrameworkTestRuntimes }}: + - task: DotNetCoreCLI@2 + displayName: Test [${{runtime}}] + inputs: + command: custom + custom: run + projects: ${{ parameters.testProject }} + arguments: ${{ parameters.buildArguments }} --no-build -p:MdsPackageVersion=$(mdsVersion) -f ${{runtime}} -e STRESS_CONFIG_FILE=config.json -- $(testArguments) diff --git a/eng/pipelines/sqlclient-pr-package-ref-pipeline.yml b/eng/pipelines/sqlclient-pr-package-ref-pipeline.yml index 663532b905..d5813218be 100644 --- a/eng/pipelines/sqlclient-pr-package-ref-pipeline.yml +++ b/eng/pipelines/sqlclient-pr-package-ref-pipeline.yml @@ -77,12 +77,6 @@ parameters: type: boolean default: false - # True to run the stress tests stage. - - name: enableStressTests - displayName: Enable Stress Tests - type: boolean - default: false - # The target frameworks to build and run tests for on Windows. # # These are _not_ the target frameworks to build the driver packages for. @@ -132,7 +126,6 @@ extends: buildPlatforms: ${{ parameters.buildPlatforms }} referenceType: Package debug: ${{ parameters.debug }} - enableStressTests: ${{ parameters.enableStressTests }} targetFrameworks: ${{ parameters.targetFrameworks }} targetFrameworksUnix: ${{ parameters.targetFrameworksUnix }} testJobTimeout: ${{ parameters.testJobTimeout }} diff --git a/eng/pipelines/sqlclient-pr-project-ref-pipeline.yml b/eng/pipelines/sqlclient-pr-project-ref-pipeline.yml index 868b3010ff..cb327ee994 100644 --- a/eng/pipelines/sqlclient-pr-project-ref-pipeline.yml +++ b/eng/pipelines/sqlclient-pr-project-ref-pipeline.yml @@ -77,12 +77,6 @@ parameters: type: boolean default: false - # True to run the stress tests stage. - - name: enableStressTests - displayName: Enable Stress Tests - type: boolean - default: false - # The target frameworks to build and run tests for on Windows. # # These are _not_ the target frameworks to build the driver packages for. @@ -132,7 +126,6 @@ extends: buildPlatforms: ${{ parameters.buildPlatforms }} referenceType: Project debug: ${{ parameters.debug }} - enableStressTests: ${{ parameters.enableStressTests }} targetFrameworks: ${{ parameters.targetFrameworks }} targetFrameworksUnix: ${{ parameters.targetFrameworksUnix }} testJobTimeout: ${{ parameters.testJobTimeout }} diff --git a/eng/pipelines/stages/stress-tests-ci-stage.yml b/eng/pipelines/stages/stress-tests-ci-stage.yml index 978105d580..f42aba21c9 100644 --- a/eng/pipelines/stages/stress-tests-ci-stage.yml +++ b/eng/pipelines/stages/stress-tests-ci-stage.yml @@ -36,11 +36,15 @@ parameters: # The type of build to produce (Debug or Release) - name: buildConfiguration type: string - default: Debug values: - Debug - Release + # True to enable debugging steps. + - name: debug + type: boolean + default: false + # The verbosity level for the dotnet CLI commands. - name: dotnetVerbosity type: string @@ -52,14 +56,34 @@ parameters: - detailed - diagnostic - # The name of the MDS pipeline artifacts to download. - - name: mdsArtifactsName + # The alias of the pipeline whose artifacts we should download. This is the + # name given to a pipeline resource in the resources definition section of the + # top-level pipeline, for example: + # + # resources: + # pipelines: + # - pipeline: + # + # See: + # + # https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/resources-pipelines-pipeline?view=azure-pipelines#the-pipeline-resource-metadata-as-predefined-variables + # + - name: pipelineAlias type: string - default: MDS.Artifacts - # The MDS package version found in the pipeline artifacts we will download. + # The name of the pipeline artifact to download that contains the MDS package + # to stress test. + - name: pipelineArtifactName + type: string + + # The MDS package version to stress test. This version must be available in + # one of the configured NuGet sources. + # + # If empty, the MDS version will be parsed from the NuGet package filename + # downloaded from the pipeline artifact. - name: mdsPackageVersion type: string + default: '' # The list of .NET Framework runtimes to test against. - name: netFrameworkTestRuntimes @@ -71,6 +95,11 @@ parameters: type: object default: [net8.0, net9.0, net10.0] + # The verbosity level for the dotnet CLI commands. + - name: verbosity + type: string + default: MDS.Artifacts + stages: - stage: run_stress_tests_stage displayName: Run Stress Tests @@ -81,7 +110,7 @@ stages: variables: # The directory where dotnet artifacts will be staged. Not to be - # confused with pipeline artifact. + # confused with pipeline artifacts. - name: dotnetArtifactsDir value: $(Build.StagingDirectory)/dotnetArtifacts @@ -114,7 +143,7 @@ stages: # The contents of the config file to use for all tests. We will write # this to a JSON file for each test job, and then point to it via the # STRESS_CONFIG_FILE environment variable. - - name: ConfigContent + - name: configContent value: | [ { @@ -139,21 +168,24 @@ stages: - template: /eng/pipelines/jobs/stress-tests-ci-job.yml@self parameters: - jobNameSuffix: linux + buildArguments: $(buildArguments) + configContent: $(configContent) + debug: ${{ parameters.debug }} displayNamePrefix: Linux - poolName: $(ci_var_defaultPoolName) - vmImage: ADO-UB22-SQL22 + poolName: ADO-CI-1ES-Pool + vmImage: ADO-UB20-SQL22 sqlSetupStep: template: /eng/pipelines/common/templates/steps/configure-sql-server-linux-step.yml@self parameters: saPassword: $(saPassword) - mdsArtifactsName: ${{ parameters.mdsArtifactsName }} + jobNameSuffix: linux + mdsPackageVersion: ${{ parameters.mdsPackageVersion }} + netTestRuntimes: ${{ parameters.netTestRuntimes }} + pipelineAlias: ${{ parameters.pipelineAlias }} + pipelineArtifactName: ${{ parameters.pipelineArtifactName }} + restoreArguments: $(commonArguments) solution: $(solution) testProject: $(testProject) - restoreArguments: $(commonArguments) - buildArguments: $(buildArguments) - netTestRuntimes: ${{ parameters.netTestRuntimes }} - configContent: $(ConfigContent) # -------------------------------------------------------------------------- # Build and test on Windows @@ -162,7 +194,7 @@ stages: parameters: jobNameSuffix: windows displayNamePrefix: Win - poolName: $(ci_var_defaultPoolName) + poolName: ADO-CI-1ES-Pool # The Windows images include a suitable .NET Framework runtime, so we # don't have to install one explicitly. vmImage: ADO-MMS22-SQL22 @@ -170,24 +202,47 @@ stages: template: /eng/pipelines/common/templates/steps/configure-sql-server-win-step.yml@self parameters: saPassword: $(saPassword) - mdsArtifactsName: ${{ parameters.mdsArtifactsName }} + pipelineAlias: ${{ parameters.pipelineAlias }} + pipelineArtifactName: ${{ parameters.pipelineArtifactName }} + mdsPackageVersion: ${{ parameters.mdsPackageVersion }} solution: $(solution) testProject: $(testProject) restoreArguments: $(commonArguments) buildArguments: $(buildArguments) - netTestRuntimes: ${{ parameters.netTestRuntimes }} + configContent: $(configContent) + debug: ${{ parameters.debug }} + displayNamePrefix: Win + jobNameSuffix: windows + mdsPackageVersion: ${{ parameters.mdsPackageVersion }} # Note that we include the .NET Framework runtimes for test runs on # Windows. netFrameworkTestRuntimes: ${{ parameters.netFrameworkTestRuntimes }} - configContent: $(ConfigContent) + netTestRuntimes: ${{ parameters.netTestRuntimes }} + pipelineAlias: ${{ parameters.pipelineAlias }} + pipelineArtifactName: ${{ parameters.pipelineArtifactName }} + poolName: ADO-CI-1ES-Pool + restoreArguments: $(commonArguments) + solution: $(solution) + sqlSetupStep: /eng/pipelines/common/templates/steps/configure-sql-server-win-step.yml + testProject: $(testProject) + # The Windows images include a suitable .NET Framework runtime, so we + # don't have to install one explicitly. + vmImage: ADO-MMS22-SQL22 # -------------------------------------------------------------------------- # Build and test on macOS. - template: /eng/pipelines/jobs/stress-tests-ci-job.yml@self parameters: - jobNameSuffix: macos + buildArguments: $(buildArguments) + configContent: $(configContent) + debug: ${{ parameters.debug }} displayNamePrefix: macOS + jobNameSuffix: macos + mdsPackageVersion: ${{ parameters.mdsPackageVersion }} + netTestRuntimes: ${{ parameters.netTestRuntimes }} + pipelineAlias: ${{ parameters.pipelineAlias }} + pipelineArtifactName: ${{ parameters.pipelineArtifactName }} # We don't have any 1ES Hosted Pool images for macOS, so we use a # generic one from Azure Pipelines. poolName: Azure Pipelines @@ -196,10 +251,13 @@ stages: template: /eng/pipelines/common/templates/steps/configure-sql-server-macos-step.yml@self parameters: saPassword: $(saPassword) - mdsArtifactsName: ${{ parameters.mdsArtifactsName }} + pipelineAlias: ${{ parameters.pipelineAlias }} + pipelineArtifactName: ${{ parameters.pipelineArtifactName }} + mdsPackageVersion: ${{ parameters.mdsPackageVersion }} solution: $(solution) testProject: $(testProject) restoreArguments: $(commonArguments) - buildArguments: $(buildArguments) - netTestRuntimes: ${{ parameters.netTestRuntimes }} - configContent: $(ConfigContent) + solution: $(solution) + sqlSetupStep: /eng/pipelines/common/templates/steps/configure-sql-server-macos-step.yml + testProject: $(testProject) + vmImage: macos-latest diff --git a/eng/pipelines/stress-tests-pipeline.yml b/eng/pipelines/stress-tests-pipeline.yml index e08f255e5a..655baaca24 100644 --- a/eng/pipelines/stress-tests-pipeline.yml +++ b/eng/pipelines/stress-tests-pipeline.yml @@ -1,30 +1,19 @@ -################################################################################# -# Licensed to the .NET Foundation under one or more agreements. # -# The .NET Foundation licenses this file to you under the MIT license. # -# See the LICENSE file in the project root for more information. # -################################################################################# +#################################################################################################### +# Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this +# file to you under the MIT license. See the LICENSE file in the project root for more information. +#################################################################################################### -# This pipeline runs the stress test suite using the most recent artifacts from -# the CI-SqlClient-Package pipeline. -# -# It runs after every successful run of the following pipelines: -# -# Public project: -# - PR-SqlClient-Package -# - CI-SqlClient-Package -# -# ADO.net project: -# - MDS Main CI-Package -# -# This pipeline definition is mapped to the Stress-SqlClient pipelines: +# This pipeline runs the stress test suite using artifacts from the triggering pipeline. # # Public project: +# Triggering pipelines: PR-SqlClient-Project, CI-SqlClient (branch main only) +# Pipeline name: Stress-SqlClient +# Pipeline URL: https://dev.azure.com/SqlClientDrivers/public/_build?definitionId=2212 # -# TODO -# -# ADO.net project: -# -# TODO +# ADO.Net project: +# Triggering pipeline: MDS Main CI (branch internal/main only) +# Pipeline name: Stress-SqlClient +# Pipeline URL: TODO # Set the pipeline run name to the day-of-year and the daily run counter. name: $(DayOfYear)$(Rev:rr) @@ -33,24 +22,36 @@ name: $(DayOfYear)$(Rev:rr) pr: none trigger: none -# Trigger this pipeline after successful runs of each of the following pipelines. +# Trigger this pipeline after successful runs of the desired pipelines. +# +# The pipeline identifiers are displayed in the Azure DevOps UI, so it is helpful if they indicate +# the project, folder, and pipeline name, hence the verbose values below. +# resources: pipelines: - # The PR-SqlClient-Package pipeline in the Public project. - - pipeline: upstreamPipeline1 + + # The PR-SqlClient-Project pipeline in the Public project. + - pipeline: Public-ADO-PR-SqlClient-Project project: Public - source: /ADO/PR-SqlClient-Package - trigger: true - # The CI-SqlClient-Package pipeline in the Public project. - - pipeline: upstreamPipeline2 + source: /ADO/PR-SqlClient-Project + + # The CI-SqlClient pipeline in the Public project. + - pipeline: Public-ADO-CI-SqlClient project: Public - source: /ADO/CI-SqlClient-Package - trigger: true - # The MDS Main CI-Package pipeline in the ADO.net project. - - pipeline: upstreamPipeline3 - project: ADO.net - source: /Internal CI/MDS Main CI-Package - trigger: true + source: /ADO/CI-SqlClient + trigger: + branches: + include: + - main + + # The MDS Main CI pipeline in the ADO.Net project. + - pipeline: ADO-Net-Internal-CI-MDS-Main-CI + project: ADO.Net + source: /Internal CI/MDS Main CI + trigger: + branches: + include: + - internal/main # Pipeline parameters, visible in the Azure DevOps UI. parameters: @@ -70,12 +71,22 @@ parameters: type: boolean default: false + # Dotnet CLI verbosity level. + - name: dotnetVerbosity + displayName: dotnet CLI Verbosity + type: string + default: normal + values: + - quiet + - minimal + - normal + - detailed + - diagnostic + +# The stages to run. stages: -- stage: Placeholder - displayName: Placeholder Stage - jobs: - - job: PlaceholderJob - displayName: Placeholder Job - steps: - - script: echo "This is a placeholder stage." - displayName: Placeholder Step + - template: /eng/pipelines/stages/stress-tests-ci-stage.yml@self + parameters: + buildConfiguration: ${{ parameters.buildConfiguration }} + debug: ${{ parameters.debug }} + dotnetVerbosity: ${{ parameters.dotnetVerbosity }} From e5cec494f1d21b211a93c13526cca765f0d312bb Mon Sep 17 00:00:00 2001 From: Paul Medynski <31868385+paulmedynski@users.noreply.github.com> Date: Thu, 19 Mar 2026 12:27:18 -0300 Subject: [PATCH 2/6] Changed the pipeline to expect project-references to SqlClient projects. --- .../jobs/pack-abstractions-package-ci-job.yml | 4 +- .../jobs/pack-azure-package-ci-job.yml | 4 +- eng/pipelines/jobs/stress-tests-ci-job.yml | 269 +++++------------- .../jobs/test-abstractions-package-ci-job.yml | 6 +- .../jobs/test-azure-package-ci-job.yml | 6 +- .../stages/stress-tests-ci-stage.yml | 200 +++---------- eng/pipelines/stress-tests-pipeline.yml | 7 + .../tests/StressTests/Readme.md | 63 ++-- .../tests/StressTests/StressTests.slnx | 7 - 9 files changed, 140 insertions(+), 426 deletions(-) delete mode 100644 src/Microsoft.Data.SqlClient/tests/StressTests/StressTests.slnx diff --git a/eng/pipelines/jobs/pack-abstractions-package-ci-job.yml b/eng/pipelines/jobs/pack-abstractions-package-ci-job.yml index 9db1c05696..aed7672618 100644 --- a/eng/pipelines/jobs/pack-abstractions-package-ci-job.yml +++ b/eng/pipelines/jobs/pack-abstractions-package-ci-job.yml @@ -78,9 +78,7 @@ jobs: # Explicitly unset the $PLATFORM environment variable that is set by the # 'ADO Build properties' Library in the ADO SqlClientDrivers public project. # This is defined with a non-standard Platform of 'AnyCPU', and will fail - # the builds if left defined. The stress tests solution does not require - # any specific Platform, and so its solution file doesn't support any - # non-standard platforms. + # the builds if left defined. # # Note that Azure Pipelines will inject this variable as PLATFORM into the # environment of all tasks in this job. diff --git a/eng/pipelines/jobs/pack-azure-package-ci-job.yml b/eng/pipelines/jobs/pack-azure-package-ci-job.yml index 95853d43e0..3b03dc0adc 100644 --- a/eng/pipelines/jobs/pack-azure-package-ci-job.yml +++ b/eng/pipelines/jobs/pack-azure-package-ci-job.yml @@ -107,9 +107,7 @@ jobs: # Explicitly unset the $PLATFORM environment variable that is set by the # 'ADO Build properties' Library in the ADO SqlClientDrivers public # project. This is defined with a non-standard Platform of 'AnyCPU', and - # will fail the builds if left defined. The stress tests solution does - # not require any specific Platform, and so its solution file doesn't - # support any non-standard platforms. + # will fail the builds if left defined. # # Note that Azure Pipelines will inject this variable as PLATFORM into the # environment of all tasks in this job. diff --git a/eng/pipelines/jobs/stress-tests-ci-job.yml b/eng/pipelines/jobs/stress-tests-ci-job.yml index 119973dab8..7c81559917 100644 --- a/eng/pipelines/jobs/stress-tests-ci-job.yml +++ b/eng/pipelines/jobs/stress-tests-ci-job.yml @@ -1,32 +1,20 @@ -################################################################################ -# Licensed to the .NET Foundation under one or more agreements. The .NET -# Foundation licenses this file to you under the MIT license. See the LICENSE -# file in the project root for more information. -################################################################################ +#################################################################################################### +# Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this +# file to you under the MIT license. See the LICENSE file in the project root for more information. +#################################################################################################### -# This job builds and runs stress tests against an MDS NuGet package available -# as a pipeline artifact. +# This job builds and runs stress tests against an MDS NuGet package available as a pipeline +# artifact. # # The stress tests are located here: # # src/Microsoft.Data.SqlClient/tests/StressTests # -# This template defines a job named 'run_stress_tests_job_' that can be -# depended on by downstream jobs. +# This template defines a job named 'stress_tests_job_' that can be depended on by +# downstream jobs. parameters: - # dotnet CLI arguments for the build and run steps. - - name: buildArguments - type: string - - # The stress test config file contents to write to the config file. - # - # This should point to the SQL Server configured via the sqlSetupStep - # parameter, with user 'sa' and password of $(Password). - - name: configContent - type: string - # True to enable debugging steps. - name: debug type: boolean @@ -39,18 +27,20 @@ parameters: - name: displayNamePrefix type: string - # The suffix to append to the job name. - - name: jobNameSuffix + # The verbosity level for the dotnet CLI commands. + - name: dotnetVerbosity type: string + default: normal + values: + - quiet + - minimal + - normal + - detailed + - diagnostic - # The MDS package version to stress test. This version must be available in - # one of the configured NuGet sources. - # - # If empty, the MDS version will be parsed from the NuGet package filename - # downloaded from the pipeline artifact. - - name: mdsPackageVersion + # The suffix to append to the job name. + - name: jobNameSuffix type: string - default: '' # The list of .NET Framework runtimes to test against. - name: netFrameworkTestRuntimes @@ -62,68 +52,25 @@ parameters: type: object default: [] - # The alias of the pipeline whose artifacts we should download. This is the - # name given to a pipeline resource in the resources definition section of the - # top-level pipeline, for example: - # - # resources: - # pipelines: - # - pipeline: - # - # See: - # - # https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/resources-pipelines-pipeline?view=azure-pipelines#the-pipeline-resource-metadata-as-predefined-variables - # - - name: pipelineAlias - type: string - - # The name of the pipeline artifact to download that contains the MDS package - # to stress test. - - name: pipelineArtifactName - type: string - # The name of the Azure Pipelines pool to use. - name: poolName type: string - # dotnet CLI arguments for the restore step. - - name: restoreArguments - type: string - - # The solution file to restore/build. - - name: solution + # The local SQL Server instance's 'sa' password, for use in the config file. + - name: saPassword type: string - # The filename (absolute path) of a template step to run to configure SQL - # Server. - # - # This step is expected to require no parameters. It must configure a SQL - # Server instance listening on localhost for SQL auth via the 'sa' user with - # the pipeline variable $(Password) as the password. + # The step to run to configure SQL Server. This should configure a local SQL Server instance with + # an 'sa' login using the same password provided by the saPassword parameter. - name: sqlSetupStep - type: string - - # The test project to run. - - name: testProject - type: string - - # The verbosity level for the dotnet CLI commands. - - name: verbosity - type: string - default: normal - values: - - quiet - - minimal - - normal - - detailed - - diagnostic + type: step # The pool VM image to use. - name: vmImage type: string jobs: - - job: run_stress_tests_job_${{ parameters.jobNameSuffix }} + - job: stress_tests_job_${{ parameters.jobNameSuffix }} displayName: '[${{ parameters.displayNamePrefix }}] Run Stress Tests' pool: name: ${{ parameters.poolName }} @@ -135,27 +82,47 @@ jobs: variables: + # The directory where dotnet artifacts will be staged. Not to be + # confused with pipeline artifacts. + - name: dotnetArtifactsDir + value: $(Build.StagingDirectory)/dotnetArtifacts + + # The top-level project file to build and run. + - name: project + value: $(Build.SourcesDirectory)/src/Microsoft.Data.SqlClient/tests/StressTests/SqlClient.Stress.Runner/SqlClient.Stress.Runner.csproj + + # dotnet CLI arguments. + - name: dotnetArguments + value: >- + --verbosity ${{ parameters.dotnetVerbosity }} + --artifacts-path $(dotnetArtifactsDir) + --configuration ${{ parameters.buildConfiguration }} + + # The contents of the config file to use for all tests. We will write + # this to a JSON file for each test job, and then point to it via the + # STRESS_CONFIG_FILE environment variable. + - name: configContent + value: | + [ + { + "name": "Azure SQL", + "type": "SqlServer", + "isDefault": true, + "dataSource": "localhost", + "user": "sa", + "password": "${{ parameters.saPassword }}", + "supportsWindowsAuthentication": false, + "isLocal": false, + "disableMultiSubnetFailover": true, + "disableNamedPipes": true, + "encrypt": false + } + ] + # Stress test command-line arguments. - name: testArguments value: -a SqlClient.Stress.Tests -console - # The MDS package version to use. - # - # We assign the parameter to a variable so we can update it later via a - # PowerShell script that parses the version from the package filename. - - name: mdsVersion - value: ${{ parameters.mdsPackageVersion }} - - # Variables for the specific pipeline run to download artifacts from. We - # must expand these values here; they don't expand properly if used - # directly in the download task step below. - - name: artifactProjectId - value: $[variables['resources.pipeline.${{ parameters.pipelineAlias }}.projectID']] - - name: artifactPipelineId - value: $[variables['resources.pipeline.${{ parameters.pipelineAlias }}.pipelineID']] - - name: artifactRunId - value: $[variables['resources.pipeline.${{ parameters.pipelineAlias }}.runID']] - steps: # Install the .NET SDK and Runtimes. @@ -163,100 +130,8 @@ jobs: parameters: runtimes: [8.x, 9.x] - # Emit the artifact details. - - ${{ if eq(parameters.debug, true) }}: - - pwsh: | - Write-Host "Downloading artifact from pipeline alias: ${{ parameters.pipelineAlias }}" - Write-Host " Project ID: $(artifactProjectId)" - Write-Host " Pipeline ID: $(artifactPipelineId)" - Write-Host " Run ID: $(artifactRunId)" - displayName: '[Debug] Emit Artifact Details' - - # Download the pipeline artifact that contains the MDS package to test. - - task: DownloadPipelineArtifact@2 - displayName: Download Pipeline Artifact - inputs: - buildType: specific - artifactName: ${{ parameters.pipelineArtifactName }} - # The stress tests solution has a NuGet.config file that configures - # sources to look in this packages/ directory. - targetPath: $(Build.SourcesDirectory)/packages - # If we were triggered by an upstream pipeline run, download the - # artifacts from that specific run. - preferTriggeringPipeline: true - # Otherwise, use the pipeline alias to explicitly choose the - # artifacts. - project: $(artifactProjectId) - pipeline: $(artifactPipelineId) - runVersion: specific - runId: $(artifactRunId) - - # Determine the MDS package version if not specified. - # - # This will clobber the $(mdsVersion) variable. - # - - ${{ if eq(parameters.mdsPackageVersion, '') }}: - - task: PowerShell@2 - displayName: Determine MDS Package Version - inputs: - pwsh: true - targetType: inline - script: | - # Get the list of MDS package files in the packages directory. - $packageFiles = Get-ChildItem -Path "$(Build.SourcesDirectory)/packages" -Filter "Microsoft.Data.SqlClient.*.nupkg" - - if ($packageFiles.Count -eq 0) - { - throw "No Microsoft.Data.SqlClient NuGet package found in packages directory." - } - elseif ($packageFiles.Count -gt 1) - { - throw "Multiple Microsoft.Data.SqlClient NuGet packages found in packages directory." - } - else - { - # Extract the version from the package filename. - $packageFile = $packageFiles[0] - if ($packageFile.Name -match 'Microsoft\.Data\.SqlClient\.(?.+)\.nupkg') - { - $version = $matches['version'] - Write-Host "##vso[task.setvariable variable=mdsVersion]$version" - Write-Host "Determined MDS package version: $version" - } - else - { - throw "Failed to parse version from package filename: $($packageFile.Name)" - } - } - - # Emit the MDS version under test. - - pwsh: | - Write-Host "Testing MDS package version: $(mdsVersion)" - displayName: Emit MDS Version - # Setup the local SQL Server. - - template: ${{ parameters.sqlSetupStep }}@self - - # We use the 'custom' command because the DotNetCoreCLI@2 task doesn't - # support all of our argument combinations for the different build steps. - - # Restore the solution. - - task: DotNetCoreCLI@2 - displayName: Restore Solution - inputs: - command: custom - custom: restore - projects: ${{ parameters.solution }} - arguments: ${{ parameters.restoreArguments }} -p:MdsPackageVersion=$(mdsVersion) - - # Build the solution. - - task: DotNetCoreCLI@2 - displayName: Build Solution - inputs: - command: custom - custom: build - projects: ${{ parameters.solution }} - arguments: ${{ parameters.buildArguments }} --no-restore -p:MdsPackageVersion=$(mdsVersion) + - ${{ parameters.sqlSetupStep }} # Write the config file. - task: PowerShell@2 @@ -267,12 +142,20 @@ jobs: script: | # Capture the multi-line JSON content into a variable. $content = @" - ${{ parameters.configContent }} + $(configContent) "@ # Write the JSON content to the config file. $content | Out-File -FilePath "config.json" + # Build the project. + - task: DotNetCoreCLI@2 + displayName: Build Project + inputs: + command: build + projects: $(project) + arguments: $(dotnetArguments) + # Run the stress tests for each .NET runtime. - ${{ each runtime in parameters.netTestRuntimes }}: - task: DotNetCoreCLI@2 @@ -280,8 +163,8 @@ jobs: inputs: command: custom custom: run - projects: ${{ parameters.testProject }} - arguments: ${{ parameters.buildArguments }} --no-build -p:MdsPackageVersion=$(mdsVersion) -f ${{runtime}} -e STRESS_CONFIG_FILE=config.json -- $(testArguments) + projects: $(project) + arguments: $(dotnetArguments) --no-build -f $(runtime) -e STRESS_CONFIG_FILE=config.json -- $(testArguments) # Run the stress tests for each .NET Framework runtime. - ${{ each runtime in parameters.netFrameworkTestRuntimes }}: @@ -290,5 +173,5 @@ jobs: inputs: command: custom custom: run - projects: ${{ parameters.testProject }} - arguments: ${{ parameters.buildArguments }} --no-build -p:MdsPackageVersion=$(mdsVersion) -f ${{runtime}} -e STRESS_CONFIG_FILE=config.json -- $(testArguments) + projects: $(project) + arguments: $(dotnetArguments) --no-build -p:MdsPackageVersion=$(mdsVersion) -f $(runtime) -e STRESS_CONFIG_FILE=config.json -- $(testArguments) diff --git a/eng/pipelines/jobs/test-abstractions-package-ci-job.yml b/eng/pipelines/jobs/test-abstractions-package-ci-job.yml index 9d205b5108..a88d4dc347 100644 --- a/eng/pipelines/jobs/test-abstractions-package-ci-job.yml +++ b/eng/pipelines/jobs/test-abstractions-package-ci-job.yml @@ -27,7 +27,7 @@ parameters: # The prefix to prepend to the job's display name: # - # [] Run Stress Tests + # [] Test Abstractions Package # - name: displayNamePrefix type: string @@ -97,9 +97,7 @@ jobs: # Explicitly unset the $PLATFORM environment variable that is set by the # 'ADO Build properties' Library in the ADO SqlClientDrivers public project. # This is defined with a non-standard Platform of 'AnyCPU', and will fail - # the builds if left defined. The stress tests solution does not require - # any specific Platform, and so its solution file doesn't support any - # non-standard platforms. + # the builds if left defined. # # Note that Azure Pipelines will inject this variable as PLATFORM into the # environment of all tasks in this job. diff --git a/eng/pipelines/jobs/test-azure-package-ci-job.yml b/eng/pipelines/jobs/test-azure-package-ci-job.yml index 53ca26366f..5e5dffe381 100644 --- a/eng/pipelines/jobs/test-azure-package-ci-job.yml +++ b/eng/pipelines/jobs/test-azure-package-ci-job.yml @@ -46,7 +46,7 @@ parameters: # The prefix to prepend to the job's display name: # - # [] Run Stress Tests + # [] Test Azure Package # - name: displayNamePrefix type: string @@ -158,9 +158,7 @@ jobs: # Explicitly unset the $PLATFORM environment variable that is set by the # 'ADO Build properties' Library in the ADO SqlClientDrivers public # project. This is defined with a non-standard Platform of 'AnyCPU', and - # will fail the builds if left defined. The stress tests solution does - # not require any specific Platform, and so its solution file doesn't - # support any non-standard platforms. + # will fail the builds if left defined. # # Note that Azure Pipelines will inject this variable as PLATFORM into the # environment of all tasks in this job. diff --git a/eng/pipelines/stages/stress-tests-ci-stage.yml b/eng/pipelines/stages/stress-tests-ci-stage.yml index f42aba21c9..bb9a41bb05 100644 --- a/eng/pipelines/stages/stress-tests-ci-stage.yml +++ b/eng/pipelines/stages/stress-tests-ci-stage.yml @@ -1,38 +1,25 @@ -################################################################################ -# Licensed to the .NET Foundation under one or more agreements. The .NET -# Foundation licenses this file to you under the MIT license. See the LICENSE -# file in the project root for more information. -################################################################################ +#################################################################################################### +# Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this +# file to you under the MIT license. See the LICENSE file in the project root for more information. +#################################################################################################### -# This stage builds and runs stress tests against an MDS NuGet package available -# as a pipeline artifact. +# This stage builds and runs stress tests against SqlClient NuGet package available as a pipeline +# artifact. # # The stress tests are located here: # # src/Microsoft.Data.SqlClient/tests/StressTests # -# All tests use a localhost SQL Server configured for SQL auth via the 'sa' user -# and the provided password. +# All tests use a localhost SQL Server configured for SQL auth via the 'sa' user and the generated +# password. # # This stage depends on the secrets_stage. # -# This template defines a stage named 'run_stress_tests_stage' that can be -# depended on by downstream stages. +# This template defines a stage named 'stress_tests_stage' that can be depended on by downstream +# stages. parameters: - # The names of any additional stages this stage depends on, for example the stages that publish - # the MDS package artifacts we will test. - - name: additionalDependsOn - type: object - default: [] - - # The Azure package version to stress test. This version must be available in - # one of the configured NuGet sources. - - name: azurePackageVersion - displayName: Azure Package Version - type: string - # The type of build to produce (Debug or Release) - name: buildConfiguration type: string @@ -56,35 +43,6 @@ parameters: - detailed - diagnostic - # The alias of the pipeline whose artifacts we should download. This is the - # name given to a pipeline resource in the resources definition section of the - # top-level pipeline, for example: - # - # resources: - # pipelines: - # - pipeline: - # - # See: - # - # https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/resources-pipelines-pipeline?view=azure-pipelines#the-pipeline-resource-metadata-as-predefined-variables - # - - name: pipelineAlias - type: string - - # The name of the pipeline artifact to download that contains the MDS package - # to stress test. - - name: pipelineArtifactName - type: string - - # The MDS package version to stress test. This version must be available in - # one of the configured NuGet sources. - # - # If empty, the MDS version will be parsed from the NuGet package filename - # downloaded from the pipeline artifact. - - name: mdsPackageVersion - type: string - default: '' - # The list of .NET Framework runtimes to test against. - name: netFrameworkTestRuntimes type: object @@ -95,169 +53,75 @@ parameters: type: object default: [net8.0, net9.0, net10.0] - # The verbosity level for the dotnet CLI commands. - - name: verbosity - type: string - default: MDS.Artifacts - stages: - - stage: run_stress_tests_stage + - stage: stress_tests_stage displayName: Run Stress Tests dependsOn: - secrets_stage - - ${{ each dep in parameters.additionalDependsOn }}: - - ${{ dep }} variables: - # The directory where dotnet artifacts will be staged. Not to be - # confused with pipeline artifacts. - - name: dotnetArtifactsDir - value: $(Build.StagingDirectory)/dotnetArtifacts - - # The solution file to use for all dotnet CLI commands. - - name: solution - value: src/Microsoft.Data.SqlClient/tests/StressTests/StressTests.slnx - - # The stress test project to run. - - name: testProject - value: src/Microsoft.Data.SqlClient/tests/StressTests/SqlClient.Stress.Runner/SqlClient.Stress.Runner.csproj - - # dotnet CLI arguments common to all commands. - - name: commonArguments - value: >- - --verbosity ${{parameters.dotnetVerbosity}} - --artifacts-path $(dotnetArtifactsDir) - -p:MdsPackageVersion=${{parameters.mdsPackageVersion}} - -p:AzurePackageVersion=${{parameters.azurePackageVersion}} - - # dotnet CLI arguments for build/run commands. - - name: buildArguments - value: >- - $(commonArguments) - --configuration ${{parameters.buildConfiguration}} - # Bring the SA password from the secrets_stage into scope here. - name: saPassword value: $[stageDependencies.secrets_stage.secrets_job.outputs['SaPassword.Value']] - # The contents of the config file to use for all tests. We will write - # this to a JSON file for each test job, and then point to it via the - # STRESS_CONFIG_FILE environment variable. - - name: configContent - value: | - [ - { - "name": "Azure SQL", - "type": "SqlServer", - "isDefault": true, - "dataSource": "localhost", - "user": "sa", - "password": "$(saPassword)", - "supportsWindowsAuthentication": false, - "isLocal": false, - "disableMultiSubnetFailover": true, - "disableNamedPipes": true, - "encrypt": false - } - ] - jobs: - # -------------------------------------------------------------------------- + # ---------------------------------------------------------------------------------------------- # Build and test on Linux. - template: /eng/pipelines/jobs/stress-tests-ci-job.yml@self parameters: - buildArguments: $(buildArguments) - configContent: $(configContent) debug: ${{ parameters.debug }} displayNamePrefix: Linux + dotnetVerbosity: ${{ parameters.dotnetVerbosity }} + jobNameSuffix: linux + netTestRuntimes: ${{ parameters.netTestRuntimes }} poolName: ADO-CI-1ES-Pool - vmImage: ADO-UB20-SQL22 + saPassword: $(saPassword) sqlSetupStep: template: /eng/pipelines/common/templates/steps/configure-sql-server-linux-step.yml@self parameters: saPassword: $(saPassword) - jobNameSuffix: linux - mdsPackageVersion: ${{ parameters.mdsPackageVersion }} - netTestRuntimes: ${{ parameters.netTestRuntimes }} - pipelineAlias: ${{ parameters.pipelineAlias }} - pipelineArtifactName: ${{ parameters.pipelineArtifactName }} - restoreArguments: $(commonArguments) - solution: $(solution) - testProject: $(testProject) + vmImage: ADO-UB22-SQL22 - # -------------------------------------------------------------------------- + # ---------------------------------------------------------------------------------------------- # Build and test on Windows - template: /eng/pipelines/jobs/stress-tests-ci-job.yml@self parameters: - jobNameSuffix: windows - displayNamePrefix: Win - poolName: ADO-CI-1ES-Pool - # The Windows images include a suitable .NET Framework runtime, so we - # don't have to install one explicitly. - vmImage: ADO-MMS22-SQL22 - sqlSetupStep: - template: /eng/pipelines/common/templates/steps/configure-sql-server-win-step.yml@self - parameters: - saPassword: $(saPassword) - pipelineAlias: ${{ parameters.pipelineAlias }} - pipelineArtifactName: ${{ parameters.pipelineArtifactName }} - mdsPackageVersion: ${{ parameters.mdsPackageVersion }} - solution: $(solution) - testProject: $(testProject) - restoreArguments: $(commonArguments) - buildArguments: $(buildArguments) - configContent: $(configContent) debug: ${{ parameters.debug }} displayNamePrefix: Win + dotnetVerbosity: ${{ parameters.dotnetVerbosity }} jobNameSuffix: windows - mdsPackageVersion: ${{ parameters.mdsPackageVersion }} - # Note that we include the .NET Framework runtimes for test runs on - # Windows. + # Note that we include the .NET Framework runtimes for test runs on Windows. netFrameworkTestRuntimes: ${{ parameters.netFrameworkTestRuntimes }} netTestRuntimes: ${{ parameters.netTestRuntimes }} - pipelineAlias: ${{ parameters.pipelineAlias }} - pipelineArtifactName: ${{ parameters.pipelineArtifactName }} poolName: ADO-CI-1ES-Pool - restoreArguments: $(commonArguments) - solution: $(solution) - sqlSetupStep: /eng/pipelines/common/templates/steps/configure-sql-server-win-step.yml - testProject: $(testProject) - # The Windows images include a suitable .NET Framework runtime, so we - # don't have to install one explicitly. + saPassword: $(saPassword) + sqlSetupStep: + template: /eng/pipelines/common/templates/steps/configure-sql-server-win-step.yml@self + parameters: + saPassword: $(saPassword) + # The Windows images include a suitable .NET Framework runtime, so we don't have to install + # one explicitly. vmImage: ADO-MMS22-SQL22 - # -------------------------------------------------------------------------- + # ---------------------------------------------------------------------------------------------- # Build and test on macOS. - template: /eng/pipelines/jobs/stress-tests-ci-job.yml@self parameters: - buildArguments: $(buildArguments) - configContent: $(configContent) debug: ${{ parameters.debug }} displayNamePrefix: macOS + dotnetVerbosity: ${{ parameters.dotnetVerbosity }} jobNameSuffix: macos - mdsPackageVersion: ${{ parameters.mdsPackageVersion }} netTestRuntimes: ${{ parameters.netTestRuntimes }} - pipelineAlias: ${{ parameters.pipelineAlias }} - pipelineArtifactName: ${{ parameters.pipelineArtifactName }} - # We don't have any 1ES Hosted Pool images for macOS, so we use a - # generic one from Azure Pipelines. + # We don't have any 1ES Hosted Pool images for macOS, so we use a generic one from Azure + # Pipelines. poolName: Azure Pipelines - vmImage: macos-latest + saPassword: $(saPassword) sqlSetupStep: template: /eng/pipelines/common/templates/steps/configure-sql-server-macos-step.yml@self parameters: saPassword: $(saPassword) - pipelineAlias: ${{ parameters.pipelineAlias }} - pipelineArtifactName: ${{ parameters.pipelineArtifactName }} - mdsPackageVersion: ${{ parameters.mdsPackageVersion }} - solution: $(solution) - testProject: $(testProject) - restoreArguments: $(commonArguments) - solution: $(solution) - sqlSetupStep: /eng/pipelines/common/templates/steps/configure-sql-server-macos-step.yml - testProject: $(testProject) vmImage: macos-latest diff --git a/eng/pipelines/stress-tests-pipeline.yml b/eng/pipelines/stress-tests-pipeline.yml index 655baaca24..1504e2fb95 100644 --- a/eng/pipelines/stress-tests-pipeline.yml +++ b/eng/pipelines/stress-tests-pipeline.yml @@ -85,6 +85,13 @@ parameters: # The stages to run. stages: + + # Generate secrets. We use these for the local SQL Server 'sa' logins. + - template: /eng/pipelines/stages/generate-secrets-stage.yml@self + parameters: + debug: ${{ parameters.debug }} + + # Run the stress tests. - template: /eng/pipelines/stages/stress-tests-ci-stage.yml@self parameters: buildConfiguration: ${{ parameters.buildConfiguration }} diff --git a/src/Microsoft.Data.SqlClient/tests/StressTests/Readme.md b/src/Microsoft.Data.SqlClient/tests/StressTests/Readme.md index f0723c3189..e8ec3dc051 100644 --- a/src/Microsoft.Data.SqlClient/tests/StressTests/Readme.md +++ b/src/Microsoft.Data.SqlClient/tests/StressTests/Readme.md @@ -1,6 +1,6 @@ # Microsoft.Data.SqlClient Stress Test -This Stress testing application for `Microsoft.Data.SqlClient` is under progress. +This Stress testing application for the `Microsoft.Data.SqlClient` suite is under progress. This project intends to help finding a certain level of effectiveness under unfavorable conditions, and verifying the mode of failures. @@ -8,14 +8,15 @@ unfavorable conditions, and verifying the mode of failures. This is a console application targeting all frameworks supported by MDS, currently: -- .NET 8.0 +- .NET 10.0 - .NET 9.0 -- .NET Framework 4.6.2 -- .NET Framework 4.7 -- .NET Framework 4.7.1 -- .NET Framework 4.7.2 -- .NET Framework 4.8 +- .NET 8.0 - .NET Framework 4.8.1 +- .NET Framework 4.8 +- .NET Framework 4.7.2 +- .NET Framework 4.7.1 +- .NET Framework 4.7 +- .NET Framework 4.6.2 ## Purpose of application for developers @@ -55,37 +56,11 @@ server without colliding. ## Building the application -To build the application using the `StressTests.slnx` solution: - -```bash -dotnet build [-c|--configuration ] -``` - -```bash -# Builds the application for the Client Os in `Debug` Configuration for `AnyCpu` -# platform. -# -# All supported target frameworks are built by default. - -$ dotnet build -``` - -```bash -# Build the application for .Net framework 4.8.1 with `Debug` configuration. - -$ dotnet build -f net481 -``` +Build the application using the top-level project `SqlClient.Stress.Runner`: ```bash -# Build the application for .Net 9.0 with `Release` configuration. - -$ dotnet build -f net9.0 -c Release -``` - -```bash -# Cleans all build directories - -$ dotnet clean +$ cd .../src/Microsoft.Data.SqlClient/tests/StressTests +dotnet build SqlClient.Stress.Runner [-c ] ``` ## Running tests @@ -108,30 +83,30 @@ directory (i.e. the same directory this readme file is in). ```bash # Linux -$ cd /home/paul/dev/SqlClient/src/Microsoft.Data.SqlClient/tests/StressTests +$ cd .../src/Microsoft.Data.SqlClient/tests/StressTests # Via dotnet run CLI: -$ dotnet run --no-build -f net9.0 --project SqlClient.Stress.Runner/SqlClient.Stress.Runner.csproj -- -a SqlClient.Stress.Tests +$ dotnet run --no-build -f net9.0 --project SqlClient.Stress.Runner -- -a SqlClient.Stress.Tests # Via dotnet CLI: $ dotnet SqlClient.Stress.Runner/bin/Debug/net9.0/stresstest.dll -a SqlClient.Stress.Tests # With a specific config file and all output to console: -$ dotnet run --no-build -f net9.0 --project SqlClient.Stress.Runner/SqlClient.Stress.Runner.csproj -e STRESS_CONFIG_FILE=/path/to/config.jsonc -- -a SqlClient.Stress.Tests -console +$ dotnet run --no-build -f net9.0 --project SqlClient.Stress.Runner -e STRESS_CONFIG_FILE=/path/to/config.jsonc -- -a SqlClient.Stress.Tests -console ``` ```powershell # Windows -> cd \dev\SqlClient\src\Microsoft.Data.SqlClient\tests\StressTests +> cd ...\src\Microsoft.Data.SqlClient\tests\StressTests # Via dotnet run CLI: -> dotnet run --no-build -f net9.0 --project SqlClient.Stress.Runner\SqlClient.Stress.Runner.csproj -- -a SqlClient.Stress.Tests +> dotnet run --no-build -f net9.0 --project SqlClient.Stress.Runner -- -a SqlClient.Stress.Tests # Via executable: > .\SqlClient.Stress.Runner\bin\Debug\net481\stresstest.exe -a SqlClient.Stress.Tests # With a specific config file and all output to console: -> dotnet run --no-build -f net9.0 --project SqlClient.Stress.Runner\SqlClient.Stress.Runner.csproj -e STRESS_CONFIG_FILE=c:\path\to\config.jsonc -- -a SqlClient.Stress.Tests -console +> dotnet run --no-build -f net9.0 --project SqlClient.Stress.Runner -e STRESS_CONFIG_FILE=c:\path\to\config.jsonc -- -a SqlClient.Stress.Tests -console ``` ## Supported arguments @@ -164,14 +139,14 @@ $ dotnet run --no-build -f net9.0 --project SqlClient.Stress.Runner/SqlClient.St # Run the application for a built target framework and all discovered tests # without debugger attached and shows the test methods' names. -> .\stresstest.exe -a SqlClient.Stress.Tests -all -printMethodName +> .\stresstest.exe -a SqlClient.Stress.Tests -all -printMethodName ``` ```powershell # Run the application for a built target framework and all discovered tests and # will wait for debugger to be attached. -> .\stresstest.exe -a SqlClient.Stress.Tests -all -debug +> .\stresstest.exe -a SqlClient.Stress.Tests -all -debug ``` ```powershell diff --git a/src/Microsoft.Data.SqlClient/tests/StressTests/StressTests.slnx b/src/Microsoft.Data.SqlClient/tests/StressTests/StressTests.slnx deleted file mode 100644 index a0dfd5e503..0000000000 --- a/src/Microsoft.Data.SqlClient/tests/StressTests/StressTests.slnx +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - From c2d427f336a3cb021ff582e9670a8668d4b1ce0f Mon Sep 17 00:00:00 2001 From: Paul Medynski <31868385+paulmedynski@users.noreply.github.com> Date: Thu, 19 Mar 2026 12:30:37 -0300 Subject: [PATCH 3/6] Moved stress test pipeline files into a stress/ directory. --- .../stress-tests-ci-job.yml => stress/stress-tests-job.yml} | 0 eng/pipelines/{ => stress}/stress-tests-pipeline.yml | 2 +- .../stress-tests-stage.yml} | 6 +++--- 3 files changed, 4 insertions(+), 4 deletions(-) rename eng/pipelines/{jobs/stress-tests-ci-job.yml => stress/stress-tests-job.yml} (100%) rename eng/pipelines/{ => stress}/stress-tests-pipeline.yml (97%) rename eng/pipelines/{stages/stress-tests-ci-stage.yml => stress/stress-tests-stage.yml} (95%) diff --git a/eng/pipelines/jobs/stress-tests-ci-job.yml b/eng/pipelines/stress/stress-tests-job.yml similarity index 100% rename from eng/pipelines/jobs/stress-tests-ci-job.yml rename to eng/pipelines/stress/stress-tests-job.yml diff --git a/eng/pipelines/stress-tests-pipeline.yml b/eng/pipelines/stress/stress-tests-pipeline.yml similarity index 97% rename from eng/pipelines/stress-tests-pipeline.yml rename to eng/pipelines/stress/stress-tests-pipeline.yml index 1504e2fb95..e22e11d233 100644 --- a/eng/pipelines/stress-tests-pipeline.yml +++ b/eng/pipelines/stress/stress-tests-pipeline.yml @@ -92,7 +92,7 @@ stages: debug: ${{ parameters.debug }} # Run the stress tests. - - template: /eng/pipelines/stages/stress-tests-ci-stage.yml@self + - template: /eng/pipelines/stress/stress-tests-stage.yml@self parameters: buildConfiguration: ${{ parameters.buildConfiguration }} debug: ${{ parameters.debug }} diff --git a/eng/pipelines/stages/stress-tests-ci-stage.yml b/eng/pipelines/stress/stress-tests-stage.yml similarity index 95% rename from eng/pipelines/stages/stress-tests-ci-stage.yml rename to eng/pipelines/stress/stress-tests-stage.yml index bb9a41bb05..cdf7efdfe2 100644 --- a/eng/pipelines/stages/stress-tests-ci-stage.yml +++ b/eng/pipelines/stress/stress-tests-stage.yml @@ -69,7 +69,7 @@ stages: # ---------------------------------------------------------------------------------------------- # Build and test on Linux. - - template: /eng/pipelines/jobs/stress-tests-ci-job.yml@self + - template: /eng/pipelines/stress/stress-tests-job.yml@self parameters: debug: ${{ parameters.debug }} displayNamePrefix: Linux @@ -87,7 +87,7 @@ stages: # ---------------------------------------------------------------------------------------------- # Build and test on Windows - - template: /eng/pipelines/jobs/stress-tests-ci-job.yml@self + - template: /eng/pipelines/stress/stress-tests-job.yml@self parameters: debug: ${{ parameters.debug }} displayNamePrefix: Win @@ -109,7 +109,7 @@ stages: # ---------------------------------------------------------------------------------------------- # Build and test on macOS. - - template: /eng/pipelines/jobs/stress-tests-ci-job.yml@self + - template: /eng/pipelines/stress/stress-tests-job.yml@self parameters: debug: ${{ parameters.debug }} displayNamePrefix: macOS From 9a44529ba4c591df5a96221917cd2529c0a600ab Mon Sep 17 00:00:00 2001 From: Paul Medynski <31868385+paulmedynski@users.noreply.github.com> Date: Thu, 19 Mar 2026 12:35:49 -0300 Subject: [PATCH 4/6] Fixed expansion errors. --- eng/pipelines/stress/stress-tests-job.yml | 7 +++++++ eng/pipelines/stress/stress-tests-pipeline.yml | 2 +- eng/pipelines/stress/stress-tests-stage.yml | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/stress/stress-tests-job.yml b/eng/pipelines/stress/stress-tests-job.yml index 7c81559917..1ac71604e8 100644 --- a/eng/pipelines/stress/stress-tests-job.yml +++ b/eng/pipelines/stress/stress-tests-job.yml @@ -15,6 +15,13 @@ parameters: + # The type of build to produce (Debug or Release) + - name: buildConfiguration + type: string + values: + - Debug + - Release + # True to enable debugging steps. - name: debug type: boolean diff --git a/eng/pipelines/stress/stress-tests-pipeline.yml b/eng/pipelines/stress/stress-tests-pipeline.yml index e22e11d233..13ada26c39 100644 --- a/eng/pipelines/stress/stress-tests-pipeline.yml +++ b/eng/pipelines/stress/stress-tests-pipeline.yml @@ -87,7 +87,7 @@ parameters: stages: # Generate secrets. We use these for the local SQL Server 'sa' logins. - - template: /eng/pipelines/stages/generate-secrets-stage.yml@self + - template: /eng/pipelines/stages/generate-secrets-ci-stage.yml@self parameters: debug: ${{ parameters.debug }} diff --git a/eng/pipelines/stress/stress-tests-stage.yml b/eng/pipelines/stress/stress-tests-stage.yml index cdf7efdfe2..02e6b02998 100644 --- a/eng/pipelines/stress/stress-tests-stage.yml +++ b/eng/pipelines/stress/stress-tests-stage.yml @@ -71,6 +71,7 @@ stages: - template: /eng/pipelines/stress/stress-tests-job.yml@self parameters: + buildConfiguration: ${{ parameters.buildConfiguration }} debug: ${{ parameters.debug }} displayNamePrefix: Linux dotnetVerbosity: ${{ parameters.dotnetVerbosity }} @@ -89,6 +90,7 @@ stages: - template: /eng/pipelines/stress/stress-tests-job.yml@self parameters: + buildConfiguration: ${{ parameters.buildConfiguration }} debug: ${{ parameters.debug }} displayNamePrefix: Win dotnetVerbosity: ${{ parameters.dotnetVerbosity }} @@ -111,6 +113,7 @@ stages: - template: /eng/pipelines/stress/stress-tests-job.yml@self parameters: + buildConfiguration: ${{ parameters.buildConfiguration }} debug: ${{ parameters.debug }} displayNamePrefix: macOS dotnetVerbosity: ${{ parameters.dotnetVerbosity }} From e6480bce1090d680497dee2d1f7bc6cedcd43ee4 Mon Sep 17 00:00:00 2001 From: Paul Medynski <31868385+paulmedynski@users.noreply.github.com> Date: Thu, 19 Mar 2026 12:59:55 -0300 Subject: [PATCH 5/6] Addressed Copilot feedback. --- eng/pipelines/dotnet-sqlclient-ci-core.yml | 8 ---- .../sqlclient-pr-package-ref-pipeline.yml | 1 + .../sqlclient-pr-project-ref-pipeline.yml | 1 + eng/pipelines/stress/stress-tests-job.yml | 11 +++-- .../stress/stress-tests-pipeline.yml | 1 + .../tests/StressTests/Readme.md | 43 ++++++++----------- 6 files changed, 25 insertions(+), 40 deletions(-) diff --git a/eng/pipelines/dotnet-sqlclient-ci-core.yml b/eng/pipelines/dotnet-sqlclient-ci-core.yml index 17c3d30dea..61ab6eebc1 100644 --- a/eng/pipelines/dotnet-sqlclient-ci-core.yml +++ b/eng/pipelines/dotnet-sqlclient-ci-core.yml @@ -242,14 +242,6 @@ stages: - pwsh: "Get-ChildItem env: | Sort-Object Name" displayName: "[Debug] List Environment Variables" - - template: common/templates/stages/ci-run-tests-stage.yml@self - parameters: - debug: ${{ parameters.debug }} - buildConfiguration: ${{ parameters.buildConfiguration }} - testJobTimeout: ${{ parameters.testJobTimeout }} - ${{ if eq(parameters.buildType, 'Package') }}: - dependsOn: build_nugets - # Include the code coverage job if the build type is Project. ${{ if eq(parameters.referenceType, 'Project') }}: # Jobs to run as part of the tests stage, after the tests are done. diff --git a/eng/pipelines/sqlclient-pr-package-ref-pipeline.yml b/eng/pipelines/sqlclient-pr-package-ref-pipeline.yml index d5813218be..af471001ea 100644 --- a/eng/pipelines/sqlclient-pr-package-ref-pipeline.yml +++ b/eng/pipelines/sqlclient-pr-package-ref-pipeline.yml @@ -50,6 +50,7 @@ pr: - NuGet.config exclude: - eng/pipelines/onebranch/* + - eng/pipelines/stress/* # Do not trigger commit or schedule runs for this pipeline. trigger: none diff --git a/eng/pipelines/sqlclient-pr-project-ref-pipeline.yml b/eng/pipelines/sqlclient-pr-project-ref-pipeline.yml index cb327ee994..98411b148a 100644 --- a/eng/pipelines/sqlclient-pr-project-ref-pipeline.yml +++ b/eng/pipelines/sqlclient-pr-project-ref-pipeline.yml @@ -50,6 +50,7 @@ pr: - NuGet.config exclude: - eng/pipelines/onebranch/* + - eng/pipelines/stress/* # Do not trigger commit or schedule runs for this pipeline. trigger: none diff --git a/eng/pipelines/stress/stress-tests-job.yml b/eng/pipelines/stress/stress-tests-job.yml index 1ac71604e8..19162f02f2 100644 --- a/eng/pipelines/stress/stress-tests-job.yml +++ b/eng/pipelines/stress/stress-tests-job.yml @@ -3,8 +3,7 @@ # file to you under the MIT license. See the LICENSE file in the project root for more information. #################################################################################################### -# This job builds and runs stress tests against an MDS NuGet package available as a pipeline -# artifact. +# This job builds and runs stress tests by compiling the SqlClient projects transitively. # # The stress tests are located here: # @@ -166,19 +165,19 @@ jobs: # Run the stress tests for each .NET runtime. - ${{ each runtime in parameters.netTestRuntimes }}: - task: DotNetCoreCLI@2 - displayName: Test [${{runtime}}] + displayName: Test [${{ runtime }}] inputs: command: custom custom: run projects: $(project) - arguments: $(dotnetArguments) --no-build -f $(runtime) -e STRESS_CONFIG_FILE=config.json -- $(testArguments) + arguments: $(dotnetArguments) --no-build -f ${{ runtime }} -e STRESS_CONFIG_FILE=config.json -- $(testArguments) # Run the stress tests for each .NET Framework runtime. - ${{ each runtime in parameters.netFrameworkTestRuntimes }}: - task: DotNetCoreCLI@2 - displayName: Test [${{runtime}}] + displayName: Test [${{ runtime }}] inputs: command: custom custom: run projects: $(project) - arguments: $(dotnetArguments) --no-build -p:MdsPackageVersion=$(mdsVersion) -f $(runtime) -e STRESS_CONFIG_FILE=config.json -- $(testArguments) + arguments: $(dotnetArguments) --no-build -f ${{ runtime }} -e STRESS_CONFIG_FILE=config.json -- $(testArguments) diff --git a/eng/pipelines/stress/stress-tests-pipeline.yml b/eng/pipelines/stress/stress-tests-pipeline.yml index 13ada26c39..b33f134cc2 100644 --- a/eng/pipelines/stress/stress-tests-pipeline.yml +++ b/eng/pipelines/stress/stress-tests-pipeline.yml @@ -34,6 +34,7 @@ resources: - pipeline: Public-ADO-PR-SqlClient-Project project: Public source: /ADO/PR-SqlClient-Project + trigger: true # The CI-SqlClient pipeline in the Public project. - pipeline: Public-ADO-CI-SqlClient diff --git a/src/Microsoft.Data.SqlClient/tests/StressTests/Readme.md b/src/Microsoft.Data.SqlClient/tests/StressTests/Readme.md index e8ec3dc051..546428dbe9 100644 --- a/src/Microsoft.Data.SqlClient/tests/StressTests/Readme.md +++ b/src/Microsoft.Data.SqlClient/tests/StressTests/Readme.md @@ -1,27 +1,21 @@ # Microsoft.Data.SqlClient Stress Test -This Stress testing application for the `Microsoft.Data.SqlClient` suite is under progress. +This Stress testing application for the `Microsoft.Data.SqlClient` suite is a work in progress. -This project intends to help finding a certain level of effectiveness under -unfavorable conditions, and verifying the mode of failures. +This project intends to help finding a certain level of effectiveness under unfavorable conditions, +and verifying the mode of failures. -This is a console application targeting all frameworks supported by MDS, -currently: +This is a console application targeting all frameworks supported by MDS, currently: - .NET 10.0 - .NET 9.0 - .NET 8.0 -- .NET Framework 4.8.1 -- .NET Framework 4.8 -- .NET Framework 4.7.2 -- .NET Framework 4.7.1 -- .NET Framework 4.7 -- .NET Framework 4.6.2 +- .NET Framework 4.6.2 (Windows only; higher .NET Framework versions are supported at runtime via + compatibility) ## Purpose of application for developers -Define fuzz tests for all new features/APIs in the driver and to be run before -every GA release. +Define fuzz tests for all new features/APIs in the driver and to be run before every GA release. ## Pre-Requisites @@ -41,14 +35,13 @@ Required in the config file: |`disableNamedPipes`|`true`, `false`|`true` means the connections will create just using tcp protocol.| |`encrypt`|`true`, `false`|Assigns the encrypt property of the connection strings.| -Note: The database user must have permission to create and drop databases. -Each execution of the stress tests will create a database with a name like: +Note: The database user must have permission to create and drop databases. Each execution of the +stress tests will create a database with a name like: - `StressTests-` -The database will be dropped as a best effort once testing is complete. This -allows for multiple test runs to execute in parallel against the same database -server without colliding. +The database will be dropped as a best effort once testing is complete. This allows for multiple +test runs to execute in parallel against the same database server without colliding. ## Adding new Tests @@ -65,21 +58,19 @@ dotnet build SqlClient.Stress.Runner [-c ] ## Running tests -After building the application, find the built folder with target framework and -run the `stresstest.exe` file with required arguments. +After building the application, find the built folder with target framework and run the +`stresstest.exe` file with required arguments. -Find the result in a log file inside the `logs` folder besides the command -prompt. +Find the result in a log file inside the `logs` folder besides the command prompt. -You may specify the config file by supplying an environment variable that -points to the file: +You may specify the config file by supplying an environment variable that points to the file: - `STRESS_CONFIG_FILE=/path/to/my/config.jsonc` ## Command prompt -You must run the stress tests from the root of the Stress Tests project -directory (i.e. the same directory this readme file is in). +You must run the stress tests from the root of the Stress Tests project directory (i.e. the same +directory this readme file is in). ```bash # Linux From 45b33596e68ca24c8a37e73c2c3250aa87de5be0 Mon Sep 17 00:00:00 2001 From: Paul Medynski <31868385+paulmedynski@users.noreply.github.com> Date: Thu, 19 Mar 2026 14:34:33 -0300 Subject: [PATCH 6/6] Addressed my own comments. --- eng/pipelines/stress/stress-tests-job.yml | 11 ++++------- eng/pipelines/stress/stress-tests-pipeline.yml | 11 ++++++----- eng/pipelines/stress/stress-tests-stage.yml | 4 ++-- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/eng/pipelines/stress/stress-tests-job.yml b/eng/pipelines/stress/stress-tests-job.yml index 19162f02f2..40cecf6e93 100644 --- a/eng/pipelines/stress/stress-tests-job.yml +++ b/eng/pipelines/stress/stress-tests-job.yml @@ -104,9 +104,8 @@ jobs: --artifacts-path $(dotnetArtifactsDir) --configuration ${{ parameters.buildConfiguration }} - # The contents of the config file to use for all tests. We will write - # this to a JSON file for each test job, and then point to it via the - # STRESS_CONFIG_FILE environment variable. + # The contents of the config file to use for all tests. We will write this to a JSON file and + # then point to it via the STRESS_CONFIG_FILE environment variable. - name: configContent value: | [ @@ -167,8 +166,7 @@ jobs: - task: DotNetCoreCLI@2 displayName: Test [${{ runtime }}] inputs: - command: custom - custom: run + command: run projects: $(project) arguments: $(dotnetArguments) --no-build -f ${{ runtime }} -e STRESS_CONFIG_FILE=config.json -- $(testArguments) @@ -177,7 +175,6 @@ jobs: - task: DotNetCoreCLI@2 displayName: Test [${{ runtime }}] inputs: - command: custom - custom: run + command: run projects: $(project) arguments: $(dotnetArguments) --no-build -f ${{ runtime }} -e STRESS_CONFIG_FILE=config.json -- $(testArguments) diff --git a/eng/pipelines/stress/stress-tests-pipeline.yml b/eng/pipelines/stress/stress-tests-pipeline.yml index b33f134cc2..cec68912fb 100644 --- a/eng/pipelines/stress/stress-tests-pipeline.yml +++ b/eng/pipelines/stress/stress-tests-pipeline.yml @@ -3,17 +3,18 @@ # file to you under the MIT license. See the LICENSE file in the project root for more information. #################################################################################################### -# This pipeline runs the stress test suite using artifacts from the triggering pipeline. +# This pipeline runs the stress test suite against the SqlClient projects, building them +# transitively as necessary, triggered by successful runs of the following pipelines: # # Public project: # Triggering pipelines: PR-SqlClient-Project, CI-SqlClient (branch main only) # Pipeline name: Stress-SqlClient -# Pipeline URL: https://dev.azure.com/SqlClientDrivers/public/_build?definitionId=2212 +# Pipeline URL: TODO: Create the Azure DevOps pipeline. # # ADO.Net project: -# Triggering pipeline: MDS Main CI (branch internal/main only) -# Pipeline name: Stress-SqlClient -# Pipeline URL: TODO +# Triggering pipeline: MDS Main CI (branch internal/main only) +# Pipeline name: Stress-SqlClient +# Pipeline URL: TODO: Create the Azure DevOps pipeline. # Set the pipeline run name to the day-of-year and the daily run counter. name: $(DayOfYear)$(Rev:rr) diff --git a/eng/pipelines/stress/stress-tests-stage.yml b/eng/pipelines/stress/stress-tests-stage.yml index 02e6b02998..0f0000f99a 100644 --- a/eng/pipelines/stress/stress-tests-stage.yml +++ b/eng/pipelines/stress/stress-tests-stage.yml @@ -3,8 +3,8 @@ # file to you under the MIT license. See the LICENSE file in the project root for more information. #################################################################################################### -# This stage builds and runs stress tests against SqlClient NuGet package available as a pipeline -# artifact. +# This stage builds and runs stress tests against the SqlClient projects, building them transitively +# as necessary. # # The stress tests are located here: #