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
Draft
tharunbhuk-db
wants to merge
1
commit 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.
Draft
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
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 |
7 changes: 7 additions & 0 deletions
7
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,7 @@ | ||
| # Runs only against the local test server. | ||
| Cloud = false | ||
| Env.DATABRICKS_BUNDLE_ENABLE_EXPERIMENTAL_PIPELINE_TESTING = "true" | ||
|
|
||
| [[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
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 |
|---|---|---|
|
|
@@ -44,6 +44,11 @@ func pipelineRewritePatterns() []pipelineRewritePattern { | |
| mode: TranslateModeDirectory, | ||
| skipRewrite: noSkipRewrite, | ||
| }, | ||
| { | ||
| pattern: base.Append(dyn.Key("testing"), dyn.Key("sources"), dyn.AnyIndex(), dyn.Key("glob"), dyn.Key("include")), | ||
| mode: TranslateModeGlob, | ||
| skipRewrite: noSkipRewrite, | ||
| }, | ||
| } | ||
|
|
||
| return allPatterns | ||
|
|
@@ -65,6 +70,12 @@ func pipelineLibrariesRewritePatterns() []pipelineRewritePattern { | |
| return !libraries.IsLibraryLocal(s) | ||
| }, | ||
| }, | ||
| // Test dependencies take the same forms as the pipeline's environment dependencies. | ||
| { | ||
| pattern: base.Append(dyn.Key("testing"), dyn.Key("environment"), dyn.Key("dependencies"), dyn.AnyIndex()), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: the four dependency entries now differ only in the path prefix. Maybe loop over the two locations ( |
||
| mode: TranslateModeLocalRelativeWithPrefix, | ||
| skipRewrite: func(s string) bool { return !libraries.IsLibraryLocal(s) }, | ||
| }, | ||
| } | ||
|
|
||
| pipelineEnvironmentsPatternsWithPipFlags := []pipelineRewritePattern{ | ||
|
|
@@ -83,6 +94,14 @@ func pipelineLibrariesRewritePatterns() []pipelineRewritePattern { | |
| return !ok | ||
| }, | ||
| }, | ||
| { | ||
| base.Append(dyn.Key("testing"), dyn.Key("environment"), dyn.Key("dependencies"), dyn.AnyIndex()), | ||
| TranslateModeEnvironmentPipFlag, | ||
| func(s string) bool { | ||
| _, _, ok := libraries.IsLocalPathInPipFlag(s) | ||
| return !ok | ||
| }, | ||
| }, | ||
| } | ||
|
|
||
| return append(pipelineEnvironmentsPatterns, pipelineEnvironmentsPatternsWithPipFlags...) | ||
|
|
||
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.