From fb0135febfec8f942923ed83ab1ebb85a2856fd3 Mon Sep 17 00:00:00 2001 From: Ben Russell Date: Tue, 25 Aug 2026 13:59:46 -0500 Subject: [PATCH] Introduce config default pattern for perf tests --- .gitignore | 3 +++ BUILDGUIDE.md | 20 ++++++++++--------- ...oft.Data.SqlClient.PerformanceTests.csproj | 3 +++ ...onfig.jsonc => runnerconfig.default.jsonc} | 2 +- 4 files changed, 18 insertions(+), 10 deletions(-) rename src/Microsoft.Data.SqlClient/tests/PerformanceTests/{runnerconfig.jsonc => runnerconfig.default.jsonc} (99%) diff --git a/.gitignore b/.gitignore index 9289d0ab5f..674bef051d 100644 --- a/.gitignore +++ b/.gitignore @@ -138,6 +138,9 @@ node_modules/ **/config.json **/config.jsonc +# Performance test runner config +/src/Microsoft.Data.SqlClient/tests/PerformanceTests/runnerconfig.jsonc + # Generated Milestone PR metadata files .milestone-prs/ diff --git a/BUILDGUIDE.md b/BUILDGUIDE.md index 72daa88ea8..b42411806c 100644 --- a/BUILDGUIDE.md +++ b/BUILDGUIDE.md @@ -448,16 +448,19 @@ $ sqlcmd -S localhost -U sa -P password 1> quit ``` -The default `runnerconfig.jsonc` expects a database named `sqlclient-perf-db`, -but you may change the config to use any existing database. The benchmarks +The default `runnerconfig.default.jsonc` expects a database named +`sqlclient-perf-db`, but you may change the generated `runnerconfig.jsonc` +to use any existing database. The benchmarks create and drop their own tables (typically prefixed with `perf_`) in this database; other existing tables are left untouched. ### Configure Runner -Configure the benchmarks by editing the `runnerconfig.jsonc` file directly in the +Configure the benchmarks by editing the `runnerconfig.jsonc` file in the `PerformanceTests` directory with an appropriate connection string and benchmark -settings: +settings. If the file does not exist, the build creates it from +`runnerconfig.default.jsonc`; `runnerconfig.jsonc` is ignored by git so local +connection strings and benchmark settings can stay local. ```json { @@ -504,11 +507,10 @@ copy the file into the `artifacts` directory alongside the benchmark DLL. By default, the benchmarks look for `runnerconfig.jsonc` in the same directory as the DLL. -Optionally, to avoid polluting your git workspace and requiring a build after -each config change, copy `runnerconfig.jsonc` to a new file, make your edits -there, and then specify the new file with the RUNNER_CONFIG environment -variable. The same approach works for `datatypes.json` via the -`DATATYPES_CONFIG` environment variable. +Optionally, to avoid requiring a build after each config change, copy +`runnerconfig.jsonc` to a new file, make your edits there, and then specify the +new file with the RUNNER_CONFIG environment variable. The same approach works +for `datatypes.json` via the `DATATYPES_CONFIG` environment variable. PowerShell: diff --git a/src/Microsoft.Data.SqlClient/tests/PerformanceTests/Microsoft.Data.SqlClient.PerformanceTests.csproj b/src/Microsoft.Data.SqlClient/tests/PerformanceTests/Microsoft.Data.SqlClient.PerformanceTests.csproj index aced0f5bf0..4342e4c0fd 100644 --- a/src/Microsoft.Data.SqlClient/tests/PerformanceTests/Microsoft.Data.SqlClient.PerformanceTests.csproj +++ b/src/Microsoft.Data.SqlClient/tests/PerformanceTests/Microsoft.Data.SqlClient.PerformanceTests.csproj @@ -25,6 +25,9 @@ + + + diff --git a/src/Microsoft.Data.SqlClient/tests/PerformanceTests/runnerconfig.jsonc b/src/Microsoft.Data.SqlClient/tests/PerformanceTests/runnerconfig.default.jsonc similarity index 99% rename from src/Microsoft.Data.SqlClient/tests/PerformanceTests/runnerconfig.jsonc rename to src/Microsoft.Data.SqlClient/tests/PerformanceTests/runnerconfig.default.jsonc index 0ecc44e957..11a10d4666 100644 --- a/src/Microsoft.Data.SqlClient/tests/PerformanceTests/runnerconfig.jsonc +++ b/src/Microsoft.Data.SqlClient/tests/PerformanceTests/runnerconfig.default.jsonc @@ -1,4 +1,4 @@ -{ +{ "ConnectionString": "Server=tcp:localhost; Integrated Security=true; Initial Catalog=sqlclient-perf-db;", // Enable this flag to enable managed SNI on Windows. "UseManagedSniOnWindows": false,