Skip to content

Split integration tests into per-database CI workflows#2900

Merged
lahma merged 3 commits into
3.xfrom
parallel-databases
Mar 28, 2026
Merged

Split integration tests into per-database CI workflows#2900
lahma merged 3 commits into
3.xfrom
parallel-databases

Conversation

@lahma

@lahma lahma commented Mar 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Start only the testcontainer(s) needed for the specific database being tested, instead of spinning up all 6 containers on every integration test run
  • Add --database parameter to NUKE build (postgres, sqlserver, mysql, oracle, firebird, sqlite, basic, all)
  • Generate separate GitHub Actions PR workflow files per database, replacing the single monolithic pr-tests-integration workflow
  • Update testing dependencies

Changes

  • TestcontainersDatabaseEnvironment.csInitializeAsync() reads QUARTZ_TEST_DATABASE env var and conditionally starts only the needed container(s)
  • Build.cs — new Database parameter, IntegrationTest target sets env var and applies NUnit --filter by category
  • Build.CI.GitHubActions.csDatabaseIntegrationGitHubActionsAttribute generates per-database workflow files with --database param and QUARTZ_TEST_DATABASE env
  • Workflows — 7 new files (pr-integration-{basic,postgres,sqlserver,mysql,oracle,firebird,sqlite}.yml), old pr-tests-integration.yml removed

Test plan

  • Verify each per-database workflow triggers and runs only the corresponding container + tests
  • Verify basic workflow runs non-database tests with no containers started
  • Verify ./build.cmd IntegrationTest with no --database still starts all containers (backward compat)
  • Verify build.yml push workflow is unaffected

🤖 Generated with Claude Code

lahma and others added 2 commits March 28, 2026 09:47
Start only the testcontainer needed for the database being tested instead
of all 6 containers on every run. Add --database parameter to NUKE build
that controls which container starts and which NUnit category filter is
applied. Generate separate GitHub Actions workflow files per database
(postgres, sqlserver, mysql, oracle, firebird, sqlite, basic).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@lahma lahma added the port-main Requires porting to main branch label Mar 28, 2026
Comment thread .github/workflows/pr-integration-basic.yml Fixed
Comment thread .github/workflows/pr-integration-firebird.yml Fixed
Comment thread .github/workflows/pr-integration-mysql.yml Fixed
Comment thread .github/workflows/pr-integration-oracle.yml Fixed
Comment thread .github/workflows/pr-integration-postgres.yml Fixed
Comment thread .github/workflows/pr-integration-sqlite.yml Fixed
Comment thread .github/workflows/pr-integration-sqlserver.yml Fixed
Comment thread .github/workflows/pr-tests-unit.yml Fixed
Comment thread .github/workflows/pr-tests-unit.yml Fixed
Comment thread .github/workflows/pr-tests-unit.yml Fixed
@lahma
lahma changed the base branch from main to 3.x March 28, 2026 08:03
Set ReadPermissions on all workflow attributes to satisfy GitHub
code scanning security requirements.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@lahma
lahma merged commit 093f35f into 3.x Mar 28, 2026
13 of 15 checks passed
@lahma
lahma deleted the parallel-databases branch March 28, 2026 08:22
lahma added a commit that referenced this pull request Mar 28, 2026
Port of 3.x parallel-databases change to main. Start only the
testcontainer needed for the database being tested instead of all 6
containers on every run. Add --database parameter to NUKE build that
controls which container starts and which NUnit category filter is
applied. Generate separate GitHub Actions workflow files per database.

Also update testing dependencies (Testcontainers 4.11.0,
Microsoft.Data.SqlClient 6.0.1, NUnit3TestAdapter 6.2.0, etc).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@lahma lahma removed the port-main Requires porting to main branch label Mar 28, 2026
lahma added a commit that referenced this pull request Mar 28, 2026
* Split integration tests into per-database CI workflows (#2900)

Port of 3.x parallel-databases change to main. Start only the
testcontainer needed for the database being tested instead of all 6
containers on every run. Add --database parameter to NUKE build that
controls which container starts and which NUnit category filter is
applied. Generate separate GitHub Actions workflow files per database.

Also update testing dependencies (Testcontainers 4.11.0,
Microsoft.Data.SqlClient 6.0.1, NUnit3TestAdapter 6.2.0, etc).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* Fix DeleteNonExistsJobTest using wrong data source name

The test hardcoded DBName = "default" but DatabaseHelper registers data
sources as "default-postgres" or "default-sqlserver". This was masked
when all tests ran together because other tests happened to register a
"default" data source first. With per-database filtering, this test runs
in isolation and the bug is exposed.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
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.

2 participants