acc: run alerts/with_file locally#5651
Merged
Merged
Conversation
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
Collaborator
Integration test reportCommit: 8199ad3
24 interesting tests: 13 SKIP, 9 flaky, 1 RECOVERED, 1 KNOWN
Top 21 slowest tests (at least 2 minutes):
|
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
The script already removes the normalized files at the end, so they don't need Ignore entries. Co-authored-by: Isaac
denik
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The alerts/with_file test exports the
.dbalert.jsonfile 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 exportworks locally.This pull request and its description were written by Isaac.