From 6dffeb10fee9ade81fc68ffa65fe159d6eb91264 Mon Sep 17 00:00:00 2001 From: Bhukya Date: Mon, 16 Nov 2026 20:54:32 +0000 Subject: [PATCH 1/2] Test that bundles deploy the testing property of pipelines and show remote changes in bundle plan bundle deploy sends a pipeline's testing on Create and Edit, and bundle plan reads it back, so a change made outside the bundle shows in the plan and the next deploy undoes it. The Go SDK has the field, so the direct engine and the test server already handle it. This change adds the acceptance test for it. Co-authored-by: Isaac --- .../resources/pipelines/testing/output.txt | 112 ++++++++++++++++++ .../bundle/resources/pipelines/testing/script | 33 ++++++ 2 files changed, 145 insertions(+) diff --git a/acceptance/bundle/resources/pipelines/testing/output.txt b/acceptance/bundle/resources/pipelines/testing/output.txt index a1c2243b694..2fd4f720c15 100644 --- a/acceptance/bundle/resources/pipelines/testing/output.txt +++ b/acceptance/bundle/resources/pipelines/testing/output.txt @@ -18,3 +18,115 @@ } ] } + +=== Deploy sends testing, with the local wheel uploaded + +>>> [CLI] bundle deploy +Uploading dist/test_helpers-0.1-py3-none-any.whl... +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/pipeline-testing/default/files... +Created pipelines.orders +Files: 6 uploaded, 0 deleted +Resources: 1 created, 0 changed, 0 deleted, 0 unchanged + +>>> print_requests.py //api/2.0/pipelines --nostamp +{ + "method": "POST", + "path": "/api/2.0/pipelines", + "testing": { + "environment": { + "dependencies": [ + "-e /Workspace/Users/[USERNAME]/.bundle/pipeline-testing/default/files[test]", + "-r /Workspace/Users/[USERNAME]/.bundle/pipeline-testing/default/files/tests/requirements.txt", + "/Workspace/Users/[USERNAME]/.bundle/pipeline-testing/default/artifacts/.internal/test_helpers-0.1-py3-none-any.whl" + ] + }, + "sources": [ + { + "glob": { + "include": "/Workspace/Users/[USERNAME]/.bundle/pipeline-testing/default/files/tests/**" + } + } + ] + } +} + +=== No changes after the deploy + +>>> [CLI] bundle plan +Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged + +=== A remote edit that drops testing shows in the plan + +>>> [CLI] bundle plan -o json +"update" + +>>> [CLI] bundle deploy +Uploading dist/test_helpers-0.1-py3-none-any.whl... +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/pipeline-testing/default/files... +Updated pipelines.orders +Files: 1 uploaded, 0 deleted +Resources: 0 created, 1 changed, 0 deleted, 0 unchanged + +>>> [CLI] bundle plan +Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged + +=== Changing testing updates the pipeline + +>>> update_file.py databricks.yml ./tests/** ./tests/unit/** + +>>> [CLI] bundle plan +update pipelines.orders + +Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged + +>>> [CLI] bundle deploy +Uploading dist/test_helpers-0.1-py3-none-any.whl... +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/pipeline-testing/default/files... +Updated pipelines.orders +Files: 1 uploaded, 0 deleted +Resources: 0 created, 1 changed, 0 deleted, 0 unchanged + +>>> print_requests.py //api/2.0/pipelines --nostamp +{ + "method": "PUT", + "path": "/api/2.0/pipelines/[ORDERS_ID]", + "sources": [ + { + "glob": { + "include": "/Workspace/Users/[USERNAME]/.bundle/pipeline-testing/default/files/tests/unit/**" + } + } + ] +} + +=== Removing testing sends an update without it + +>>> [CLI] bundle plan +update pipelines.orders + +Plan: 0 to add, 1 to change, 0 to delete, 0 unchanged + +>>> [CLI] bundle deploy +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/pipeline-testing/default/files... +Updated pipelines.orders +Files: 1 uploaded, 0 deleted +Resources: 0 created, 1 changed, 0 deleted, 0 unchanged + +>>> print_requests.py //api/2.0/pipelines --nostamp +{ + "method": "PUT", + "path": "/api/2.0/pipelines/[ORDERS_ID]", + "testing": null +} + +>>> [CLI] bundle destroy --auto-approve +The following resources will be deleted: + delete resources.pipelines.orders + +This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the +Streaming Tables (STs) and Materialized Views (MVs) managed by them. Set 'cascade_on_destroy: false' on a pipeline to retain datasets on pipeline deletion: + delete resources.pipelines.orders + +All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/pipeline-testing/default + +Destroy: 1 deleted diff --git a/acceptance/bundle/resources/pipelines/testing/script b/acceptance/bundle/resources/pipelines/testing/script index e32724e5611..f3914bdfd48 100644 --- a/acceptance/bundle/resources/pipelines/testing/script +++ b/acceptance/bundle/resources/pipelines/testing/script @@ -1,2 +1,35 @@ title "Relative test paths resolve to the deployed workspace paths" trace $CLI bundle validate -o json | jq .resources.pipelines.orders.testing + +title "Deploy sends testing, with the local wheel uploaded" +trace $CLI bundle deploy +trace print_requests.py //api/2.0/pipelines --nostamp | jq '{method, path, testing: .body.testing}' + +title "No changes after the deploy" +trace $CLI bundle plan +rm "$OUT_REQUESTS" + +title "A remote edit that drops testing shows in the plan" +PIPELINE_ID=$(read_id.py orders) +MSYS_NO_PATHCONV=1 $CLI api get "/api/2.0/pipelines/$PIPELINE_ID" | jq '.spec | del(.testing)' > edit.json +MSYS_NO_PATHCONV=1 $CLI api put "/api/2.0/pipelines/$PIPELINE_ID" --json @edit.json &> LOG.edit +rm edit.json +trace $CLI bundle plan -o json | jq '.plan["resources.pipelines.orders"].changes.testing.action' +trace $CLI bundle deploy +trace $CLI bundle plan +rm "$OUT_REQUESTS" + +title "Changing testing updates the pipeline" +trace update_file.py databricks.yml './tests/**' './tests/unit/**' +trace $CLI bundle plan +trace $CLI bundle deploy +trace print_requests.py //api/2.0/pipelines --nostamp | jq '{method, path, sources: .body.testing.sources}' + +title "Removing testing sends an update without it" +update_file.py databricks.yml "$(sed -n '/^ testing:/,$p' databricks.yml)" "" +trace $CLI bundle plan +trace $CLI bundle deploy +trace print_requests.py //api/2.0/pipelines --nostamp | jq '{method, path, testing: .body.testing}' + +trace $CLI bundle destroy --auto-approve +rm "$OUT_REQUESTS" From 4a6101238cfc85eff2411beb8ac4b8df2280632e Mon Sep 17 00:00:00 2001 From: Bhukya Date: Mon, 16 Nov 2026 23:55:53 +0000 Subject: [PATCH 2/2] Check that the update without testing has no testing key The last step of the acceptance test now asserts that the request body has no testing key, instead of printing testing as null, which can also mean an explicit null. Co-authored-by: Isaac --- acceptance/bundle/resources/pipelines/testing/output.txt | 2 +- acceptance/bundle/resources/pipelines/testing/script | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/acceptance/bundle/resources/pipelines/testing/output.txt b/acceptance/bundle/resources/pipelines/testing/output.txt index 2fd4f720c15..3cccee04481 100644 --- a/acceptance/bundle/resources/pipelines/testing/output.txt +++ b/acceptance/bundle/resources/pipelines/testing/output.txt @@ -116,7 +116,7 @@ Resources: 0 created, 1 changed, 0 deleted, 0 unchanged { "method": "PUT", "path": "/api/2.0/pipelines/[ORDERS_ID]", - "testing": null + "has_testing": false } >>> [CLI] bundle destroy --auto-approve diff --git a/acceptance/bundle/resources/pipelines/testing/script b/acceptance/bundle/resources/pipelines/testing/script index f3914bdfd48..2c12917d00f 100644 --- a/acceptance/bundle/resources/pipelines/testing/script +++ b/acceptance/bundle/resources/pipelines/testing/script @@ -29,7 +29,7 @@ title "Removing testing sends an update without it" update_file.py databricks.yml "$(sed -n '/^ testing:/,$p' databricks.yml)" "" trace $CLI bundle plan trace $CLI bundle deploy -trace print_requests.py //api/2.0/pipelines --nostamp | jq '{method, path, testing: .body.testing}' +trace print_requests.py //api/2.0/pipelines --nostamp | jq '{method, path, has_testing: (.body | has("testing"))}' trace $CLI bundle destroy --auto-approve rm "$OUT_REQUESTS"