Skip to content

Commit 6805f23

Browse files
denikclaude
andauthored
acc: testserver: add support for executing wheel and notebook tasks (#4507)
## Changes Update testserver to actually execute job tasks by creating a temp venv with uv. **Job Execution:** - Implement notebook task execution with magic command preprocessing (`%python`, `%pip`) - Add job run output retrieval for both run IDs and task run IDs - Support `python_params` override in RunNow API - Cache cluster virtual environments for Python wheel tasks - Add serverless compute support **Notebook Execution:** - Extract wheel paths from `%pip install` commands and install them - Mock `dbutils` module (Widgets, Library, Notebook) for compatibility - Normalize output to match cloud behavior **Resources:** - Add missing instance pool "some-test-instance-pool" for variable lookups - Match cloud behavior for SINGLE_USER cluster drift detection. This enables reproducing #4418 on testserver precisely like on cloud. **Test Outputs:** - Update to reflect realistic Databricks behavior: - Modern run URLs: `/?o=[NUMID]#job/[NUMID]/run/[NUMID]` - Actual job names instead of generic placeholders - State transitions: `RUNNING` → `TERMINATED SUCCESS` - Multi-task job output display ## Why Converting cloud-only tests in cloud+local speeds up - updating test results (we only update once in local mode for cloud+local tests, since output must match); - debugging test failures. It also enables people who do not have access to integration test env to author PRs. The have been a couple cases where I had to debug failures in integration_whl tests and since test takes 5-10mins, it takes a lot of time. ## Tests Previously cloud-only tests now work on testserver. --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7554bd6 commit 6805f23

File tree

31 files changed

+610
-40
lines changed

31 files changed

+610
-40
lines changed

acceptance/acceptance_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ func testAccept(t *testing.T, inprocessMode bool, singleTest string) int {
241241
if os.Getenv("TEST_DEFAULT_CLUSTER_ID") == "" {
242242
t.Setenv("TEST_DEFAULT_CLUSTER_ID", testserver.TestDefaultClusterId)
243243
}
244+
if os.Getenv("TEST_INSTANCE_POOL_ID") == "" {
245+
t.Setenv("TEST_INSTANCE_POOL_ID", testserver.TestDefaultInstancePoolId)
246+
}
244247
}
245248

246249
setReplsForTestEnvVars(t, &repls)

acceptance/bundle/integration_whl/base/out.test.toml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

acceptance/bundle/integration_whl/custom_params/out.test.toml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

acceptance/bundle/integration_whl/interactive_cluster/out.test.toml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

acceptance/bundle/integration_whl/interactive_cluster_dynamic_version/out.test.toml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

acceptance/bundle/integration_whl/interactive_single_user/out.test.toml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Local = true
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
uv venv -q .venv
22
venv_activate
33
uv pip install -q setuptools
4+
5+
# On Windows, create python3 alias since some build commands use python3
6+
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || "$OSTYPE" == "win32" ]]; then
7+
python3() { python "$@"; }
8+
export -f python3
9+
fi

acceptance/bundle/integration_whl/serverless/out.test.toml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

acceptance/bundle/integration_whl/serverless/test.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CloudSlow = true
2-
Local = false
2+
Local = true
33

44
# serverless is only enabled if UC is enabled
55
RequiresUnityCatalog = true

0 commit comments

Comments
 (0)