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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions eng/pipelines/pr/jobs/test-buildproj-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ parameters:
- name: buildSuffix
type: string

# Name of the artifact to upload the test results (including code coverage) to.
- name: testResultsArtifactName
type: string

# Dotnet CLI verbosity level.
- name: dotnetVerbosity
type: string
Expand Down Expand Up @@ -78,6 +82,10 @@ jobs:
- job: "test_${{ parameters.platformDisplayName }}_${{ parameters.testDisplayName }}"
displayName: "${{ parameters.testDisplayName }}_${{ parameters.platformDisplayName }}"

variables:
- name: testResultsPath
value: "$(REPO_ROOT)/test_results/${{ parameters.platformDisplayName }}_${{ parameters.testDisplayName }}"

pool:
name: ${{ parameters.poolName }}
demands:
Expand Down Expand Up @@ -107,3 +115,13 @@ jobs:
-p:BuildNumber='$(Build.BuildNumber)'
-p:BuildSuffix='${{ parameters.buildSuffix }}'
-p:TestFramework=${{ parameters.platformDotnet }}
-p:TestResultsFolderPath=${{ variables.testResultsPath }}

# Publish test results
- template: /eng/pipelines/pr/steps/publish-test-results-step.yml@self
parameters:
buildConfiguration: ${{ parameters.buildConfiguration }}
platformDisplayName: ${{ parameters.platformDisplayName }}
testDisplayName: ${{ parameters.testDisplayName }}
testResultsArtifactName: ${{ parameters.testResultsArtifactName }}
testResultsPath: ${{ variables.testResultsPath }}
Comment on lines +121 to +127

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.

This actually isn't an issue, if you look at the test logs https://dev.azure.com/SqlClientDrivers/ADO.Net/_build/results?buildId=155942&view=logs&j=9aaebe84-0bb8-5049-010a-f5d7cc3b7829&t=6f7d4681-2ac1-5fe1-83e3-59d9d33c8750

I'm not sure there's a concept of "runtime variables" as is being asserted here. There are values that are only available at runtime, but as long as those are referenced by $() they will remain $() until they are used at runtime, where they are further expanded to their value.

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.

It's worth noting that if this wasn't the case, we'd never be able to have $(Password) in our connection strings and expect it to be expanded when we write it to the config file.

19 changes: 19 additions & 0 deletions eng/pipelines/pr/jobs/test-sqlclientmanual-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ parameters:
- name: stageNameSecrets
type: string

# Name of the artifact to upload the test results (including code coverage) to.
- name: testResultsArtifactName
type: string

# Platform Parameters ====================================================

# Display name of the platform. This will be formatted into the job's official name as well as
Expand Down Expand Up @@ -128,6 +132,12 @@ jobs:
- name: saPassword
value: $[stageDependencies.${{ parameters.stageNameSecrets }}.secrets_job.outputs['SaPassword.Value']]

- name: testDisplayName
value: "sqlclient_manual_${{ parameters.configDisplayName}}_${{ parameters.testSet }}"

- name: testResultsPath
value: "$(REPO_ROOT)/test_results/${{ parameters.platformDisplayName }}_$(testDisplayName)"

steps:
# Install dotnet and the runtime that will run the tests (if it is not netframework)
- template: /eng/pipelines/common/steps/install-dotnet.yml@self
Expand Down Expand Up @@ -201,4 +211,13 @@ jobs:
-p:BuildSuffix='${{ parameters.buildSuffix }}'
-p:TestFramework=${{ parameters.platformDotnet }}
-p:TestSet=${{ parameters.testSet }}
-p:TestResultsFolderPath=${{ variables.testResultsPath }}

# Publish test results
- template: /eng/pipelines/pr/steps/publish-test-results-step.yml@self
parameters:
buildConfiguration: ${{ parameters.buildConfiguration }}
platformDisplayName: ${{ parameters.platformDisplayName }}
testDisplayName: ${{ variables.testDisplayName }}
testResultsArtifactName: ${{ parameters.testResultsArtifactName }}
testResultsPath: ${{ variables.testResultsPath }}
Comment on lines 212 to +223

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.

That and the test result folder path isn't being passed into the build.proj step

94 changes: 0 additions & 94 deletions eng/pipelines/pr/pr-pipeline.yml

This file was deleted.

148 changes: 148 additions & 0 deletions eng/pipelines/pr/sqlclient-pr-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
#################################################################################
# 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 builds and tests all products that we release. It is intended to run as validation
# for every PR. The set of tests it executes is not exhaustive, as many tests require special
# environments to provide complete coverage. Instead, this PR strikes a balance between complete
# confidence and speed of PR validation.
#
# It is triggered by pushes to PRs that target the main, dev/*, feat/*, and release/* branches in
# GitHub. The dev/* pattern includes dev/automation/* branches created by AI agents.
#
# It maps to the "sqlclient-pr" pipeline in the Public ADO project:
# https://sqlclientdrivers.visualstudio.com/public/_build?definitionId=2281
# And the "sqlclient-pr" pipeline in the internal ADO project:
# https://dev.azure.com/SqlClientDrivers/ADO.Net/_build?definitionId=2271

# Set the pipeline run name to the day-of-year and the daily run counter.
name: $(DayOfYear)$(Rev:rr)

# Trigger PR validation runs for all pushes to PRs that target the specified branches.
# https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#pr-triggers
pr:
branches:
include:
# GitHub repo branch targets that will trigger PR validation builds.
- dev/*
- feat/*
- main
- release/*

paths:
include:
- .azuredevops/*
- .config/*
- doc/*
- eng/pipelines/common/*
- eng/pipelines/pr/*
- src/*
- tools/*
- azurepipelines-coverage.yml
- build.proj
- Directory.Packages.props
- dotnet-tools.json
- global.json
- NuGet.config

# Do not trigger commit or schedule runs for this pipeline.
trigger: none

parameters:
# General Parameters =====================================================

# Dotnet CLI verbosity level.
- name: dotnetVerbosity
displayName: dotnet CLI Verbosity
type: string
default: normal
values:
- quiet
- minimal
- normal
- detailed
- diagnostic

- name: platforms
type: object
default:
- displayName: "windows_net462"
dotnet: "net462"
image: "ADO-MMS22-SQL22"
operatingSystem: "Windows"
- displayName: "windows_net8"
dotnet: "net8.0"
image: "ADO-MMS22-SQL22"
operatingSystem: "Windows"
- displayName: "windows_net9"
dotnet: "net9.0"
image: "ADO-MMS22-SQL22"
operatingSystem: "Windows"
- displayName: "windows_net10"
dotnet: "net10.0"
image: "ADO-MMS22-SQL22"
operatingSystem: "Windows"

- displayName: "linux_net8"
dotnet: "net8.0"
image: "ADO-UB22-SQL22"
operatingSystem: "Linux"
- displayName: "linux_net9"
dotnet: "net9.0"
image: "ADO-UB22-SQL22"
operatingSystem: "Linux"
- displayName: "linux_net10"
dotnet: "net10.0"
image: "ADO-UB22-SQL22"
operatingSystem: "Linux"

variables:
- template: /eng/pipelines/common/variables/common-variables.yml@self
- template: /eng/pipelines/pr/variables/pr-variables.yml@self

stages:
# Stage 1a: Build and pack all projects in the repository
- template: /eng/pipelines/pr/stages/pack-stage.yml@self
parameters:
buildConfiguration: Debug
buildSuffix: pr
stageName: ${{ variables.stageNamePack }}

# Stage 1b: Generate secrets
- template: /eng/pipelines/pr/stages/generate-secrets-stage.yml@self
parameters:
stageName: ${{ variables.stageNameSecrets }}

# Stage 2: Execute tests and collect code coverage
- template: /eng/pipelines/pr/stages/test-stages.yml@self
parameters:
buildConfiguration: Debug
buildSuffix: pr
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
poolName: $(PoolNameDefault)
stageNamePack: ${{ variables.stageNamePack }}
stageNameSecrets: ${{ variables.stageNameSecrets }}
testResultsArtifactName: ${{ variables.testResultsArtifactName }}

platforms: ${{ parameters.platforms }}

manualTestAzureKeyVaultUrl: $(AzureKeyVaultUrl)
manualTestAzureKeyVaultTenantId: $(AzureKeyVaultTenantId)
manualTestConnectionStringNpLocalhost: $(ConnectionStringNp_LocalhostDefault_UsernamePassword)
manualTestConnectionStringTcpLocalhost: $(ConnectionStringTcp_LocalhostDefault_UsernamePassword)
manualTestConnectionStringNpAzure: $(ConnectionStringNp_Azure_ManagedIdentity)
manualTestConnectionStringTcpAzure: $(ConnectionStringTcp_Azure_ManagedIdentity)
manualTestFileStreamDirectory: "$(Pipeline.Workspace)/filestream"
manualTestLocalDbAppName: $(LocalDbAppName)
manualTestLocalDbSharedInstanceName: $(LocalDbSharedInstanceName)
manualTestUserManagedIdentityClientId: $(UserManagedIdentityClientId)

# Stage 3: Collect code coverage
- template: /eng/pipelines/pr/stages/collect-coverage-stage.yml@self
parameters:
codeCovApiToken: $(CodeCovApiToken)
dependsOn:
- ${{ each platform in parameters.platforms }}:
- "test_${{ platform.displayName }}"
Loading
Loading