diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 51ce83bb10..e024b30d6f 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -34,7 +34,7 @@ This project includes several key products and libraries that facilitate SQL Ser ## 🛠️ Key Features - **Connectivity to SQL Server**: Provides robust and secure connections to SQL Server databases, using various authentication methods, such as Windows Authentication, SQL Server Authentication, and Entra ID authentication, e.g. `ActiveDirectoryIntegrated`, `ActiveDirectoryPassword`, `ActiveDirectoryServicePrincipal`,`ActiveDirectoryInteractive`, `ActiveDirectoryDefault`, and `ActiveDirectoryManagedIdentity`. - **Connection Resiliency**: Implements connection resiliency features to handle transient faults and network issues, ensuring reliable database connectivity. -- **TLS Encryption**: Supports secure connections using TLS protocols to encrypt data in transit. Supports TLS 1.2 and higher, ensuring secure communication with SQL Server. Supported encryption modes are: +- **TLS Encryption**: Supports secure connections using TLS protocols to encrypt data in transit. Supports TLS 1.2 and higher, ensuring secure communication with SQL Server. Supported encryption modes are: - **Optional**: Encryption is used if available, but not required. - **Mandatory**: Encryption is mandatory for the connection. - **Strict**: Enforces strict TLS requirements, ensuring only secure connections are established. @@ -123,7 +123,7 @@ When a new issue is created, follow these steps: - Ensure the PR passes all CI checks before merging. ### ✅ Closing Issues -- Add a comment summarizing the fix and referencing the PR +- Add a comment summarizing the fix and referencing the PR ### ⚙️ Automating Workflows - Auto-label PRs based on folder paths (e.g., changes in `src/Microsoft.Data.SqlClient/src/` → `Area\SqlClient`, changes in `tests/` → `Area\Testing`) and whether they add new public APIs or introduce a breaking change. diff --git a/.github/instructions/ado-pipelines.instructions.md b/.github/instructions/ado-pipelines.instructions.md index 5dfd35a12c..9260a78b3d 100644 --- a/.github/instructions/ado-pipelines.instructions.md +++ b/.github/instructions/ado-pipelines.instructions.md @@ -49,7 +49,7 @@ Key parameters: - `runAlwaysEncryptedTests` — include AE test set; default `true` - `runLegacySqlTests` — include SQL Server 2016/2017 manual-test legs; default `true` - `debug` — enable debug output; default `false` -- `dotnetVerbosity` — MSBuild verbosity; default `normal` +- `dotnetVerbosity` — build verbosity; default `normal` ## Build Stage Order diff --git a/.github/instructions/architecture.instructions.md b/.github/instructions/architecture.instructions.md index e1578592fe..2fd30c9f55 100644 --- a/.github/instructions/architecture.instructions.md +++ b/.github/instructions/architecture.instructions.md @@ -49,7 +49,7 @@ The `netcore/` and `netfx/` directories are legacy artifacts from the old dual-p - `netcore/ref/` and `netfx/ref/` — **STILL ACTIVE**. Reference assemblies remain in these directories and define the public API surface for each target framework. ### OS Targeting with `TargetOs` -The unified project uses a `TargetOs` MSBuild property to handle OS-specific compilation: +The unified project uses a `TargetOs` build property to handle OS-specific compilation: ```xml diff --git a/.github/instructions/testing.instructions.md b/.github/instructions/testing.instructions.md index b5e7d28479..7c415c280e 100644 --- a/.github/instructions/testing.instructions.md +++ b/.github/instructions/testing.instructions.md @@ -115,7 +115,7 @@ The default test filter is defined in `build.proj` via `TestFilters`: ```xml category!=failing&category!=flaky&category!=interactive ``` -This can be overridden via MSBuild property: `msbuild build.proj -t:TestSqlClientUnit -p:TestFilters="your_filter"`. +This can be overridden via build property: `dotnet build build.proj -t:TestSqlClientUnit -p:TestFilters="your_filter"`. ### Test Attributes ```csharp @@ -139,19 +139,19 @@ public void TestIntermittentlyFails() { ... } ## Running Tests -### Using MSBuild (Recommended) +### Using `build.proj` targets (Recommended) ```bash # Build and run all unit tests -msbuild build.proj -t:TestSqlClientUnit +dotnet build build.proj -t:TestSqlClientUnit # Run functional tests only -msbuild build.proj -t:TestSqlClientFunctional +dotnet build build.proj -t:TestSqlClientFunctional # Run manual tests for specific framework -msbuild build.proj -t:TestSqlClientManual -p:TestFramework=net8.0 +dotnet build build.proj -t:TestSqlClientManual -p:TestFramework=net8.0 # Run specific test set -msbuild build.proj -t:TestSqlClientManual -p:TestSet=1 +dotnet build build.proj -t:TestSqlClientManual -p:TestSet=1 ``` ### Using dotnet CLI @@ -325,7 +325,7 @@ AssertExtensions.ThrowsContains(() => action(), "expected message" ### Running with Coverage ```bash -msbuild build.proj -t:TestSqlClientUnit -p:TestCodeCoverage=true +dotnet build build.proj -t:TestSqlClientUnit -p:TestCodeCoverage=true ``` ### Coverage Targets @@ -335,16 +335,11 @@ msbuild build.proj -t:TestSqlClientUnit -p:TestCodeCoverage=true ## Debugging Tests -### Visual Studio +### IDE 1. Set breakpoints in test code -2. Right-click test → Debug Test +2. Right-click test → Debug Test (or use CodeLens "Debug Test" link) 3. Use Test Explorer for navigation -### VS Code -1. Configure C# extension -2. Use CodeLens "Debug Test" link -3. Attach to test process - ### Command Line ```bash # Enable verbose output diff --git a/.github/plans/apicompat-ref-assembly-validation.md b/.github/plans/apicompat-ref-assembly-validation.md index b968dbf678..3ae4f0a46d 100644 --- a/.github/plans/apicompat-ref-assembly-validation.md +++ b/.github/plans/apicompat-ref-assembly-validation.md @@ -9,7 +9,7 @@ The comparison uses `Microsoft.DotNet.ApiCompat.Tool` in **strict mode**, which ## Usage ``` -dotnet msbuild build.proj /t:CompareRefAssemblies /p:BaselinePackageVersion=6.1.4 +dotnet build build.proj /t:CompareMdsRefAssemblies /p:BaselinePackageVersion=6.1.4 ``` - `BaselinePackageVersion` is **required** (no default). The user must specify which published package to compare against. @@ -22,7 +22,7 @@ dotnet msbuild build.proj /t:CompareRefAssemblies /p:BaselinePackageVersion=6.1. Add an entry for version `9.0.200` alongside the existing `dotnet-coverage` entry. This enables `dotnet apicompat` after `dotnet tool restore`. -### 2. Create `tools/targets/CompareRefAssemblies.targets` +### 2. Create `tools/targets/CompareMdsRefAssemblies.targets` A single new file containing all properties, items, and targets (steps 3–11 below). Follows the naming convention of existing files like `GenerateMdsPackage.targets`. @@ -85,7 +85,7 @@ Runs ``. - Preceded by `` labelling each comparison - Uses item metadata to map `net462` to `$(LegacyNetFxRefDir)` and others to `$(LegacyNetCoreRefDir)` -### 11. `CompareRefAssemblies` target (public entry point) +### 11. `CompareMdsRefAssemblies` target (public entry point) - Declared with `DependsOnTargets="_RunRefApiCompat"` - Emits a final `` summarizing completion @@ -95,12 +95,12 @@ Runs ``. Add one line after the existing `.targets` imports (after line 7): ```xml - + ``` ## Design Decisions -- **Single new file** at `tools/targets/CompareRefAssemblies.targets` — only one `` line added to `build.proj`. +- **Single new file** at `tools/targets/CompareMdsRefAssemblies.targets` — only one `` line added to `build.proj`. - **Internal targets prefixed with `_`** to signal they're not intended to be called directly. - **Strict mode** ensures API additions are also flagged — important for detecting accidental public surface changes during file reorganization. - **`ContinueOnError="ErrorAndContinue"`** on each apicompat `Exec` so all 8 comparisons run and all differences are reported together. @@ -111,7 +111,7 @@ Add one line after the existing `.targets` imports (after line 7): ## Verification ``` -dotnet msbuild build.proj /t:CompareRefAssemblies /p:BaselinePackageVersion=6.1.4 +dotnet build build.proj /t:CompareMdsRefAssemblies /p:BaselinePackageVersion=6.1.4 ``` - Downloads 6.1.4 nupkg, builds both ref project variants, runs 8 comparisons (4 TFMs × 2 variants). diff --git a/BUILDGUIDE.md b/BUILDGUIDE.md index 16aa709fe5..a927945c05 100644 --- a/BUILDGUIDE.md +++ b/BUILDGUIDE.md @@ -1,3 +1,5 @@ + + # Build Guide for Microsoft.Data.SqlClient and Related Packages This document provides details on how to build the Microsoft.Data.SqlClient package and the other related packages @@ -6,9 +8,10 @@ contained within this repository. ## Prerequisites ### .NET SDK + Projects in this repository require the .NET SDK to be installed in order to build. For the exact version required for -building the current version, see [global.json](global.json). Downloads for .NET SDK can be found at: -https://dotnet.microsoft.com/en-us/download/dotnet +building the current version, see [global.json](global.json). Downloads for .NET SDK can be found at +[.NET Downloads](https://dotnet.microsoft.com/en-us/download/dotnet). The .NET SDK contains support for building for previous versions of .NET, including support for building .NET Framework on operating systems that do not support .NET Framework. As such, it is not necessary to install any version of the @@ -16,9 +19,11 @@ on operating systems that do not support .NET Framework. As such, it is not nece ### Miscellaneous -**PowerShell** is required to run several miscellaneous tasks as part of building and packaging. On Windows systems, -no action is required. On Linux and macOS systems, the `pwsh` command is required to be in the `$PATH` environment -variable. For specific instructions see: [Install PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/install-powershell) +**PowerShell** is required to run several miscellaneous tasks as part of building and packaging. On +Windows systems, either the built-in `powershell.exe` will be used, or if installed, the modern +`pwsh` will be used. On Linux and macOS systems, the `pwsh` command is required to be in the `$PATH` +environment variable. For specific instructions see: [Install +PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/install-powershell) The **NuGet** binary is optional for inspection and feed-management workflows, but build and packaging flows in this repository are run through `dotnet build` against `build.proj`. @@ -33,6 +38,8 @@ package the project. The `build.proj` file provides convenient targets to accomp > may be noticed, possibly severe. All official build and test infrastructure uses the `build.proj` entrypoint, and it > is recommended that `build.proj` is used for local development, as well. + + > [!TIP] > This section is not exhaustive of all targets or parameters to `build.proj`. Complete documentation is available in > [`build.proj`](build.proj). @@ -45,11 +52,21 @@ From the root of your repository, run `dotnet build` against `build.proj` with a dotnet build build.proj -t: [optional_parameters] ``` +Since `build.proj` is the only project file in the repo root, it can be omitted when building from +the root: + +```bash +dotnet build -t: [optional_parameters] +``` + +The command-line examples below will assume that `build.proj` is selected by default and will omit +it from the `dotnet build` command. + The following build targets can be used to build the following projects. All targets will implicitly build any other projects they depend on. | `` | Description | -|:----------------------------|:--------------------------------------------------------------------------------| +|-----------------------------|---------------------------------------------------------------------------------| | `Build` | Builds all projects for all platforms | | `BuildAbstractions` | Builds Microsoft.Data.SqlClient.Extensions.Abstractions | | `BuildAkvProvider` | Builds Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider | @@ -64,11 +81,15 @@ projects they depend on. A selection of parameters for build targets in `build.proj` can be found below: + + | `[optional_parameter]` | Allowed Values | Default | Description | |-----------------------------------|----------------------------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------| | `-p:Configuration=` | `Debug`, `Release` | `Debug` | Build configuration | | `-p:PackageVersion=` | `major.minor.patch[-prerelease]` | `[blank]` | Version to assign to the target package, where `` can be one of: `['Abstractions', 'Azure', 'AkvProvider', 'Logging', 'SqlClient', 'SqlServer']`. Assembly and file versions are derived from this, if it is provided. See Versioning for more details | + + For most projects, build output is placed in `artifacts//Project-/`. `` is the full name of the package, `` is the build configuration, and `` is the target framework moniker. SqlClient deviates slightly from this convention, since it consists of multiple projects and the @@ -82,19 +103,19 @@ placed in `artifacts/Microsoft.Data.SqlClient.ref/Project-/` Build all projects: ```bash -dotnet build build.proj -t:Build +dotnet build -t:Build ``` Build Microsoft.Data.SqlClient in Release configuration: ```bash -dotnet build build.proj -t:BuildSqlClient -p:Configuration=Release +dotnet build -t:BuildSqlClient -p:Configuration=Release ``` Build v1.2.3 of Microsoft.Data.SqlClient.Extensions.Abstractions: ```bash -dotnet build build.proj -t:BuildAbstractions -p:PackageVersionAbstractions=1.2.3 +dotnet build -t:BuildAbstractions -p:PackageVersionAbstractions=1.2.3 ``` ### Testing Projects @@ -105,7 +126,7 @@ information about test procedures, including config file setup, see [TESTGUIDE.m From the root of your repository, run `dotnet build` against `build.proj` with a test target, following this pattern: ```bash -dotnet build build.proj -t: [optional_parameters] +dotnet build -t: [optional_parameters] ``` | `` | Description | @@ -123,6 +144,8 @@ dotnet build build.proj -t: [optional_parameters] A selection of parameters for test targets in `build.proj` relevant to common developer workflows can be found below: + + | `[optional_parameter]` | Default Value | Description | |------------------------|----------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `-p:Configuration=` | `Debug` | Build configuration. Can be `Debug` or `Release`. | @@ -132,32 +155,38 @@ A selection of parameters for test targets in `build.proj` relevant to common de | `-p:TestFramework=` | `[blank]` | Target framework moniker for the version of .NET to use to execute tests. | | `-p:TestSet=` | `[blank]` | The `TestSqlClientManual` project is very large and is split into multiple sets that can be executed individually. This parameter allows selecting between test sets: `1`, `2`, `3`, and `AE`. | + + #### Examples Run Microsoft.Data.SqlClient unit tests: ```bash -dotnet build build.proj -t:TestSqlClientUnit +dotnet build -t:TestSqlClientUnit ``` Run Microsoft.Data.SqlClient manual test set 2: + ```bash -dotnet build build.proj -t:TestSqlClientManual -p:TestSet=2 +dotnet build -t:TestSqlClientManual -p:TestSet=2 ``` Run Microsoft.Data.SqlClient functional tests against x86 dotnet: + ```bash -dotnet build build.proj -t:TestSqlClientFunctional -p:DotnetPath='C:\path\to\dotnet\x86\' +dotnet build -t:TestSqlClientFunctional -p:DotnetPath='C:\path\to\dotnet\x86\' ``` Run all Microsoft.Data.SqlClient.Extensions.Azure unit tests, including interactive, but excluding failing tests: + ```bash -dotnet build build.proj -t:TestAzure -p:TestFilters=category!=failing +dotnet build -t:TestAzure -p:TestFilters=category!=failing ``` Run Microsoft.Data.SqlClient functional tests against net8.0 runtime: + ```bash -dotnet build build.proj -t:TestSqlClientFunctional -p:TestFramework=net8.0 +dotnet build -t:TestSqlClientFunctional -p:TestFramework=net8.0 ``` ### Packaging Projects @@ -167,10 +196,10 @@ also handled by `build.proj`. From the root of your repository, run `dotnet buil following this pattern: ```bash -dotnet build build.proj -t: [optional_parameters] +dotnet build -t: [optional_parameters] ``` -| `` | Description | +| `` | Description | |--------------------|-------------------------------------------------------------------------------------| | `Pack` | Packages all projects in the repository. | | `PackAbstractions` | Packages the Microsoft.Data.SqlClient.Extensions.Abstractions package | @@ -185,12 +214,16 @@ dotnet build build.proj -t: [optional_parameters] A selection of parameters for pack targets in `build.proj` relevant to common developer workflows can be found below: + + | `[optional_parameter]` | Default Value | Allowed Values | Description | |------------------------------------|---------------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------| | `-p:Configuration=` | `Debug` | `Debug`, `Release` | Build configuration. Only applies if project and dependencies are being built. | | `-p:PackBuild=` | `true` | `true`, `false` | Whether or not to build the project before packing. If `false`, project must be built using the same parameters. | | `-p:PackageVersion=` | `[blank]` | eg. `1.2.3-dev123` | Version to assign to the package, where `` can be one of: `['Abstractions', 'Azure', 'AkvProvider', 'Logging', 'SqlClient', 'SqlServer']`. If `PackBuild` is `true`, the assembly and file versions will be derived from this version. See Versioning for more details. | + + For `PackSqlClient`, these additional parameters are optional overrides for dependency versions injected into the SqlClient nuspec during pack: - `-p:PackageVersionAbstractions=` @@ -201,23 +234,27 @@ If omitted, `PackSqlClient` computes `AbstractionsPackageVersion` and `LoggingPa #### Examples Package Microsoft.Data.SqlClient.Internal.Logging into a NuGet package: + ```bash -dotnet build build.proj -t:PackLogging +dotnet build -t:PackLogging ``` Package Microsoft.Data.SqlClient: + ```bash -dotnet build build.proj -t:PackSqlClient +dotnet build -t:PackSqlClient ``` Package version 1.2.3 of Microsoft.Data.SqlClient.Extensions.Abstractions: + ```bash -dotnet build build.proj -t:PackAbstractions -p:PackageVersionAbstractions=1.2.3 +dotnet build -t:PackAbstractions -p:PackageVersionAbstractions=1.2.3 ``` Package Microsoft.Data.SqlClient.Extensions.Azure without building it beforehand: + ```bash -dotnet build build.proj -t:PackAzure -p:PackBuild=false +dotnet build -t:PackAzure -p:PackBuild=false ``` ## Versioning @@ -255,12 +292,12 @@ build scenarios. For completeness, and debugging of automated builds, this secti To switch to "package mode", set the `ReferenceType` parameter in `build.proj` to `Package`. And, optionally, include one or more of the following parameters: -* `PackageVersionAbstractions` -* `PackageVersionAkvProvider` -* `PackageVersionAzure` -* `PackageVersionLogging` -* `PackageVersionSqlClient` -* `PackageVersionSqlServer` +- `PackageVersionAbstractions` +- `PackageVersionAkvProvider` +- `PackageVersionAzure` +- `PackageVersionLogging` +- `PackageVersionSqlClient` +- `PackageVersionSqlServer` These parameters pull double duty. In targets where the package is being built, the parameter sets the version of the package. In targets where the package is being referenced, the parameter sets the version of the package that is being @@ -277,22 +314,27 @@ run subsequent `build.proj` targets against them. Build Microsoft.Data.SqlClient version 7.1.1 that references Microsoft.Data.SqlClient.Extensions.Abstractions v1.0.1 and Microsoft.Data.SqlClient.Internal.Logging v2.2.2. +Build v2.2.2 of Logging and copy to packages: + ```bash -# Build v2.2.2 of Logging and copy to packages -dotnet build build.proj -t:PackLogging \ - -p:ReferenceType=Package \ - -p:PackageVersionLogging=2.2.2 +dotnet build -t:PackLogging -p:ReferenceType=Package -p:PackageVersionLogging=2.2.2 cp artifacts/Microsoft.Data.SqlClient.Internal.Logging/Debug/*.*pkg packages/ +``` + +Build v1.0.1 of Abstractions that depends on v2.2.2 of Logging: -# Build v1.0.1 of Abstractions that depends on v2.2.2 of Logging -dotnet build build.proj -t:PackAbstractions \ +```bash +dotnet build -t:PackAbstractions \ -p:ReferenceType=Package \ -p:PackageVersionAbstractions=1.0.1 \ - -p:PackageVersionLogging=2.2.2 \ + -p:PackageVersionLogging=2.2.2 cp artifacts/Microsoft.Data.SqlClient.Extensions.Abstractions/Package-Debug/*.*pkg packages/ +``` -# Build SqlClient -dotnet build build.proj -t:PackSqlClient \ +Build SqlClient: + +```bash +dotnet build -t:PackSqlClient \ -p:ReferenceType=Package \ -p:PackageVersionSqlClient=7.1.1 \ -p:PackageVersionAbstractions=1.0.1 \ @@ -301,22 +343,17 @@ cp artifacts/Microsoft.Data.SqlClient/Package-Debug/*.*pkg packages/ ``` Run Microsoft.Data.SqlClient functional tests against the versions built above: + ```bash -dotnet build build.proj -t:TestSqlClientFunctional \ +dotnet build -t:TestSqlClientFunctional \ -p:ReferenceType=Package \ -p:PackageVersionSqlClient=7.1.1 \ -p:PackageVersionAbstractions=1.0.1 \ -p:PackageVersionLogging=2.2.2 ``` ----- - - Manual test prerequisites and configuration are covered in [TESTGUIDE.md](TESTGUIDE.md#manual-test-prerequisites). - ---- - ## Using Managed SNI on Windows Managed SNI can be enabled on Windows by enabling the below AppContext switch: @@ -371,10 +408,14 @@ PowerShell: Bash: + + ```bash $ cd src/Microsoft.Data.SqlClient/tests/PerformanceTests ``` + + ### Create Database Create an empty database for the benchmarks to use. This example assumes diff --git a/TESTGUIDE.md b/TESTGUIDE.md index 349674deee..aab773a080 100644 --- a/TESTGUIDE.md +++ b/TESTGUIDE.md @@ -26,6 +26,16 @@ Use [build.proj](build.proj) from the repository root: dotnet build build.proj -t: [optional_parameters] ``` +Since `build.proj` is the only project file in the repo root, it can be omitted when building from +the root: + +```bash +dotnet build -t: [optional_parameters] +``` + +The command-line examples below will assume that `build.proj` is selected by default and will omit +it from the `dotnet build` command. + Test targets build the projects they depend on, so a separate build step is not required for normal test runs. ## Test Targets @@ -45,55 +55,55 @@ Test targets build the projects they depend on, so a separate build step is not Run the SqlClient unit tests: ```bash -dotnet build build.proj -t:TestSqlClientUnit +dotnet build -t:TestSqlClientUnit ``` Run the SqlClient functional tests: ```bash -dotnet build build.proj -t:TestSqlClientFunctional +dotnet build -t:TestSqlClientFunctional ``` Run the SqlClient manual tests: ```bash -dotnet build build.proj -t:TestSqlClientManual +dotnet build -t:TestSqlClientManual ``` Run only manual test set 2: ```bash -dotnet build build.proj -t:TestSqlClientManual -p:TestSet=2 +dotnet build -t:TestSqlClientManual -p:TestSet=2 ``` Run manual test sets 1 and 3: ```bash -dotnet build build.proj -t:TestSqlClientManual -p:TestSet=13 +dotnet build -t:TestSqlClientManual -p:TestSet=13 ``` Run Always Encrypted manual tests: ```bash -dotnet build build.proj -t:TestSqlClientManual -p:TestSet=AE +dotnet build -t:TestSqlClientManual -p:TestSet=AE ``` Run a specific target framework: ```bash -dotnet build build.proj -t:TestSqlClientFunctional -p:TestFramework=net8.0 +dotnet build -t:TestSqlClientFunctional -p:TestFramework=net8.0 ``` Run functional tests against an x86 `dotnet` installation: ```bash -dotnet build build.proj -t:TestSqlClientFunctional -p:DotnetPath='C:\path\to\dotnet\x86\' +dotnet build -t:TestSqlClientFunctional -p:DotnetPath='C:\path\to\dotnet\x86\' ``` Run all Azure extension tests, including `interactive` tests, while still excluding tests marked `failing` or `flaky`: ```bash -dotnet build build.proj -t:TestAzure -p:TestFilters=category!=failing +dotnet build -t:TestAzure -p:TestFilters=category!=failing ``` ## Test Parameters @@ -124,15 +134,22 @@ The most commonly used test parameters are: Examples: +Run a single test by fully-qualified name: + ```bash -# Run a single test by fully-qualified name. -dotnet build build.proj -t:TestSqlClientUnit -p:TestFilters=FullyQualifiedName=Namespace.ClassName.MethodName +dotnet build -t:TestSqlClientUnit -p:TestFilters=FullyQualifiedName=Namespace.ClassName.MethodName +``` + +Run only flaky tests while investigating quarantine failures: + +```bash +dotnet build -t:TestSqlClientManual -p:TestFilters=category=flaky +``` -# Run only flaky tests while investigating quarantine failures. -dotnet build build.proj -t:TestSqlClientManual -p:TestFilters=category=flaky +Disable the default filter: -# Disable the default filter. -dotnet build build.proj -t:TestSqlClientFunctional -p:TestFilters=none +```bash +dotnet build -t:TestSqlClientFunctional -p:TestFilters=none ``` When passing filter expressions that contain shell-sensitive characters such as `&`, quote or escape the value as @@ -216,14 +233,14 @@ For SQL Server in a Linux container, WSL, or another host where SQL authenticati You can override the config file path with the `MDS_TEST_CONFIG` environment variable: ```bash -MDS_TEST_CONFIG=/path/to/config.json dotnet build build.proj -t:TestSqlClientManual -p:TestSet=2 +MDS_TEST_CONFIG=/path/to/config.json dotnet build -t:TestSqlClientManual -p:TestSet=2 ``` On PowerShell: ```powershell $env:MDS_TEST_CONFIG = "C:\path\to\config.json" -dotnet build build.proj -t:TestSqlClientManual -p:TestSet=2 +dotnet build -t:TestSqlClientManual -p:TestSet=2 ``` ## Configuration Properties @@ -280,26 +297,27 @@ If `TestSet` is omitted, all sets are compiled and run. You can combine sets by ## Results and Diagnostics -Test results are written to `test_results` by default. Override the location with `TestResultsFolderPath`: +Test results are written to the `test_results` directory by default. Override the location with +`TestResultsFolderPath`: ```bash -dotnet build build.proj -t:TestSqlClientUnit -p:TestResultsFolderPath=/tmp/sqlclient-test-results +dotnet build -t:TestSqlClientUnit -p:TestResultsFolderPath=/tmp/sqlclient-test-results ``` Hang blame collection is enabled by default with a `10m` timeout. To increase the timeout: ```bash -dotnet build build.proj -t:TestSqlClientManual -p:TestBlameTimeout=30m +dotnet build -t:TestSqlClientManual -p:TestBlameTimeout=30m ``` To disable hang blame collection: ```bash -dotnet build build.proj -t:TestSqlClientManual -p:TestBlameTimeout=0 +dotnet build -t:TestSqlClientManual -p:TestBlameTimeout=0 ``` Code coverage is enabled by default. To disable it for a faster local run: ```bash -dotnet build build.proj -t:TestSqlClientUnit -p:TestCodeCoverage=false +dotnet build -t:TestSqlClientUnit -p:TestCodeCoverage=false ``` diff --git a/build.proj b/build.proj index 14db6015ba..971cfb12fa 100644 --- a/build.proj +++ b/build.proj @@ -72,7 +72,7 @@ - + @@ -134,7 +134,7 @@ Text="--- Comparing %(_RefTfm.Identity) ref vs baseline $(BaselinePackageVersion) ---" />