Skip to content

Commit e1c15fb

Browse files
authored
acc: Enable default-python/combinations on cloud (#2876)
This checks all combinations of input parameters against cloud environments. Relies on #2894 to skip environments + configurations that cannot work together.
1 parent 878826c commit e1c15fb

5 files changed

Lines changed: 17 additions & 10 deletions

File tree

acceptance/bundle/templates/default-python/combinations/check_output.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import os
44
import subprocess
55

6+
CLOUD_ENV = os.environ.get("CLOUD_ENV")
7+
if CLOUD_ENV and os.environ["SERVERLESS"] == "yes" and not os.environ.get("TEST_METASTORE_ID"):
8+
sys.exit(f"SKIP_TEST SERVERLESS=yes but TEST_METASTORE_ID is empty in this env {CLOUD_ENV=}")
69

710
BUILDING = "Building python_artifact"
811
UPLOADING = "Uploading dist/"

acceptance/bundle/templates/default-python/combinations/input.json.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"project_name": "my_default_python",
2+
"project_name": "X$UNIQUE_NAME",
33
"include_notebook": "$INCLUDE_NOTEBOOK",
44
"include_dlt": "$INCLUDE_DLT",
55
"include_python": "$INCLUDE_PYTHON",

acceptance/bundle/templates/default-python/combinations/output.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,34 @@
22
>>> [CLI] bundle init default-python --config-file ./input.json
33

44
Welcome to the default Python template for Databricks Asset Bundles!
5-
Workspace to use (auto-detected, edit in 'my_default_python/databricks.yml'): [DATABRICKS_URL]
5+
Workspace to use (auto-detected, edit in 'X[UNIQUE_NAME]/databricks.yml'): [DATABRICKS_URL]
66

7-
✨ Your new project has been created in the 'my_default_python' directory!
7+
✨ Your new project has been created in the 'X[UNIQUE_NAME]' directory!
88

99
Please refer to the README.md file for "getting started" instructions.
1010
See also the documentation at https://docs.databricks.com/dev-tools/bundles/index.html.
1111

1212
>>> [CLI] bundle validate -t dev
13-
Name: my_default_python
13+
Name: X[UNIQUE_NAME]
1414
Target: dev
1515
Workspace:
1616
Host: [DATABRICKS_URL]
1717
User: [USERNAME]
18-
Path: /Workspace/Users/[USERNAME]/.bundle/my_default_python/dev
18+
Path: /Workspace/Users/[USERNAME]/.bundle/X[UNIQUE_NAME]/dev
1919

2020
Validation OK!
2121

2222
>>> [CLI] bundle validate -t prod
23-
Name: my_default_python
23+
Name: X[UNIQUE_NAME]
2424
Target: prod
2525
Workspace:
2626
Host: [DATABRICKS_URL]
2727
User: [USERNAME]
28-
Path: /Workspace/Users/[USERNAME]/.bundle/my_default_python/prod
28+
Path: /Workspace/Users/[USERNAME]/.bundle/X[UNIQUE_NAME]/prod
2929

3030
Validation OK!
3131

3232
>>> ../check_output.py [CLI] bundle deploy -t dev
33-
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/my_default_python/dev/files...
33+
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/X[UNIQUE_NAME]/dev/files...
3434
Deploying resources...
3535
Deployment complete!

acceptance/bundle/templates/default-python/combinations/script

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
envsubst < input.json.tmpl > input.json
22
trace $CLI bundle init default-python --config-file ./input.json
33

4-
cd ./my_default_python
4+
cd ./X*
55
trace $CLI bundle validate -t dev
66
trace $CLI bundle validate -t prod
77

@@ -13,3 +13,5 @@ trace ../check_output.py $CLI bundle deploy -t dev
1313
# Do not affect this repository's git behaviour #2318
1414
mv .gitignore out.gitignore
1515
rm .databricks/.gitignore
16+
cd ..
17+
rm -fr X*

acceptance/bundle/templates/default-python/combinations/test.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
Ignore = ["my_default_python", "input.json"]
1+
Cloud = true
2+
3+
Ignore = ["input.json"]
24
EnvMatrix.INCLUDE_NOTEBOOK = ["yes", "no"]
35
EnvMatrix.INCLUDE_DLT = ["yes", "no"]
46
EnvMatrix.INCLUDE_PYTHON = ["yes", "no"]

0 commit comments

Comments
 (0)