Skip to content

acc: Introduce phases; speed up "test-update" 2x.#4795

Open
denik wants to merge 11 commits intomainfrom
denik/test-phases
Open

acc: Introduce phases; speed up "test-update" 2x.#4795
denik wants to merge 11 commits intomainfrom
denik/test-phases

Conversation

@denik
Copy link
Contributor

@denik denik commented Mar 19, 2026

Changes

  • Introduce Phase field in test.toml that allows specifying order in which tests are run. All tests in Phase=0 are run before tests in Phase=1
  • Introduce 'inherit' tag on acceptance tests config fields that disables default inheritance of test configs. This is needed as Phase=1 is frequently applied on parent test.
  • Simplify acceptance test runner. Previously if there was a single entry for a given EnvMatrix, it would be omitted from the test name, e.g. TestAccept/bla/DATABRICKS_BUNDLE_ENGINE=direct would become TestAccept/bla if "direct" was the only option. Now we keep the full name (helps to see what variant is being run).

Why

We have tests that depend on output of other tests. Because of that "make test-update" has to "go test -update" twice. This is no longer needed, one update is enough.

Tests

Manually, by removing all output for local tests and running full update:

% git grep -l 'Local = true'  '**/out.test.toml' | find_out_files.py | wc -l
    2420
% git grep -l 'Local = true'  '**/out.test.toml' | find_out_files.py | xargs rm

@denik denik changed the title Run acceptance test in phases; speed up "test-update" 2x. acc: Introduce phases; speed up "test-update" 2x. Mar 19, 2026
@denik denik temporarily deployed to test-trigger-is March 19, 2026 15:09 — with GitHub Actions Inactive
@github-actions
Copy link

Suggested reviewers

Based on git history of the changed files, these people are best suited to review:

Confidence: high

Eligible reviewers

Based on CODEOWNERS, these people or teams could also review:

@andrewnester, @anton-107, @pietern, @simonfaltum

Suggestions based on git history of 14 changed files (5 scored). See CODEOWNERS for path-specific ownership rules.

@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Mar 19, 2026

Commit: cee9c0d

Run: 23305758763

Env 🟨​KNOWN 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 1 9 271 797 6:17
🟨​ aws windows 7 1 9 273 795 6:09
💚​ aws-ucws linux 8 9 369 712 7:43
💚​ aws-ucws windows 8 9 371 710 4:58
💚​ azure linux 2 11 274 795 5:22
💚​ azure windows 2 11 276 793 4:50
🔄​ azure-ucws linux 4 1 11 371 708 8:51
💚​ azure-ucws windows 2 11 376 706 6:17
💚​ gcp linux 2 11 270 798 5:24
💚​ gcp windows 2 11 272 796 7:07
20 interesting tests: 9 SKIP, 7 KNOWN, 4 flaky
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
🟨​ TestAccept 🟨​K 🟨​K 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🙈​ TestAccept/bundle/resources/postgres_branches/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/update_protected 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/without_branch_id 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_projects/update_display_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/synced_database_tables/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestAccept/ssh/connect-serverless-gpu 🙈​s 🙈​s ✅​p ✅​p 🙈​s 🙈​s 🔄​f ✅​p 🙈​s 🙈​s
🔄​ TestAccept/ssh/connect-serverless-gpu/DATABRICKS_BUNDLE_ENGINE=direct ✅​p ✅​p 🔄​f ✅​p
🔄​ TestAccept/ssh/connection 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 🔄​f 💚​R 💚​R 💚​R
🔄​ TestAccept/ssh/connection/DATABRICKS_BUNDLE_ENGINE=direct ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p
Top 20 slowest tests (at least 2 minutes):
duration env testname
4:09 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:14 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:12 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:09 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:05 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:59 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:55 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:50 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:46 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:40 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:38 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:38 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:37 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:35 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:30 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:21 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:20 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:13 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:12 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:10 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform

@denik denik temporarily deployed to test-trigger-is March 19, 2026 15:20 — with GitHub Actions Inactive
denik and others added 8 commits March 19, 2026 16:24
Add a non-inheritable Phase setting to test.toml so acceptance tests can wait for earlier phases before running, and mark the template and permissions tests that must run after phase 0.
Collect runnable acceptance tests up front so phase 0 runs immediately and phase 1 only starts after all phase 0 tests complete.
…aphore

- Remove runnableTest struct and phaseSemaphore in favor of sync.WaitGroup
  and a plain channel (phase1Gate)
- Keep all test logic inside t.Run callbacks (original structure)
- Phase=0 tests call phase0wg.Add(1) before t.Parallel() and t.Cleanup(phase0wg.Done)
  after all subtests complete; phase=1 tests block on <-phase1Gate
- Use t.Cleanup (not defer) so the gate opens only after all EnvMatrix
  subtests finish writing their output files
- Move CloudSlow→Cloud mutation out of getSkipReason to call site, before
  GenerateMaterializedConfig, so out.test.toml captures the implied value

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@denik denik force-pushed the denik/test-phases branch from 2c01e5d to 7e3e8e8 Compare March 19, 2026 15:24
@denik denik temporarily deployed to test-trigger-is March 19, 2026 15:24 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is March 19, 2026 15:27 — with GitHub Actions Inactive
…ashes on Windows

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@denik denik temporarily deployed to test-trigger-is March 19, 2026 15:42 — with GitHub Actions Inactive

// Execution phase for this test. Tests run in ascending phase order.
// Phase is not inherited from parent test.toml files. Default is 0.
Phase int `inherit:"false"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you copy the comment from the Makefile here?

Something along the lines of:

at the moment second pass is required because some tests show diff against output of another test for easier review

Makes it easier to understand why this is needed. An example would be nice too.

@denik denik enabled auto-merge March 19, 2026 16:36
@denik denik temporarily deployed to test-trigger-is March 19, 2026 16:37 — with GitHub Actions Inactive
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.

3 participants