Skip to content

acc: correct Badness in bundle/resources tests - #7919

Merged
denik merged 2 commits into
mainfrom
badness-resources
Nov 24, 2026
Merged

denik merged 2 commits into
mainfrom
badness-resources

Conversation

@denik

@denik denik commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Correct the Badness notes in acceptance/bundle/resources tests so they match what the expected output records today. This is a one-time scan of existing tests; only test.toml lines change, no outputs.

Badness is meant to say what is wrong in the recorded output and what the right behavior would be. Some notes described problems that are already fixed, problems of the removed Terraform engine, or how the test is set up.

Removed (the output now shows correct behavior):

  • dashboards/nested-folders: deploy succeeds and lakeview get returns "lifecycle_state": "ACTIVE".
  • jobs/on_failure_empty_slice: no permanent drift left; the plan after deploy only has "email_notifications.on_failure": {"action": "skip", "reason": "empty"}.
  • permissions/target_permissions: not a bug. The target's CAN_MANAGE is for the deploying user and is upgraded to "permission_level": "IS_OWNER" on purpose. The terraform/direct comparison no longer applies (Remove the terraform engine from the acceptance CI matrix #6877).
  • pipelines/zero-value-fields: Terraform-only. The request now has "continuous": false, "development": false, "photon": false, "serverless": false.
  • postgres_endpoints/recreate: Terraform-only; direct prints Recreated postgres_endpoints.my_endpoint. The test.toml held only Badness, so it is deleted.
  • postgres_roles/recreate-postgres-role: Terraform-only; direct plans recreate postgres_roles.my_role. The test.toml held only Badness, so it is deleted.

Updated (accurate but stale or vague):

  • catalogs/rename_out_of_band, catalogs/rename_all_out_of_band: dropped the PR-time "Same on main."; now says what destroy leaves behind (Destroy: 0 deleted) and what should happen.
  • schemas/destroy_after_rename_out_of_band, schemas/foreign_at_recorded_name: dropped "Same on main."; added the right behavior (look the schema up by schema_id).
  • pipelines/num-workers-zero: the config never sets num_workers. The note now says that a single-node pipeline cluster is created without num_workers, while clusters and job clusters get num_workers: 0. It no longer mentions Terraform.
  • postgres_projects/add_default_endpoint_settings: removed the Terraform comparison from the Badness and from the test.toml and script comments, since no output shows it any more. Kept the failure: Field 'spec.default_endpoint_settings.suspension' is in update_mask but not provided in request.
  • postgres_roles/inherited-role-conflict: removed the Badness. Roles already support replace_existing, and the sibling replace_existing test takes the role over, so the conflict without it is expected. A comment now points to replace_existing and inherited-role-bind.
  • synced_database_tables/basic: now quotes the unresolved name: Name: ${resources.database_catalogs.my_catalog.name}.${...database_name}.my_synced_table.
  • vector_search_endpoints/update/target_qps: said min_qps, but the test changes target_qps. The note now quotes update vector_search_endpoints.my_endpoint.permissions (a PUT of the same ACL).
  • vector_search_indexes/recreate/with_endpoint: dropped the follow-up plan and added the right behavior (recreate the index together with its endpoint).

Added (the output records bad behavior with no note):

  • catalogs/auto-approve: Error: cannot plan resources.schemas.foo: cannot resolve "${resources.catalogs.bar.name}": internal error: resources.catalogs.bar: action is "delete" missing new_state. This is an internal error, it comes after the files are uploaded, and the --auto-approve prompt the test is for is never reached.
  • experiments/basic: adding a tag is silently ignored (Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged, and k2 never shows up).
  • models/basic: same for model tags; the model keeps only key1.
  • materialization_sets/settled_failure: without deployment-history recording, destroy prints Destroy: 3 deleted while the set is still in the workspace.

Kept as accurate: clusters/libraries-content-change, dashboards/publish-failure-stale-content, grants/schemas/remove_all, job_runs/interrupted_run, jobs/whole-block-overlap, postgres_data_apis/update, postgres_endpoints/remove_suspend_timeout, postgres_projects/remove_history_retention, secrets/remove-expire-time, vector_search_endpoints/drift/recreated_same_name.

Why

Stale or vague Badness misleads readers and hides which tests record real bugs.

Tests

All touched tests pass locally (Badness does not affect how a test runs). Only test.toml changes; no outputs change.

Dashboard: none. This does not fix a failing test or error.

AI agent (opus5.5, isaac_claude)

This pull request and its description were written by Isaac.

Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions github-actions Bot added DABs DABs related issues test-only-fix PRs that update failing of flaky tests without changing CLI code. labels Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Commit: c8e197027 | Workflow run

Regression test report

Selected 20 changed tests (limit=20, 0 not selected)

39 tests: regression=0 unreleased=0 coverage=39 failing=0
test branch main (7e4cb7c) latest (v1.28.0)
TestAccept/bundle/resources/catalogs/auto-approve/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/catalogs/auto-approve/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/catalogs/rename_all_out_of_band/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/catalogs/rename_all_out_of_band/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/catalogs/rename_out_of_band/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/catalogs/rename_out_of_band/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/dashboards/nested-folders/DMS=/READPLAN= ✅ ✅ ✅
TestAccept/bundle/resources/dashboards/nested-folders/DMS=/READPLAN=1 ✅ ✅ ✅
TestAccept/bundle/resources/dashboards/nested-folders/DMS=true/READPLAN= ✅ ✅ ✅
TestAccept/bundle/resources/dashboards/nested-folders/DMS=true/READPLAN=1 ✅ ✅ ✅
TestAccept/bundle/resources/experiments/basic/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/experiments/basic/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/jobs/on_failure_empty_slice/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/jobs/on_failure_empty_slice/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/materialization_sets/settled_failure/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/models/basic/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/models/basic/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/permissions/target_permissions/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/permissions/target_permissions/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/pipelines/num-workers-zero/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/pipelines/num-workers-zero/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/pipelines/zero-value-fields/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/pipelines/zero-value-fields/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/postgres_endpoints/recreate/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/postgres_endpoints/recreate/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/postgres_projects/add_default_endpoint_settings/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/postgres_projects/add_default_endpoint_settings/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/postgres_roles/inherited-role-conflict/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/postgres_roles/inherited-role-conflict/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/postgres_roles/recreate-postgres-role/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/postgres_roles/recreate-postgres-role/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/schemas/destroy_after_rename_out_of_band/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/schemas/destroy_after_rename_out_of_band/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/schemas/foreign_at_recorded_name/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/schemas/foreign_at_recorded_name/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/synced_database_tables/basic/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/synced_database_tables/basic/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/vector_search_endpoints/update/target_qps/DMS=true ✅ ✅ ✅
TestAccept/bundle/resources/vector_search_indexes/recreate/with_endpoint/DMS= ✅ ✅ ✅

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: c8e1970

Run: 45430896921

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 310 27 6:58
💚​ aws-windows-latest-4core-16gb 1 312 25 7:01
💚​ azure linux-2core-8gb 1 309 27 7:39
💚​ azure-windows-latest-4core-16gb 1 311 25 6:56
💚​ gcp linux-2core-8gb 1 307 28 6:51
💚​ gcp-windows-latest-4core-16gb 1 309 26 6:34
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 6 slowest tests (at least 2 minutes):
duration env testname
4:09 aws linux-2core-8gb TestAccept
4:08 azure linux-2core-8gb TestAccept
3:56 gcp linux-2core-8gb TestAccept
3:50 aws-windows-latest-4core-16gb TestAccept
3:39 gcp-windows-latest-4core-16gb TestAccept
3:13 azure-windows-latest-4core-16gb TestAccept

@denik
denik marked this pull request as ready for review November 24, 2026 14:09
@denik
denik requested review from a team as code owners November 24, 2026 14:09

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated review at 4eada86. Each finding was verified against the code.

No blocking issues found. 2 non-blocking comment(s) and 1 question(s) below.

This PR rewrites the Badness notes in acceptance/bundle/resources tests so they match the recorded outputs: it removes notes for bugs that are fixed or only affected Terraform, sharpens vague ones, and adds notes where an output shows bad behavior. The edits I checked agree with their goldens. Two leftovers still mention Terraform even though the PR drops those comparisons elsewhere. Separately, the new experiment and model tag notes clash with the test titles and the configs, which both call the ignored tag intended.

Questions

  1. The new Badness in experiments/basic and models/basic calls the ignored tag change a bug. But configs/experiments.yml and configs/models.yml skip tags on purpose (terraform_compat, and "we might reasonably choose to not fix it" for models), and the script titles say "adding a new tag should be a no-op". Is the no-op meant to count as a bug now? If so, should the titles and config comments change to match? If not, should these two notes be dropped? (non-blocking)

@@ -5,4 +5,4 @@ RecordRequests = false
# 400 there (tolerated by errcode), while terraform masks the leaf and succeeds. Runs

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] The Badness no longer compares against Terraform, but the comment above it still says "terraform masks the leaf and succeeds" and "Runs on both engines; the divergent plan/deploy are routed to per-engine files". The script writes a single out.deploy.txt. The script comments at lines 14-16 and 19-23 make the same Terraform claim. Can you trim these in the same pass, so the file doesn't contradict its own Badness?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in c8e1970. I trimmed the Terraform and per-engine claims from the test.toml comment and from both script comments. The test now only says that the deploy is expected to 400.

AI agent (opus5.5, isaac_claude)

@@ -1,3 +1,3 @@
Badness = "num_workers value 0 is not sent in the direct deployment"
Badness = "A pipeline cluster with neither num_workers nor autoscale (single node) is created without num_workers in the request. Direct force-sends num_workers: 0 for clusters and job clusters (and the terraform engine sent it for pipeline clusters too), but not for pipeline clusters; it should send num_workers: 0 here as well."

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] "(and the terraform engine sent it for pipeline clusters too)" is a claim nothing in this test records. out.requests.txt has only the direct POST, and this PR removes this kind of comparison from zero-value-fields, the postgres recreate tests and add_default_endpoint_settings. Can you drop the clause so the notes follow one rule?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in c8e1970: dropped the terraform clause.

AI agent (opus5.5, isaac_claude)

@@ -1,5 +1,5 @@
RecordRequests = false
Badness = "Reproduces the conflict a bundle hits when it declares a Postgres role that already exists on the branch — the situation on a child branch, which inherits the parent's roles at creation (verified on dogfood 2026-06-10). The bundle plans to create the role and the API rejects it with HTTP 400 'role with that name already exists'. This is the intended interim behavior: until a replace_existing flag lets a bundle take explicit ownership of an existing role, the supported escape hatch is `bundle deployment bind` (see the inherited-role-bind test). The testserver does not model branch role inheritance, so the pre-existing role is staged via `bundle deployment unbind`; the test is therefore local-only."
Badness = "A bundle that declares a Postgres role which already exists on the branch (as on a child branch, which inherits its parent's roles) plans a create, and deploy fails with 400 'role with that name already exists'. The only way out is `bundle deployment bind` (see inherited-role-bind); the bundle should be able to take over the existing role, e.g. with a replace_existing option."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This note asks for a replace_existing option, but roles already have one and the sibling test with that name takes over the role. Should the note be removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed, removed in c8e1970. replace_existing already exists and the sibling replace_existing test takes the role over, so the conflict without it is expected. In its place there's a short comment pointing to replace_existing and inherited-role-bind. I also dropped the stale engine-wording comment at the bottom of the file.

AI agent (opus5.5, isaac_claude)

The replace_existing sibling test shows roles already support taking over
an existing role, so the conflict without it is expected.

Co-authored-by: Isaac <no-reply@databricks.com>
@denik

denik commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Re the review-oss-bot question on experiments/basic and models/basic: I'm keeping both notes. The configs skip tags for terraform_compat, and models.yml says "we might reasonably choose to not fix it". Those comments describe a known limitation that may never be fixed. They don't argue the behavior is right. For a user, a tag added in config silently never reaches the resource, and the plan says nothing. That's exactly what Badness is for, and both notes already ask for the change to be applied or at least reported. The "should be a no-op" titles describe what the test records today. Happy to drop the notes if owners consider this intended.

AI agent (opus5.5, isaac_claude)

@denik
denik requested a review from andrewnester November 24, 2026 15:57
@denik
denik added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 746977e Nov 24, 2026
27 checks passed
@denik
denik deleted the badness-resources branch November 24, 2026 16:36
denik added a commit that referenced this pull request Nov 25, 2026
settled_failure/test.toml: #7919 added a Badness for the bug this PR fixes;
keep this branch's version, which drops it with the DMS pin.

Co-authored-by: Isaac <no-reply@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues factory-generated test-only-fix PRs that update failing of flaky tests without changing CLI code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants