Skip to content

Commit f54bac7

Browse files
committed
Check pipeline test dependencies for wheels with the same name
1 parent ec0bd96 commit f54bac7

10 files changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
bundle:
2+
name: pipeline-testing-same-name-libraries
3+
4+
resources:
5+
pipelines:
6+
orders:
7+
name: orders
8+
libraries:
9+
- file:
10+
path: ./transformations/orders.py
11+
environment:
12+
dependencies:
13+
- ./pipeline/test_helpers-0.1-py3-none-any.whl
14+
testing:
15+
sources:
16+
- glob:
17+
include: ./tests/**
18+
environment:
19+
dependencies:
20+
# A different wheel with the same file name would be uploaded to the same path.
21+
- ./tests/test_helpers-0.1-py3-none-any.whl
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Cloud = false
2+
EnvMatrix.DMS = ["", "true"]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
>>> errcode [CLI] bundle deploy
3+
Error: Duplicate local library names: test_helpers-0.1-py3-none-any.whl
4+
at resources.pipelines.orders.environment.dependencies[0]
5+
resources.pipelines.orders.testing.environment.dependencies[0]
6+
in databricks.yml:13:13
7+
databricks.yml:21:15
8+
9+
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
10+
11+
12+
Exit code: 1

‎acceptance/bundle/resources/pipelines/testing-same-name-libraries/pipeline/test_helpers-0.1-py3-none-any.whl‎

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
trace errcode $CLI bundle deploy
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Runs only against the local test server.
2+
Cloud = false

‎acceptance/bundle/resources/pipelines/testing-same-name-libraries/tests/test_helpers-0.1-py3-none-any.whl‎

Whitespace-only changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_orders():
2+
pass
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
x = 1

‎bundle/libraries/same_name_libraries.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var patterns = []dyn.Pattern{
2222
clusterLibrariesPattern.Append(dyn.AnyIndex(), dyn.Key("jar")),
2323
envDepsPattern.Append(dyn.AnyIndex()),
2424
pipelineEnvDepsPattern.Append(dyn.AnyIndex()),
25+
pipelineTestingEnvDepsPattern.Append(dyn.AnyIndex()),
2526
}
2627

2728
type libData struct {

0 commit comments

Comments
 (0)