@@ -30,6 +30,7 @@ Once the environment is setup properly, execute the desired set of commands belo
30
30
| ` RunTests ` | Runs the functional and manual tests for the .NET Framework and .NET drivers|
31
31
| ` RunFunctionalTests ` | Runs just the functional tests for the .NET Framework and .NET drivers|
32
32
| ` RunManualTests ` | Runs just the manual tests for the .NET Framework and .NET drivers|
33
+ | ` BuildAkv ` | Builds the Azure Key Vault Provider package for all supported platforms.|
33
34
34
35
35
36
### Parameters
@@ -306,7 +307,7 @@ To run the same:
306
307
The program 'dotnet' has exited with code 0 (0x0).
307
308
```
308
309
309
- 5. Now you can write code in [Program.cs](/src/Microsoft.Data.SqlClient/tests/DockerLinuxTest/Program.cs) to debug SqlClient on Linux!
310
+ 5. Now you can write code in [Program.cs](/src/Microsoft.Data.SqlClient/tests/Docker/ DockerLinuxTest/Program.cs) to debug SqlClient on Linux!
310
311
311
312
### Troubleshooting Docker issues
312
313
@@ -338,14 +339,118 @@ dotnet test <test_properties...> --collect:"XPlat Code Coverage"
338
339
339
340
## Run Performance Tests
340
341
341
- ### Running Performance test project directly
342
+ The performance tests live here:
343
+ ` src\Microsoft.Data.SqlClient\tests\PerformanceTests\ `
342
344
343
- Project location from Root: ` src\Microsoft.Data.SqlClient\tests\PerformanceTests\Microsoft.Data.SqlClient.PerformanceTests.csproj `
344
- Configure ` runnerconfig.json ` file with connection string and preferred settings to run Benchmark Jobs.
345
+ They can be run from the command line by following the instructions below.
346
+
347
+ Launch a shell and change into the project directory:
348
+
349
+ PowerShell:
350
+
351
+ ``` pwsh
352
+ > cd src\Microsoft.Data.SqlClient\tests\PerformanceTests
353
+ ```
354
+
355
+ Bash:
356
+
357
+ ``` bash
358
+ $ cd src/Microsoft.Data.SqlClient/tests/PerformanceTests
359
+ ```
360
+
361
+ ### Create Database
362
+
363
+ Create an empty database for the benchmarks to use. This example assumes
364
+ a local SQL server instance using SQL authentication:
345
365
346
366
``` bash
347
- cd src\M icrosoft.Data.SqlClient\t ests\P erformanceTests
348
- dotnet run -c Release -f net8.0
367
+ $ sqlcmd -S localhost -U sa -P password
368
+ 1> create database [sqlclient-perf-db]
369
+ 2> go
370
+ 1> quit
371
+ ```
372
+
373
+ The default ` runnerconfig.json ` expects a database named ` sqlclient-perf-db ` ,
374
+ but you may change the config to use any existing database. All tables in
375
+ the database will be dropped when running the benchmarks.
376
+
377
+ ### Configure Runner
378
+
379
+ Configure the benchmarks by editing the ` runnerconfig.json ` file directly in the
380
+ ` PerformanceTests ` directory with an appropriate connection string and benchmark
381
+ settings:
382
+
383
+ ``` json
384
+ {
385
+ "ConnectionString" : " Server=tcp:localhost; Integrated Security=true; Initial Catalog=sqlclient-perf-db;" ,
386
+ "UseManagedSniOnWindows" : false ,
387
+ "Benchmarks" :
388
+ {
389
+ "SqlConnectionRunnerConfig" :
390
+ {
391
+ "Enabled" : true ,
392
+ "LaunchCount" : 1 ,
393
+ "IterationCount" : 50 ,
394
+ "InvocationCount" :30 ,
395
+ "WarmupCount" : 5 ,
396
+ "RowCount" : 0
397
+ },
398
+ ...
399
+ }
400
+ }
349
401
```
350
402
351
- _ Only "** Release** Configuration" applies to Performance Tests_
403
+ Individual benchmarks may be enabled or disabled, and each has several
404
+ benchmarking options for fine tuning.
405
+
406
+ After making edits to ` runnerconfig.json ` you must perform a build which will
407
+ copy the file into the ` artifacts ` directory alongside the benchmark DLL. By
408
+ default, the benchmarks look for ` runnerconfig.json ` in the same directory as
409
+ the DLL.
410
+
411
+ Optionally, to avoid polluting your git workspace and requring a build after
412
+ each config change, copy ` runnerconfig.json ` to a new file, make your edits
413
+ there, and then specify the new file with the RUNNER_CONFIG environment
414
+ variable.
415
+
416
+ PowerShell:
417
+
418
+ ``` pwsh
419
+ > copy runnerconfig.json $HOME\.configs\runnerconfig.json
420
+
421
+ # Make edits to $HOME\.configs\runnerconfig.json
422
+
423
+ # You must set the RUNNER_CONFIG environment variable for the current shell.
424
+ > $env:RUNNER_CONFIG="${HOME}\.configs\runnerconfig.json"
425
+ ```
426
+
427
+ Bash:
428
+
429
+ ``` bash
430
+ $ cp runnerconfig.json ~ /.configs/runnerconfig.json
431
+
432
+ # Make edits to ~/.configs/runnerconfig.json
433
+
434
+ # Optionally export RUNNER_CONFIG.
435
+ $ export RUNNER_CONFIG=~ /.configs/runnerconfig.json
436
+ ```
437
+
438
+ ### Run Benchmarks
439
+
440
+ All benchmarks must be compiled and run in ** Release** configuration.
441
+
442
+ PowerShell:
443
+
444
+ ``` pwsh
445
+ > dotnet run -c Release -f net9.0
446
+ ```
447
+
448
+ Bash:
449
+
450
+ ``` bash
451
+ # Omit RUNNER_CONFIG if you exported it earlier, or if you're using the
452
+ # copy prepared by the build.
453
+ $ dotnet run -c Release -f net9.0
454
+
455
+ $ RUNNER_CONFIG=~ /.configs/runnerconfig.json dotnet run -c Release -f net9.0
456
+ ```
0 commit comments