Skip to content

acc: run alerts/with_file locally#5651

Merged
pietern merged 3 commits into
mainfrom
local-alerts-with-file
Jun 22, 2026
Merged

acc: run alerts/with_file locally#5651
pietern merged 3 commits into
mainfrom
local-alerts-with-file

Conversation

@pietern

@pietern pietern commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

The alerts/with_file test exports the .dbalert.json file the backend materializes at an alert's parent_path and compares it against the local copy, a round-trip the in-process fake didn't reproduce, so the test only ran on cloud.

This teaches the testserver alerts handler to write that file on create/update and delete it on trash, plus the workspace-export envelope fix (shared with #5649) so databricks workspace export works locally.

This pull request and its description were written by Isaac.

The alerts/with_file acceptance test deploys an alert and exports the
.dbalert.json file the backend materializes at the alert's parent_path,
then diffs it against the local copy. The in-process testserver fake did
not reproduce this side effect, so the export returned nothing and the
test could only run on cloud.

Teach the alerts handler to write a .dbalert.json file on create/update
(reversing the line-joining in load_dbalert_files.go) and delete it on
trash, mirroring the backend. Also fix the workspace export handler to
return the SDK's base64 ExportResponse JSON when direct_download is not
set; previously it always returned raw bytes, which the SDK's
Workspace.Export (used by `databricks workspace export`) could not parse.

Byte-fidelity to the backend's exact serialization (float "2.0", forced
notify_on_ok, source-first field order) is not reproducible from the
parsed AlertV2 via the SDK marshaler, so the committed input file is
regenerated to the fake's deterministic output. The resulting output.txt
is byte-identical to the prior cloud recording.

Co-authored-by: Isaac
@pietern pietern temporarily deployed to test-trigger-is June 18, 2026 15:12 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is June 18, 2026 15:12 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 8199ad3

Run: 27938321308

Env 🟨​KNOWN 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 7 13 262 1012 5:28
🟨​ aws windows 1 6 2 13 262 1010 11:45
💚​ aws-ucws linux 7 13 358 926 6:12
💚​ aws-ucws windows 7 13 360 924 7:15
💚​ azure linux 1 15 265 1010 5:11
🔄​ azure windows 3 15 265 1008 8:21
💚​ azure-ucws linux 1 15 363 922 6:00
💚​ azure-ucws windows 1 15 365 920 7:45
💚​ gcp linux 1 15 261 1013 5:38
💚​ gcp windows 1 15 263 1011 7:48
24 interesting tests: 13 SKIP, 9 flaky, 1 RECOVERED, 1 KNOWN
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 💚​R 💚​R 💚​R 💚​R 💚​R 🔄​f 💚​R 💚​R 💚​R 💚​R
🔄​ TestAccept/bundle/destroy/jobs-and-pipeline ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p
🔄​ TestAccept/bundle/destroy/jobs-and-pipeline/DATABRICKS_BUNDLE_ENGINE=direct ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 🔄​f 💚​R 💚​R
🔄​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 🔄​f 💚​R 💚​R
🔄​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 💚​R 🔄​f 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 🔄​f 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 🟨​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/replace_existing 🙈​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_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/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestAccept/selftest/record_cloud/pipeline-crud ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🔄​ TestAccept/selftest/record_cloud/pipeline-crud/DATABRICKS_BUNDLE_ENGINE=terraform ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
Top 21 slowest tests (at least 2 minutes):
duration env testname
5:21 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:37 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:08 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:07 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:29 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:21 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:18 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:11 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:09 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:59 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:57 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:53 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:41 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:40 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:39 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:37 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:37 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:37 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:33 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:25 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:10 aws-ucws windows TestAccept

The backend re-serializes the .dbalert.json when materializing it in the
workspace (different key order, and numbers like 2.0 vs 2), so a byte-for-byte
diff against the local file fails on cloud. Restore the original alert.dbalert.json
and compare canonically (sorted keys, normalized numbers) instead. Verified
passing locally and on aws-prod-ucws for both engines.

Co-authored-by: Isaac
@pietern pietern temporarily deployed to test-trigger-is June 22, 2026 07:55 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is June 22, 2026 07:55 — with GitHub Actions Inactive
The script already removes the normalized files at the end, so they don't need
Ignore entries.

Co-authored-by: Isaac
@pietern pietern temporarily deployed to test-trigger-is June 22, 2026 08:02 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is June 22, 2026 08:02 — with GitHub Actions Inactive
@pietern pietern added this pull request to the merge queue Jun 22, 2026
Merged via the queue into main with commit fd50652 Jun 22, 2026
25 checks passed
@pietern pietern deleted the local-alerts-with-file branch June 22, 2026 12:09
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