Skip to content

Split MSSQL integration tests into parallel pipeline jobs and remove MSSQL category from generic unit tests#3245

Open
aaronburtle wants to merge 13 commits intomainfrom
dev/aaronburtle/FactorOutGenericTestsfromMSSQLPipeline
Open

Split MSSQL integration tests into parallel pipeline jobs and remove MSSQL category from generic unit tests#3245
aaronburtle wants to merge 13 commits intomainfrom
dev/aaronburtle/FactorOutGenericTestsfromMSSQLPipeline

Conversation

@aaronburtle
Copy link
Contributor

@aaronburtle aaronburtle commented Mar 12, 2026

Why make this change?

Closes #3244

What is this change?

This PR makes two changes to improve MSSQL integration test pipeline performance:

  1. Removed TestCategory(TestCategory.MSSQL) from 5 unit test files that are not MSSQL-specific. These tests do not require a database and should run in the unit test pipeline instead:

    • RequestValidatorUnitTests.cs
    • EntitySourceNamesParserUnitTests.cs
    • RequestContextUnitTests.cs
    • RestServiceUnitTests.cs
    • RuntimeConfigLoaderJsonDeserializerTests.cs
  2. Split the single Windows MSSQL integration test job into 2 parallel jobs to reduce execution time:

    • Windows - Combined Integration Tests: GraphQL, REST, Unit, HotReload, OpenApi, Authorization, Telemetry, and Caching tests (1,246 tests). SqlTestBase-inheriting tests (GraphQL, REST) naturally create the DB schema for the co-located tests.

    • Window - Configuration Tests: Pure ConfigurationTests (207 tests). Since this job has no SqlTestBase tests, a System.Data.SqlClient-based schema initialization step creates the DB schema before test execution.

A new reusable step template mssql-test-steps.yml avoids duplicating the ~130 lines of shared setup (NuGet auth, .NET SDK, LocalDB install/start, build, test, coverage publish) across the 2 jobs. It includes an optional initDbSchema parameter for jobs that need explicit schema creation.

How was this tested?

Run against the pipeline.

@aaronburtle
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@aaronburtle
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@aaronburtle
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@aaronburtle
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@aaronburtle
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@aaronburtle
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@aaronburtle
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@aaronburtle aaronburtle marked this pull request as ready for review March 14, 2026 00:00
Copilot AI review requested due to automatic review settings March 14, 2026 00:00
@aaronburtle
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts test categorization and the MSSQL Azure Pipelines setup so unit tests run in the “Unit Tests” pipeline (instead of the MSSQL integration pipeline) and MSSQL integration tests are split into parallel Windows jobs using a shared steps template.

Changes:

  • Removed TestCategory(TestCategory.MSSQL) from several DB-independent unit test classes so they run under the general unit-test pipeline filter.
  • Refactored .pipelines/mssql-pipelines.yml to run two parallel Windows jobs (windows_combined and windows_configuration) using a new shared template.
  • Added .pipelines/templates/mssql-test-steps.yml to centralize common MSSQL test-job steps (LocalDB setup, build, config generation, test execution, coverage, and artifact publishing).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Service.Tests/UnitTests/RuntimeConfigLoaderJsonDeserializerTests.cs Removes MSSQL test category so these are treated as general unit tests.
src/Service.Tests/UnitTests/RestServiceUnitTests.cs Removes MSSQL test category so these are treated as general unit tests.
src/Service.Tests/UnitTests/RequestValidatorUnitTests.cs Removes MSSQL test category so these are treated as general unit tests.
src/Service.Tests/UnitTests/RequestContextUnitTests.cs Removes MSSQL test category so these are treated as general unit tests.
src/Service.Tests/UnitTests/EntitySourceNamesParserUnitTests.cs Removes MSSQL test category so these are treated as general unit tests.
.pipelines/templates/mssql-test-steps.yml Introduces reusable MSSQL job steps template (but currently has a failure-artifact publishing logic bug).
.pipelines/mssql-pipelines.yml Splits Windows MSSQL integration tests into two parallel jobs using the shared template.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@aaronburtle
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix MSSQL Integration Test timeout

2 participants