Skip to content

Commit 23e0bb0

Browse files
tharunbhuk-dbIsaac
andcommitted
Run the pipelines test scripts on bash 3.2 and on Windows
macOS runners use bash 3.2, which has no &>> redirect. The calls with workspace or API paths that this PR adds also need Windows path conversion turned off, like the ones before them. Co-authored-by: Isaac <no-reply@databricks.com>
1 parent f812077 commit 23e0bb0

6 files changed

Lines changed: 16 additions & 16 deletions

File tree

‎acceptance/pipelines/test/immutable/output.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you've made local changes, run 'databricks pipelines deploy' first to ensure
1515
Error: cannot resolve test selection "tests/test_orders.py::test_backfill": local test paths are not supported with workspace.sync_mode immutable; pass an absolute workspace path
1616

1717
=== Absolute workspace paths and running all tests still work
18-
>>> [CLI] pipelines test my_pipeline /Workspace/Users/someone@example.com/tests/test_orders.py::test_backfill --no-wait
18+
>>> MSYS_NO_PATHCONV=1 [CLI] pipelines test my_pipeline /Workspace/Users/someone@example.com/tests/test_orders.py::test_backfill --no-wait
1919
Recommendation: This command runs the last deployed version of the code
2020

2121
If you've made local changes, run 'databricks pipelines deploy' first to ensure they are included.

‎acceptance/pipelines/test/immutable/script‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ title "Local test paths are not supported with workspace.sync_mode immutable"
55
trace musterr $CLI pipelines test my_pipeline tests/test_orders.py::test_backfill
66

77
title "Absolute workspace paths and running all tests still work"
8-
trace $CLI pipelines test my_pipeline /Workspace/Users/someone@example.com/tests/test_orders.py::test_backfill --no-wait
8+
trace MSYS_NO_PATHCONV=1 $CLI pipelines test my_pipeline /Workspace/Users/someone@example.com/tests/test_orders.py::test_backfill --no-wait
99
# Like the service, the test server rejects a new update while one is active.
10-
$CLI pipelines stop my_pipeline &>> LOG.stop
10+
$CLI pipelines stop my_pipeline >> LOG.stop 2>&1
1111
trace $CLI pipelines test my_pipeline --no-wait
1212
trace print_requests.py //updates

‎acceptance/pipelines/test/pipeline-id/output.txt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
=== Relative test selections resolve against the pipeline root_path
3-
>>> [CLI] pipelines test --pipeline-id [UUID] tests/test_orders.py::test_backfill /Workspace/Users/someone@example.com/other/tests --no-wait
3+
>>> MSYS_NO_PATHCONV=1 [CLI] pipelines test --pipeline-id [UUID] tests/test_orders.py::test_backfill /Workspace/Users/someone@example.com/other/tests --no-wait
44
Pipeline: [UUID]
55
Update: [UUID]
66

@@ -34,7 +34,7 @@ tests/test_orders.py::test_valid_order PASSED (1.00s)
3434
Error: cannot resolve test selection "tests": the pipeline has no root_path; use an absolute workspace path such as /Workspace/Users/someone@example.com/tests
3535

3636
=== With --no-wait and only workspace paths, the pipeline is not read
37-
>>> [CLI] pipelines test --pipeline-id [UUID] /Workspace/Users/someone@example.com/tests/test_other.py::test_x --no-wait
37+
>>> MSYS_NO_PATHCONV=1 [CLI] pipelines test --pipeline-id [UUID] /Workspace/Users/someone@example.com/tests/test_other.py::test_x --no-wait
3838
Pipeline: [UUID]
3939
Update: [UUID]
4040

@@ -53,7 +53,7 @@ Update: [UUID]
5353
}
5454

5555
=== Without a root_path, test case IDs are absolute workspace paths
56-
>>> [CLI] pipelines test --pipeline-id [UUID] /Workspace/Users/someone@example.com/orders/tests/test_orders.py
56+
>>> MSYS_NO_PATHCONV=1 [CLI] pipelines test --pipeline-id [UUID] /Workspace/Users/someone@example.com/orders/tests/test_orders.py
5757
Pipeline: [UUID]
5858
Update: [UUID]
5959
Waiting for compute...

‎acceptance/pipelines/test/pipeline-id/script‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
pipeline_id=$($CLI pipelines create --json '{"name": "orders", "root_path": "/Workspace/Users/someone@example.com/orders"}' | jq -r .pipeline_id)
22
no_root_pipeline_id=$($CLI pipelines create --json '{"name": "no-root"}' | jq -r .pipeline_id)
3-
$CLI workspace import-dir orders /Workspace/Users/someone@example.com/orders &> LOG.import
3+
MSYS_NO_PATHCONV=1 $CLI workspace import-dir orders /Workspace/Users/someone@example.com/orders &> LOG.import
44
rm "$OUT_REQUESTS"
55

66
title "Relative test selections resolve against the pipeline root_path"
7-
trace $CLI pipelines test --pipeline-id $pipeline_id tests/test_orders.py::test_backfill /Workspace/Users/someone@example.com/other/tests --no-wait
7+
trace MSYS_NO_PATHCONV=1 $CLI pipelines test --pipeline-id $pipeline_id tests/test_orders.py::test_backfill /Workspace/Users/someone@example.com/other/tests --no-wait
88
trace print_requests.py //updates
99
# Like the service, the test server rejects a new update while one is active.
10-
$CLI api post /api/2.0/pipelines/$pipeline_id/stop &>> LOG.stop
10+
MSYS_NO_PATHCONV=1 $CLI api post /api/2.0/pipelines/$pipeline_id/stop >> LOG.stop 2>&1
1111
rm "$OUT_REQUESTS"
1212

1313
title "Test case IDs are shown relative to the pipeline root_path"
@@ -19,13 +19,13 @@ trace musterr $CLI pipelines test --pipeline-id $no_root_pipeline_id tests
1919
rm "$OUT_REQUESTS"
2020

2121
title "With --no-wait and only workspace paths, the pipeline is not read"
22-
trace $CLI pipelines test --pipeline-id $no_root_pipeline_id /Workspace/Users/someone@example.com/tests/test_other.py::test_x --no-wait
22+
trace MSYS_NO_PATHCONV=1 $CLI pipelines test --pipeline-id $no_root_pipeline_id /Workspace/Users/someone@example.com/tests/test_other.py::test_x --no-wait
2323
trace print_requests.py --get //pipelines
24-
$CLI api post /api/2.0/pipelines/$no_root_pipeline_id/stop &>> LOG.stop
24+
MSYS_NO_PATHCONV=1 $CLI api post /api/2.0/pipelines/$no_root_pipeline_id/stop >> LOG.stop 2>&1
2525
rm "$OUT_REQUESTS"
2626

2727
title "Without a root_path, test case IDs are absolute workspace paths"
28-
trace $CLI pipelines test --pipeline-id $no_root_pipeline_id /Workspace/Users/someone@example.com/orders/tests/test_orders.py
28+
trace MSYS_NO_PATHCONV=1 $CLI pipelines test --pipeline-id $no_root_pipeline_id /Workspace/Users/someone@example.com/orders/tests/test_orders.py
2929
rm "$OUT_REQUESTS"
3030

3131
title "Outside a project, --pipeline-id is required"

‎acceptance/pipelines/test/selection/output.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Update: [UUID]
2525
}
2626

2727
=== Select tests by relative path and test ID, with pytest arguments in both --pytest-arg forms
28-
>>> [CLI] pipelines test my_pipeline tests tests/test_orders.py::test_backfill /Workspace/Users/someone@example.com/tests/test_other.py --pytest-arg=-k --pytest-arg=orders and not slow --pytest-arg -m --pytest-arg smoke,fast --no-wait
28+
>>> MSYS_NO_PATHCONV=1 [CLI] pipelines test my_pipeline tests tests/test_orders.py::test_backfill /Workspace/Users/someone@example.com/tests/test_other.py --pytest-arg=-k --pytest-arg=orders and not slow --pytest-arg -m --pytest-arg smoke,fast --no-wait
2929
Recommendation: This command runs the last deployed version of the code
3030

3131
If you've made local changes, run 'databricks pipelines deploy' first to ensure they are included.

‎acceptance/pipelines/test/selection/script‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ title "Run all tests of the only pipeline"
55
trace $CLI pipelines test --no-wait
66
trace print_requests.py //updates
77
# Like the service, the test server rejects a new update while one is active.
8-
$CLI pipelines stop my_pipeline &>> LOG.stop
8+
$CLI pipelines stop my_pipeline >> LOG.stop 2>&1
99
rm "$OUT_REQUESTS"
1010

1111
title "Select tests by relative path and test ID, with pytest arguments in both --pytest-arg forms"
12-
trace $CLI pipelines test my_pipeline tests tests/test_orders.py::test_backfill /Workspace/Users/someone@example.com/tests/test_other.py --pytest-arg=-k --pytest-arg='orders and not slow' --pytest-arg -m --pytest-arg smoke,fast --no-wait
12+
trace MSYS_NO_PATHCONV=1 $CLI pipelines test my_pipeline tests tests/test_orders.py::test_backfill /Workspace/Users/someone@example.com/tests/test_other.py --pytest-arg=-k --pytest-arg='orders and not slow' --pytest-arg -m --pytest-arg smoke,fast --no-wait
1313
trace print_requests.py //updates
14-
$CLI pipelines stop my_pipeline &>> LOG.stop
14+
$CLI pipelines stop my_pipeline >> LOG.stop 2>&1
1515
rm "$OUT_REQUESTS"
1616

1717
title "Relative paths resolve from the working directory"

0 commit comments

Comments
 (0)