Skip to content

Conversation

@denik
Copy link
Contributor

@denik denik commented Jan 19, 2026

Changes

Add a new kind of test - invariant test for DABs (a subtype of acceptance test).

Invariant tests are acceptance tests that can be run against many configs to check for certain properties.
Unlike regular acceptance tests full output is not recorded, unless the condition is not met.

In this PR there is one invariant test added - no_drift, that checks that there are no actions planned after successful deploy. If that's not the case, the test will dump full JSON plan to the output.

Why

Simplify resource implementation testing - implementors only need to provide a config to get all invariants check.

With no_drift in particular, we've had several cases where this condition is not met and it's still the case for some configurations of permissions and grants. It's also going to become more important as we replace "server_side_default" with something more precise.

The other use of invariant tests is fuzzing - since they work on any config, they can be used on randomly generated configs to find bugs.

@eng-dev-ecosystem-bot
Copy link
Collaborator

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

Commit: 73a1501

Run: 21247404414

Env 🟨​KNOWN 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 1 1 6 410 694 28:56
🟨​ aws windows 7 1 6 413 692 25:19
💚​ azure linux 2 8 411 693 22:50
💚​ azure windows 2 8 413 691 27:13
💚​ gcp linux 2 8 400 699 27:57
💚​ gcp windows 2 8 402 697 26:23
15 interesting tests: 7 KNOWN, 6 SKIP, 1 RECOVERED, 1 flaky
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
🟨​ TestAccept 🟨​K 🟨​K 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/deployment/bind/alert 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/generate/alert 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/alerts/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/alerts/with_file 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 🟨​K 🟨​K 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 🟨​K 🟨​K 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K
🙈​ TestAccept/bundle/resources/synced_database_tables/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/ssh/connection 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🔄​ TestFetchRepositoryInfoAPI_FromRepo 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p
Top 28 slowest tests (at least 2 minutes):
duration env testname
7:43 aws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
7:38 aws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:54 azure windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:43 azure windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:39 gcp windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:16 gcp linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
4:57 gcp linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
3:34 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:20 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:17 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:11 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:11 azure linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
2:55 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:42 gcp windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
2:40 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:19 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:16 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:14 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:13 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:12 aws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
2:11 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:10 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:09 gcp linux TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=no/PY=no/READPLAN=
2:05 gcp windows TestAccept/bundle/resources/dashboards/change-serialized-dashboard/DATABRICKS_BUNDLE_ENGINE=direct
2:04 aws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
2:02 azure linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
2:02 gcp linux TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct/DLT=no/NBOOK=yes/PY=yes/READPLAN=1
2:01 gcp linux TestAccept/bundle/resources/experiments/basic/DATABRICKS_BUNDLE_ENGINE=direct

@denik denik temporarily deployed to test-trigger-is January 20, 2026 10:11 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is January 20, 2026 10:50 — with GitHub Actions Inactive
@denik denik force-pushed the denik/invariant-tests branch from 63ee262 to a195594 Compare January 20, 2026 12:02
@denik denik temporarily deployed to test-trigger-is January 20, 2026 12:02 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is January 20, 2026 15:40 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is January 20, 2026 16:37 — with GitHub Actions Inactive
no_drift test checks that there are no actions planned after successful deploy. If that's not the case, the
test will dump full JSON plan to the output.

In order to add a new test, add a config to configs/ and include it in test.toml.
Copy link
Contributor

Choose a reason for hiding this comment

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

The ones in this PR are specific to bundles. Will they generalize? If not, they can be moved the bundles dir.

@@ -0,0 +1,39 @@
#!/usr/bin/env python3
"""
Check that all actions in plan are "skip".
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe verify_no_drift.py?

foo:
warehouse_id: $TEST_DEFAULT_WAREHOUSE_ID
display_name: test-alert-$UNIQUE_NAME
file_path: ./alert.dbalert.json
Copy link
Contributor

Choose a reason for hiding this comment

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

@shreyas-goenka Do we need one with the alert inlined?

cat LOG.deploy | contains.py '!panic' '!internal error' > /dev/null

# Special message to fuzzer that generated config was fine.
# Any failures after this point will be considered as "bug detected" by fuzzer.
Copy link
Contributor

Choose a reason for hiding this comment

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

Fuzzer == vary over input configs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

@denik denik force-pushed the denik/invariant-tests branch from 39b9307 to 3de7df5 Compare January 21, 2026 13:25
@denik denik temporarily deployed to test-trigger-is January 21, 2026 13:26 — with GitHub Actions Inactive
denik and others added 14 commits January 22, 2026 12:25
Add 9 minimal resource configuration templates to test the no-drift invariant
across different resource types (jobs, pipelines, experiments, models, volumes,
schemas, clusters, model serving endpoints).

Changes:
- Add configs/ directory with minimal .yml.tmpl files for each resource type
- Add data/ directory for supporting files (pipeline.py)
- Update no_drift/script to copy data files at test start
- Update test.toml to include new configs and ignore *.py files
- Update out.test.toml with expanded config matrix

All configs tested and verified on both testserver and AWS cloud with direct
and terraform deployment engines.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add 4 more resource configurations to the no_drift invariant test, bringing
the total to 13 working configs.

New configs:
- alerts (with .dbalert.json file)
- dashboards (with .lvdash.json file)
- apps (with source_code_path directory)
- secret_scopes

Also created sql_warehouse.yml.tmpl but excluded from test due to drift issues.

Changes:
- Add 5 new config templates in configs/
- Add 3 new data files in data/ (alert.dbalert.json, dashboard.lvdash.json, app/)
- Update test.toml to include new configs and ignore *.json and app directory
- Update out.test.toml with expanded config matrix

All 13 configs tested on testserver with both direct and terraform engines.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Complete the no_drift invariant test coverage by adding the remaining
resource types, bringing the total to 17 working configs.

New configs:
- quality_monitor (with dependent schema)
- database_instance
- database_catalog (with dependent database_instance)
- synced_database_table (with dependent instance and catalog)

Changes:
- Add 3 new config templates in configs/
- Fix quality_monitor to use $CURRENT_USER_NAME
- Update test.toml with 4 additional configs
- Update out.test.toml with full config matrix

All 17 configs tested successfully on testserver with both direct and
terraform deployment engines, showing zero drift after deploy.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
App names must be between 2-30 characters. Changed from 'test-app-'
to 'app-' to fit within the limit.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@denik denik force-pushed the denik/invariant-tests branch from 3de7df5 to 10b8a2f Compare January 22, 2026 11:26
@denik denik temporarily deployed to test-trigger-is January 22, 2026 11:26 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is January 22, 2026 11:31 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is January 22, 2026 11:45 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is January 22, 2026 11:51 — with GitHub Actions Inactive
@denik denik enabled auto-merge January 22, 2026 11:51
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.

4 participants