Skip to content

Commit b2c87ae

Browse files
authored
acc: Simplify integration_whl tests (#2479)
## Changes Instead of full templates, only template databricks.yml and use envsubst for that.
1 parent 036061f commit b2c87ae

File tree

25 files changed

+80
-201
lines changed

25 files changed

+80
-201
lines changed

acceptance/bundle/integration_whl/base/template/databricks.yml.tmpl renamed to acceptance/bundle/integration_whl/base/databricks.yml.tmpl

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,23 @@ bundle:
22
name: wheel-task
33

44
workspace:
5-
root_path: "~/.bundle/{{.unique_id}}"
5+
root_path: "~/.bundle/$UNIQUE_NAME"
66

7-
{{if .python_wheel_wrapper}}
8-
experimental:
9-
python_wheel_wrapper: true
10-
{{end}}
7+
include:
8+
- $EXTRA_CONFIG
119

1210
resources:
1311
jobs:
1412
some_other_job:
15-
name: "[${bundle.target}] Test Wheel Job {{.unique_id}}"
13+
name: "[${bundle.target}] Test Wheel Job $UNIQUE_NAME"
1614
tasks:
1715
- task_key: TestTask
1816
new_cluster:
1917
num_workers: 1
20-
spark_version: "{{.spark_version}}"
21-
node_type_id: "{{.node_type_id}}"
18+
spark_version: $DEFAULT_SPARK_VERSION
19+
node_type_id: $NODE_TYPE_ID
2220
data_security_mode: USER_ISOLATION
23-
instance_pool_id: "{{.instance_pool_id}}"
21+
instance_pool_id: $TEST_INSTANCE_POOL_ID
2422
python_wheel_task:
2523
package_name: my_test_code
2624
entry_point: run

acceptance/bundle/integration_whl/base/databricks_template_schema.json

Lines changed: 0 additions & 29 deletions
This file was deleted.

acceptance/bundle/integration_whl/base/empty.yml

Whitespace-only changes.

acceptance/bundle/integration_whl/base/template/{{.project_name}}/__init__.py renamed to acceptance/bundle/integration_whl/base/my_test_code/__init__.py

File renamed without changes.

acceptance/bundle/integration_whl/base/template/{{.project_name}}/__main__.py renamed to acceptance/bundle/integration_whl/base/my_test_code/__main__.py

File renamed without changes.

acceptance/bundle/integration_whl/base/output.txt

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11

2-
>>> cat input.json
3-
{
4-
"project_name": "my_test_code",
5-
"spark_version": "13.3.x-snapshot-scala2.12",
6-
"node_type_id": "[NODE_TYPE_ID]",
7-
"unique_id": "[UNIQUE_NAME]",
8-
"python_wheel_wrapper": false,
9-
"instance_pool_id": "[TEST_INSTANCE_POOL_ID]"
10-
}
11-
✨ Successfully initialized template
12-
132
>>> cat databricks.yml
143
bundle:
154
name: wheel-task
165

176
workspace:
187
root_path: "~/.bundle/[UNIQUE_NAME]"
198

20-
9+
include:
10+
- empty.yml
2111

2212
resources:
2313
jobs:
@@ -27,10 +17,10 @@ resources:
2717
- task_key: TestTask
2818
new_cluster:
2919
num_workers: 1
30-
spark_version: "13.3.x-snapshot-scala2.12"
31-
node_type_id: "[NODE_TYPE_ID]"
20+
spark_version: 13.3.x-snapshot-scala2.12
21+
node_type_id: [NODE_TYPE_ID]
3222
data_security_mode: USER_ISOLATION
33-
instance_pool_id: "[TEST_INSTANCE_POOL_ID]"
23+
instance_pool_id: [TEST_INSTANCE_POOL_ID]
3424
python_wheel_task:
3525
package_name: my_test_code
3626
entry_point: run
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
experimental:
2+
python_wheel_wrapper: true

acceptance/bundle/integration_whl/base/script

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
export SPARK_VERSION=$DEFAULT_SPARK_VERSION
2-
export PYTHON_WHEEL_WRAPPER=false
3-
envsubst < input.json.tmpl > input.json
4-
trace cat input.json
5-
$CLI bundle init . --config-file input.json
1+
export EXTRA_CONFIG=empty.yml
2+
envsubst < databricks.yml.tmpl > databricks.yml
63
trace cat databricks.yml
74
trap "errcode trace '$CLI' bundle destroy --auto-approve" EXIT
85
trace $CLI bundle deploy
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from setuptools import setup, find_packages
2+
3+
import my_test_code
4+
5+
setup(
6+
name="my_test_code",
7+
version=my_test_code.__version__,
8+
author=my_test_code.__author__,
9+
url="https://databricks.com",
10+
author_email="john.doe@databricks.com",
11+
description="my example wheel",
12+
packages=find_packages(include=["my_test_code"]),
13+
entry_points={"group1": "run=my_test_code.__main__:main"},
14+
install_requires=["setuptools"],
15+
)

acceptance/bundle/integration_whl/base/template/setup.py.tmpl

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)