Repository navigation
Translate the testing paths of pipelines and upload local test wheels #7437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tharunbhuk-db
merged 2 commits into
tharun/pipelines-test-b1-editable-folder
from
tharun/pipelines-test-b3-testing-paths
Nov 18, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
acceptance/bundle/resources/pipelines/testing-dynamic-version/databricks.yml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| bundle: | ||
| name: pipeline-testing-dynamic-version | ||
|
|
||
| artifacts: | ||
| other_test_code: | ||
| type: whl | ||
| files: | ||
| - source: dist/other_test_code-0.0.1-py3-none-any.whl | ||
| dynamic_version: true | ||
|
|
||
| resources: | ||
| pipelines: | ||
| orders: | ||
| name: orders | ||
| libraries: | ||
| - glob: | ||
| include: ./transformations/** | ||
| testing: | ||
| sources: | ||
| - glob: | ||
| include: ./tests/** | ||
| environment: | ||
| dependencies: | ||
| - ./dist/other_test_code-0.0.1-py3-none-any.whl | ||
| - ./dist/other_test_code-0.0.1-py3-none-any.whl[test] |
Binary file added
BIN
+1.85 KB
...e/resources/pipelines/testing-dynamic-version/dist/other_test_code-0.0.1-py3-none-any.whl
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
acceptance/bundle/resources/pipelines/testing-dynamic-version/out.test.toml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Cloud = false | ||
| EnvMatrix.DMS = ["", "true"] |
27 changes: 27 additions & 0 deletions
27
acceptance/bundle/resources/pipelines/testing-dynamic-version/output.txt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
|
|
||
| === Test dependencies use the patched wheel, with extras kept | ||
|
|
||
| >>> [CLI] bundle deploy | ||
| Uploading .databricks/bundle/default/patched_wheels/other_test_code_other_test_code/other_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl... | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/pipeline-testing-dynamic-version/default/files... | ||
| Created pipelines.orders | ||
| Files: 4 uploaded, 0 deleted | ||
| Resources: 1 created, 0 changed, 0 deleted, 0 unchanged | ||
|
|
||
| >>> print_requests.py //api/2.0/pipelines --nostamp | ||
| [ | ||
| "/Workspace/Users/[USERNAME]/.bundle/pipeline-testing-dynamic-version/default/artifacts/.internal/other_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl", | ||
| "/Workspace/Users/[USERNAME]/.bundle/pipeline-testing-dynamic-version/default/artifacts/.internal/other_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl[test]" | ||
| ] | ||
|
|
||
| >>> [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-dynamic-version/default | ||
|
|
||
| Destroy: 1 deleted |
6 changes: 6 additions & 0 deletions
6
acceptance/bundle/resources/pipelines/testing-dynamic-version/script
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
|
|
||
| title "Test dependencies use the patched wheel, with extras kept" | ||
| trace $CLI bundle deploy | ||
| trace print_requests.py //api/2.0/pipelines --nostamp | jq '.body.testing.environment.dependencies' | ||
| trace $CLI bundle destroy --auto-approve | ||
| rm "$OUT_REQUESTS" |
4 changes: 4 additions & 0 deletions
4
acceptance/bundle/resources/pipelines/testing-dynamic-version/test.toml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Runs only against the local test server. | ||
| Cloud = false | ||
| RecordRequests = true | ||
| Ignore = [".databricks"] |
2 changes: 2 additions & 0 deletions
2
acceptance/bundle/resources/pipelines/testing-dynamic-version/tests/test_orders.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| def test_orders(): | ||
| pass |
1 change: 1 addition & 0 deletions
1
acceptance/bundle/resources/pipelines/testing-dynamic-version/transformations/orders.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from pyspark import pipelines as dp |
21 changes: 21 additions & 0 deletions
21
acceptance/bundle/resources/pipelines/testing-same-name-libraries/databricks.yml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| bundle: | ||
| name: pipeline-testing-same-name-libraries | ||
|
|
||
| resources: | ||
| pipelines: | ||
| orders: | ||
| name: orders | ||
| libraries: | ||
| - file: | ||
| path: ./transformations/orders.py | ||
| environment: | ||
| dependencies: | ||
| - ./pipeline/test_helpers-0.1-py3-none-any.whl | ||
| testing: | ||
| sources: | ||
| - glob: | ||
| include: ./tests/** | ||
| environment: | ||
| dependencies: | ||
| # A different wheel with the same file name would be uploaded to the same path. | ||
| - ./tests/test_helpers-0.1-py3-none-any.whl |
2 changes: 2 additions & 0 deletions
2
acceptance/bundle/resources/pipelines/testing-same-name-libraries/out.test.toml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Cloud = false | ||
| EnvMatrix.DMS = ["", "true"] |
10 changes: 10 additions & 0 deletions
10
acceptance/bundle/resources/pipelines/testing-same-name-libraries/output.txt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| >>> musterr [CLI] bundle deploy | ||
| Error: Duplicate local library names: test_helpers-0.1-py3-none-any.whl | ||
| at resources.pipelines.orders.environment.dependencies[0] | ||
| resources.pipelines.orders.testing.environment.dependencies[0] | ||
| in databricks.yml:13:13 | ||
| databricks.yml:21:15 | ||
|
|
||
| Local library names must be unique but found libraries with the same name: pipeline/test_helpers-0.1-py3-none-any.whl, tests/test_helpers-0.1-py3-none-any.whl | ||
|
|
Empty file.
1 change: 1 addition & 0 deletions
1
acceptance/bundle/resources/pipelines/testing-same-name-libraries/script
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| trace musterr $CLI bundle deploy |
6 changes: 6 additions & 0 deletions
6
acceptance/bundle/resources/pipelines/testing-same-name-libraries/test.toml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Runs only against the local test server. | ||
| Cloud = false | ||
|
|
||
| [[Repls]] | ||
| Old = '\\' | ||
| New = '/' |
Empty file.
2 changes: 2 additions & 0 deletions
2
acceptance/bundle/resources/pipelines/testing-same-name-libraries/tests/test_orders.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| def test_orders(): | ||
| pass |
1 change: 1 addition & 0 deletions
1
acceptance/bundle/resources/pipelines/testing-same-name-libraries/transformations/orders.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| x = 1 |
19 changes: 19 additions & 0 deletions
19
acceptance/bundle/resources/pipelines/testing/databricks.yml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| bundle: | ||
| name: pipeline-testing | ||
|
|
||
| resources: | ||
| pipelines: | ||
| orders: | ||
| name: orders | ||
| libraries: | ||
| - glob: | ||
| include: ./transformations/** | ||
| testing: | ||
| sources: | ||
| - glob: | ||
| include: ./tests/** | ||
| environment: | ||
| dependencies: | ||
| - -e .[test] | ||
| - -r ./tests/requirements.txt | ||
| - ./dist/*.whl |
Empty file.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Cloud = false | ||
| EnvMatrix.DMS = ["", "true"] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
|
|
||
| === Relative test paths resolve to the deployed workspace paths | ||
|
|
||
| >>> [CLI] bundle validate -o json | ||
| { | ||
| "environment": { | ||
| "dependencies": [ | ||
| "-e /Workspace/Users/[USERNAME]/.bundle/pipeline-testing/default/files[test]", | ||
| "-r /Workspace/Users/[USERNAME]/.bundle/pipeline-testing/default/files/tests/requirements.txt", | ||
| "./dist/*.whl" | ||
| ] | ||
| }, | ||
| "sources": [ | ||
| { | ||
| "glob": { | ||
| "include": "/Workspace/Users/[USERNAME]/.bundle/pipeline-testing/default/files/tests/**" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| === 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/**" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
|
|
||
| >>> [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 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| [project] | ||
| name = "orders" | ||
| version = "0.1" | ||
|
|
||
| [project.optional-dependencies] | ||
| test = ["faker"] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| 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}' | ||
|
|
||
| trace $CLI bundle destroy --auto-approve | ||
| rm "$OUT_REQUESTS" | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Runs only against the local test server. | ||
| Cloud = false | ||
| RecordRequests = true | ||
| Ignore = [".databricks"] |
1 change: 1 addition & 0 deletions
1
acceptance/bundle/resources/pipelines/testing/tests/requirements.txt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| faker |
2 changes: 2 additions & 0 deletions
2
acceptance/bundle/resources/pipelines/testing/tests/test_orders.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| def test_orders(): | ||
| pass |
1 change: 1 addition & 0 deletions
1
acceptance/bundle/resources/pipelines/testing/transformations/orders.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from pyspark import pipelines as dp |
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a
bundle deployhere (RecordRequests is already on in test.toml) so we see the test wheel uploaded and./dist/*.whlrewritten to its.internalpath? This test only runs validate, so the wheel stays./dist/*.whlin the output, and the same-name test fails before upload, so nothing in the goldens shows the upload the description talks about. If that has to wait for #7438, worth a note in the script.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deploy step is in #7438 (7401411), in this same script. Its golden shows the test wheel uploaded and the dependency rewritten to its
.internalpath. I kept this PR to validate only, so each PR shows one step.