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
Open
tharunbhuk-db
wants to merge
5
commits into
tharun/pipelines-test-pr4-bundles
Choose a base branch
from
tharun/pipelines-test-b3-testing-paths
base: tharun/pipelines-test-pr4-bundles
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+183
−33
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
565ee9b
Translate the testing paths of pipelines and upload local test wheels
tharunbhuk-db d3a65c4
Define the dependency path patterns of pipelines once for both locations
tharunbhuk-db 5b54854
Use the patched wheel in the test dependencies of pipelines
tharunbhuk-db 1c74f67
Run the same-name test of pipeline testing without the variable
tharunbhuk-db 1706c59
Copy the prebuilt wheel in the dynamic_version test of pipeline testing
tharunbhuk-db 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] |
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 |
9 changes: 9 additions & 0 deletions
9
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,9 @@ | ||
| trap "rm -fr dist" EXIT | ||
| mkdir dist | ||
| cp $TESTDIR/../../../artifacts/whl_prebuilt_multiple/dist/lib/other_test_code-0.0.1-py3-none-any.whl dist | ||
|
|
||
| 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 |
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
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 |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| title "Relative test paths resolve to the deployed workspace paths" | ||
| trace $CLI bundle validate -o json | jq .resources.pipelines.orders.testing | ||
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.