-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate path translation tests to acceptance tests (#2122)
## Changes The assertions on the output made are now captured in the `output.*` files. These don't capture intent like actual assertions do, but we still have regular test coverage in the path translation tests under `bundle/config/mutator`. ## Tests Tests pass.
- Loading branch information
Showing
48 changed files
with
314 additions
and
142 deletions.
There are no files selected for viewing
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...s/path_translation/nominal/databricks.yml → ...ance/bundle/paths/fallback/databricks.yml
This file contains 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,5 +1,5 @@ | ||
bundle: | ||
name: path_translation_nominal | ||
name: fallback | ||
|
||
include: | ||
- "resources/*.yml" | ||
|
This file contains 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,67 @@ | ||
[ | ||
{ | ||
"job_cluster_key": "default", | ||
"notebook_task": { | ||
"notebook_path": "/Workspace/Users/$USERNAME/.bundle/fallback/development/files/src/notebook" | ||
}, | ||
"task_key": "notebook_example" | ||
}, | ||
{ | ||
"job_cluster_key": "default", | ||
"spark_python_task": { | ||
"python_file": "/Workspace/Users/$USERNAME/.bundle/fallback/development/files/src/file.py" | ||
}, | ||
"task_key": "spark_python_example" | ||
}, | ||
{ | ||
"dbt_task": { | ||
"commands": [ | ||
"dbt run", | ||
"dbt run" | ||
], | ||
"project_directory": "/Workspace/Users/$USERNAME/.bundle/fallback/development/files/src/dbt_project" | ||
}, | ||
"job_cluster_key": "default", | ||
"task_key": "dbt_example" | ||
}, | ||
{ | ||
"job_cluster_key": "default", | ||
"sql_task": { | ||
"file": { | ||
"path": "/Workspace/Users/$USERNAME/.bundle/fallback/development/files/src/sql.sql" | ||
}, | ||
"warehouse_id": "cafef00d" | ||
}, | ||
"task_key": "sql_example" | ||
}, | ||
{ | ||
"job_cluster_key": "default", | ||
"libraries": [ | ||
{ | ||
"whl": "dist/wheel1.whl" | ||
}, | ||
{ | ||
"whl": "dist/wheel2.whl" | ||
} | ||
], | ||
"python_wheel_task": { | ||
"package_name": "my_package" | ||
}, | ||
"task_key": "python_wheel_example" | ||
}, | ||
{ | ||
"job_cluster_key": "default", | ||
"libraries": [ | ||
{ | ||
"jar": "target/jar1.jar" | ||
}, | ||
{ | ||
"jar": "target/jar2.jar" | ||
} | ||
], | ||
"spark_jar_task": { | ||
"main_class_name": "com.example.Main" | ||
}, | ||
"task_key": "spark_jar_example" | ||
} | ||
] |
This file contains 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,22 @@ | ||
[ | ||
{ | ||
"file": { | ||
"path": "/Workspace/Users/$USERNAME/.bundle/fallback/development/files/src/file1.py" | ||
} | ||
}, | ||
{ | ||
"notebook": { | ||
"path": "/Workspace/Users/$USERNAME/.bundle/fallback/development/files/src/notebook1" | ||
} | ||
}, | ||
{ | ||
"file": { | ||
"path": "/Workspace/Users/$USERNAME/.bundle/fallback/development/files/src/file2.py" | ||
} | ||
}, | ||
{ | ||
"notebook": { | ||
"path": "/Workspace/Users/$USERNAME/.bundle/fallback/development/files/src/notebook2" | ||
} | ||
} | ||
] |
This file contains 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,18 @@ | ||
|
||
>>> $CLI bundle validate -t development -o json | ||
|
||
Exit code: 0 | ||
|
||
>>> $CLI bundle validate -t error | ||
Error: notebook this value is overridden not found. Local notebook references are expected | ||
to contain one of the following file extensions: [.py, .r, .scala, .sql, .ipynb] | ||
|
||
Name: fallback | ||
Target: error | ||
Workspace: | ||
User: $USERNAME | ||
Path: /Workspace/Users/$USERNAME/.bundle/fallback/error | ||
|
||
Found 1 error | ||
|
||
Exit code: 1 |
File renamed without changes.
File renamed without changes.
This file contains 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
File renamed without changes.
This file contains 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 @@ | ||
errcode trace $CLI bundle validate -t development -o json > output.tmp.json | ||
|
||
# Capture job tasks | ||
jq '.resources.jobs.my_job.tasks' output.tmp.json > output.job.json | ||
|
||
# Capture pipeline libraries | ||
jq '.resources.pipelines.my_pipeline.libraries' output.tmp.json > output.pipeline.json | ||
|
||
# Expect failure for the "error" target | ||
errcode trace $CLI bundle validate -t error |
This file contains 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 @@ | ||
rm -f output.tmp.json |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../path_translation/fallback/databricks.yml → ...tance/bundle/paths/nominal/databricks.yml
This file contains 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,5 +1,5 @@ | ||
bundle: | ||
name: path_translation_fallback | ||
name: nominal | ||
|
||
include: | ||
- "resources/*.yml" | ||
|
This file contains 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,89 @@ | ||
[ | ||
{ | ||
"job_cluster_key": "default", | ||
"notebook_task": { | ||
"notebook_path": "/Workspace/Users/$USERNAME/.bundle/nominal/development/files/src/notebook" | ||
}, | ||
"task_key": "notebook_example" | ||
}, | ||
{ | ||
"job_cluster_key": "default", | ||
"spark_python_task": { | ||
"python_file": "/Workspace/Users/$USERNAME/.bundle/nominal/development/files/src/file.py" | ||
}, | ||
"task_key": "spark_python_example" | ||
}, | ||
{ | ||
"dbt_task": { | ||
"commands": [ | ||
"dbt run", | ||
"dbt run" | ||
], | ||
"project_directory": "/Workspace/Users/$USERNAME/.bundle/nominal/development/files/src/dbt_project" | ||
}, | ||
"job_cluster_key": "default", | ||
"task_key": "dbt_example" | ||
}, | ||
{ | ||
"job_cluster_key": "default", | ||
"sql_task": { | ||
"file": { | ||
"path": "/Workspace/Users/$USERNAME/.bundle/nominal/development/files/src/sql.sql" | ||
}, | ||
"warehouse_id": "cafef00d" | ||
}, | ||
"task_key": "sql_example" | ||
}, | ||
{ | ||
"job_cluster_key": "default", | ||
"libraries": [ | ||
{ | ||
"whl": "dist/wheel1.whl" | ||
}, | ||
{ | ||
"whl": "dist/wheel2.whl" | ||
} | ||
], | ||
"python_wheel_task": { | ||
"package_name": "my_package" | ||
}, | ||
"task_key": "python_wheel_example" | ||
}, | ||
{ | ||
"job_cluster_key": "default", | ||
"libraries": [ | ||
{ | ||
"jar": "target/jar1.jar" | ||
}, | ||
{ | ||
"jar": "target/jar2.jar" | ||
} | ||
], | ||
"spark_jar_task": { | ||
"main_class_name": "com.example.Main" | ||
}, | ||
"task_key": "spark_jar_example" | ||
}, | ||
{ | ||
"for_each_task": { | ||
"task": { | ||
"notebook_task": { | ||
"notebook_path": "/Workspace/Users/$USERNAME/.bundle/nominal/development/files/src/notebook" | ||
} | ||
} | ||
}, | ||
"job_cluster_key": "default", | ||
"task_key": "for_each_notebook_example" | ||
}, | ||
{ | ||
"for_each_task": { | ||
"task": { | ||
"job_cluster_key": "default", | ||
"spark_python_task": { | ||
"python_file": "/Workspace/Users/$USERNAME/.bundle/nominal/development/files/src/file.py" | ||
} | ||
} | ||
}, | ||
"task_key": "for_each_spark_python_example" | ||
} | ||
] |
This file contains 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,22 @@ | ||
[ | ||
{ | ||
"file": { | ||
"path": "/Workspace/Users/$USERNAME/.bundle/nominal/development/files/src/file1.py" | ||
} | ||
}, | ||
{ | ||
"notebook": { | ||
"path": "/Workspace/Users/$USERNAME/.bundle/nominal/development/files/src/notebook1" | ||
} | ||
}, | ||
{ | ||
"file": { | ||
"path": "/Workspace/Users/$USERNAME/.bundle/nominal/development/files/src/file2.py" | ||
} | ||
}, | ||
{ | ||
"notebook": { | ||
"path": "/Workspace/Users/$USERNAME/.bundle/nominal/development/files/src/notebook2" | ||
} | ||
} | ||
] |
This file contains 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,18 @@ | ||
|
||
>>> $CLI bundle validate -t development -o json | ||
|
||
Exit code: 0 | ||
|
||
>>> $CLI bundle validate -t error | ||
Error: notebook this value is overridden not found. Local notebook references are expected | ||
to contain one of the following file extensions: [.py, .r, .scala, .sql, .ipynb] | ||
|
||
Name: nominal | ||
Target: error | ||
Workspace: | ||
User: $USERNAME | ||
Path: /Workspace/Users/$USERNAME/.bundle/nominal/error | ||
|
||
Found 1 error | ||
|
||
Exit code: 1 |
File renamed without changes.
File renamed without changes.
This file contains 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
File renamed without changes.
This file contains 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 @@ | ||
errcode trace $CLI bundle validate -t development -o json > output.tmp.json | ||
|
||
# Capture job tasks | ||
jq '.resources.jobs.my_job.tasks' output.tmp.json > output.job.json | ||
|
||
# Capture pipeline libraries | ||
jq '.resources.pipelines.my_pipeline.libraries' output.tmp.json > output.pipeline.json | ||
|
||
# Expect failure for the "error" target | ||
errcode trace $CLI bundle validate -t error |
This file contains 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 @@ | ||
rm -f output.tmp.json |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
acceptance/bundle/paths/relative_path_translation/output.default.json
This file contains 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 @@ | ||
{ | ||
"paths": [ | ||
"/Workspace/remote/src/file1.py", | ||
"/Workspace/remote/src/file1.py" | ||
] | ||
} |
Oops, something went wrong.