Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
87ca828
Add databricks pipelines test command
tharunbhuk-db Oct 19, 2026
ad9c4be
Test every rejected pytest option and the spaced --pytest-arg form
tharunbhuk-db Oct 27, 2026
a16bd55
Resolve pipelines test selections like the test IDs the service reports
tharunbhuk-db Oct 30, 2026
31b5ec3
Map local pipelines test paths like TranslatePaths and mark the comma…
tharunbhuk-db Oct 30, 2026
f7898c2
Link the changelog entry to its PR
tharunbhuk-db Oct 30, 2026
683cede
Reject a pipelines test -k or -m value that starts with -
tharunbhuk-db Oct 31, 2026
368ddfe
Recommend pipelines deploy only after pipelines test finds the pipeline
tharunbhuk-db Oct 31, 2026
fd40c0c
Resolve pipelines test selections as local paths or against root_path
tharunbhuk-db Oct 31, 2026
b020fc5
Cover pipelines test selections with workspace.sync_mode immutable
tharunbhuk-db Oct 31, 2026
8a916d9
Require pipelines test -k and -m values in the next --pytest-arg, as …
tharunbhuk-db Oct 31, 2026
9a96d02
Wait for and print the results of databricks pipelines test
tharunbhuk-db Oct 31, 2026
87c8ffa
Reject a pipelines test --resume update that the service reports is n…
tharunbhuk-db Oct 31, 2026
bf661a8
Say why the pipelines test event reader cannot use the SDK iterator yet
tharunbhuk-db Oct 31, 2026
b241413
Reject a pipelines test --resume value that is not an update ID
tharunbhuk-db Oct 31, 2026
f301e8e
Show pipelines test case IDs in the shortest form that selects them a…
tharunbhuk-db Oct 31, 2026
fb461c2
Explain a pipelines test run whose tests failed by its summary alone,…
tharunbhuk-db Oct 31, 2026
510740f
Test that pipelines test --resume reads results when the service does…
tharunbhuk-db Oct 31, 2026
3ecf053
Reject test options in the fake pipelines service as the service does
tharunbhuk-db Oct 31, 2026
1f8d972
Read the errored count of the pipelines test summary, as the service …
tharunbhuk-db Oct 31, 2026
8679115
Reject an empty pipelines test --resume instead of starting a new run
tharunbhuk-db Oct 31, 2026
695c4b0
Say that pipelines test succeeds when at least one test was collected
tharunbhuk-db Oct 31, 2026
6cba663
Drop the unread level and message from pipelines test events
tharunbhuk-db Oct 31, 2026
557cdaa
Write a JUnit XML report from databricks pipelines test
tharunbhuk-db Oct 31, 2026
1aecf2b
Name pipelines test JUnit cases relative to the project folder, as py…
tharunbhuk-db Oct 31, 2026
62df2cd
Replace an older pipelines test JUnit report when a flag is invalid
tharunbhuk-db Oct 31, 2026
e5cfb81
Replace an older pipelines test JUnit report when --resume names an u…
tharunbhuk-db Oct 31, 2026
b6de2c2
Cover the JUnit report of a passing pipelines test run
tharunbhuk-db Oct 31, 2026
f215aee
Add the testing property of pipelines to bundles
tharunbhuk-db Oct 31, 2026
8cd2090
Check pipeline test dependencies for wheels with the same name
tharunbhuk-db Oct 31, 2026
4cab641
Install a test dependency in the live pipelines test smoke test
tharunbhuk-db Oct 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nextchanges/bundles/editable-project-folder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Fix `-e ./folder` in environment dependencies, which failed before deploy. A local project folder after `-e`, with optional extras such as `-e ./project[test]`, now maps to its deployed folder. ([#7274](https://github.com/databricks/cli/pull/7274))
1 change: 1 addition & 0 deletions .nextchanges/bundles/pipelines-testing-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* `bundle plan` now shows a change to a pipeline's `testing` that was made outside the bundle, and `bundle deploy` undoes it. ([#7274](https://github.com/databricks/cli/pull/7274))
1 change: 1 addition & 0 deletions .nextchanges/bundles/pipelines-testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Add the `testing` property of pipelines, which sets the test sources and test-only dependencies that `databricks pipelines test` runs with. ([#7274](https://github.com/databricks/cli/pull/7274))
1 change: 1 addition & 0 deletions .nextchanges/cli/pipelines-test-junit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Add `--junit-xml` to `databricks pipelines test`, which writes the test results as a JUnit XML report. ([#7273](https://github.com/databricks/cli/pull/7273))
1 change: 1 addition & 0 deletions .nextchanges/cli/pipelines-test-results.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* `databricks pipelines test` waits for the test results, prints them, and fails when a test fails or the results are incomplete. ([#7272](https://github.com/databricks/cli/pull/7272))
1 change: 1 addition & 0 deletions .nextchanges/cli/pipelines-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Add the `databricks pipelines test` command, which runs a pipeline's tests in a test-only update. ([#7271](https://github.com/databricks/cli/pull/7271))
33 changes: 33 additions & 0 deletions acceptance/bundle/environments/editable-folder/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
bundle:
name: editable-folder

resources:
jobs:
my_job:
name: my job
tasks:
- task_key: main
python_wheel_task:
package_name: orders
entry_point: main
environment_key: default
environments:
- environment_key: default
spec:
client: "1"
dependencies:
- -e ./project

pipelines:
my_pipeline:
name: my pipeline
environment:
dependencies:
- -e ./project
testing:
sources:
- glob:
include: /Workspace/Shared/orders/tests/**
environment:
dependencies:
- -e ./project[test]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Cloud = false
EnvMatrix.DMS = ["", "true"]
13 changes: 13 additions & 0 deletions acceptance/bundle/environments/editable-folder/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

>>> [CLI] bundle validate -o json
{
"job": [
"-e /Workspace/Users/[USERNAME]/.bundle/editable-folder/default/files/project"
],
"pipeline": [
"-e /Workspace/Users/[USERNAME]/.bundle/editable-folder/default/files/project"
],
"testing": [
"-e /Workspace/Users/[USERNAME]/.bundle/editable-folder/default/files/project[test]"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[project]
name = "orders"
version = "0.1.0"

[project.optional-dependencies]
test = ["faker"]
1 change: 1 addition & 0 deletions acceptance/bundle/environments/editable-folder/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
trace $CLI bundle validate -o json | jq '{job: .resources.jobs.my_job.environments[0].spec.dependencies, pipeline: .resources.pipelines.my_pipeline.environment.dependencies, testing: .resources.pipelines.my_pipeline.testing.environment.dependencies}'
1 change: 1 addition & 0 deletions acceptance/bundle/environments/editable-folder/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cloud = false
8 changes: 8 additions & 0 deletions acceptance/bundle/refschema/output/pipelines.txt
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,14 @@ resources.pipelines.*.storage string ALL
resources.pipelines.*.tags map[string]string ALL
resources.pipelines.*.tags.* string ALL
resources.pipelines.*.target string ALL
resources.pipelines.*.testing *resources.PipelineTesting ALL
resources.pipelines.*.testing.environment *resources.PipelineTestEnvironment ALL
resources.pipelines.*.testing.environment.dependencies []string ALL
resources.pipelines.*.testing.environment.dependencies[*] string ALL
resources.pipelines.*.testing.sources []resources.PipelineTestSource ALL
resources.pipelines.*.testing.sources[*] resources.PipelineTestSource ALL
resources.pipelines.*.testing.sources[*].glob *pipelines.PathPattern ALL
resources.pipelines.*.testing.sources[*].glob.include string ALL
resources.pipelines.*.trigger *pipelines.PipelineTrigger ALL
resources.pipelines.*.trigger.cron *pipelines.CronTrigger ALL
resources.pipelines.*.trigger.cron.quartz_cron_schedule string ALL
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
bundle:
name: pipeline-testing-dependencies

resources:
pipelines:
orders:
name: orders
testing:
sources:
- glob:
include: /Workspace/Shared/orders/tests/**
environment:
dependencies:
# Accepted, as by the API.
- --editable /Workspace/Shared/orders[test]
- --requirement=/Workspace/Shared/orders/requirements.txt
- -r ./orders/requirements.txt
# Rejected, as by the API.
- faker==33.0
- git+https://github.com/example/helpers
- /Workspace/Shared/orders/requirements.txt
- --requirement ./orders/requirements.txt
- /Workspace/Shared/orders -i https://example.com/simple
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Cloud = false
EnvMatrix.DMS = ["", "true"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

>>> musterr [CLI] bundle validate
Error: testing.environment.dependencies must point at files, not "faker==33.0"
at resources.pipelines.orders.testing.environment.dependencies[3]
in databricks.yml:19:15

A test dependency is a project folder, a wheel, or a requirements file after -r, in the bundle, under /Workspace/, or under /Volumes/. Declare test packages in a project file, such as the test extra of a pyproject.toml, and reference its folder, for example -e ./project[test]. For a path in the bundle, use -e or -r followed by a space. URLs, other pip options, and .. are not supported.

Error: testing.environment.dependencies must point at files, not "git+https://github.com/example/helpers"
at resources.pipelines.orders.testing.environment.dependencies[4]
in databricks.yml:20:15

A test dependency is a project folder, a wheel, or a requirements file after -r, in the bundle, under /Workspace/, or under /Volumes/. Declare test packages in a project file, such as the test extra of a pyproject.toml, and reference its folder, for example -e ./project[test]. For a path in the bundle, use -e or -r followed by a space. URLs, other pip options, and .. are not supported.

Error: testing.environment.dependencies needs -r before the requirements file "/Workspace/Shared/orders/requirements.txt"
at resources.pipelines.orders.testing.environment.dependencies[5]
in databricks.yml:21:15

Without -r, pip treats the file as a package to install. For example: -r ./tests/requirements.txt.

Error: testing.environment.dependencies must point at files, not "--requirement ./orders/requirements.txt"
at resources.pipelines.orders.testing.environment.dependencies[6]
in databricks.yml:22:15

A test dependency is a project folder, a wheel, or a requirements file after -r, in the bundle, under /Workspace/, or under /Volumes/. Declare test packages in a project file, such as the test extra of a pyproject.toml, and reference its folder, for example -e ./project[test]. For a path in the bundle, use -e or -r followed by a space. URLs, other pip options, and .. are not supported.

Error: testing.environment.dependencies must point at files, not "/Workspace/Shared/orders -i https://example.com/simple"
at resources.pipelines.orders.testing.environment.dependencies[7]
in databricks.yml:23:15

A test dependency is a project folder, a wheel, or a requirements file after -r, in the bundle, under /Workspace/, or under /Volumes/. Declare test packages in a project file, such as the test extra of a pyproject.toml, and reference its folder, for example -e ./project[test]. For a path in the bundle, use -e or -r followed by a space. URLs, other pip options, and .. are not supported.

Name: pipeline-testing-dependencies
Target: default
Workspace:
User: [USERNAME]
Path: /Workspace/Users/[USERNAME]/.bundle/pipeline-testing-dependencies/default

Found 5 errors
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
trace musterr $CLI bundle validate
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Runs only against the local test server.
Cloud = false
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Cloud = false
EnvMatrix.DMS = ["", "true"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

>>> errcode [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


Exit code: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
trace errcode $CLI bundle deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Runs only against the local test server.
Cloud = false
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_orders():
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
x = 1
19 changes: 19 additions & 0 deletions acceptance/bundle/resources/pipelines/testing/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
bundle:
name: pipeline-testing

resources:
pipelines:
orders:
name: orders
libraries:
- glob:
include: ./transformations/**
testing:
sources:
- glob:
include: ./tests/**
environment:
dependencies:
- --editable ${workspace.file_path}[test]
- -r ./tests/requirements.txt
- ./dist/*.whl
2 changes: 2 additions & 0 deletions acceptance/bundle/resources/pipelines/testing/out.test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Cloud = false
EnvMatrix.DMS = ["", "true"]
Loading
Loading