diff --git a/.nextchanges/cli/pipelines-test.md b/.nextchanges/cli/pipelines-test.md new file mode 100644 index 00000000000..4bb9c7c54fe --- /dev/null +++ b/.nextchanges/cli/pipelines-test.md @@ -0,0 +1 @@ +* Add the Beta `databricks pipelines test` command, which runs the tests of a pipeline, and the `testing` property of pipelines in bundles. ([#7429](https://github.com/databricks/cli/pull/7429)) diff --git a/acceptance/pipelines/databricks-cli-help/output.txt b/acceptance/pipelines/databricks-cli-help/output.txt index a4ddbc1288b..f9d056eec5b 100644 --- a/acceptance/pipelines/databricks-cli-help/output.txt +++ b/acceptance/pipelines/databricks-cli-help/output.txt @@ -30,7 +30,7 @@ Main Commands run Run a pipeline show Preview a table's columns and sample rows stop Stop a pipeline - test *Experimental* Run the tests of a pipeline + test *Beta* Run the tests of a pipeline Management Commands apply-environment *Public Preview* Apply the latest environment to the pipeline. diff --git a/acceptance/pipelines/test/arguments/out.gate-off.xml b/acceptance/pipelines/test/arguments/out.gate-off.xml deleted file mode 100644 index efe909a6fa0..00000000000 --- a/acceptance/pipelines/test/arguments/out.gate-off.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - pipelines test is experimental. Set DATABRICKS_CLI_PIPELINES_TEST=true to enable it - - - diff --git a/acceptance/pipelines/test/arguments/output.txt b/acceptance/pipelines/test/arguments/output.txt index eac823b2a59..6a5c7b13133 100644 --- a/acceptance/pipelines/test/arguments/output.txt +++ b/acceptance/pipelines/test/arguments/output.txt @@ -2,8 +2,6 @@ >>> [CLI] pipelines test --help Run the tests of a pipeline in a test-only update. -This command is experimental. Set DATABRICKS_CLI_PIPELINES_TEST=true to enable it. - KEY is the unique name of the pipeline, as defined in its YAML file. It is required when test selections are given. If there is only one pipeline in the project and no arguments are given, it is selected automatically. @@ -58,16 +56,6 @@ Global Flags: -t, --target string bundle target to use (if applicable) --var strings set values for variables defined in project config. Example: --var="foo=bar" -=== The command is experimental and off by default - ->>> musterr [CLI] pipelines test --pipeline-id 1234 -Error: pipelines test is experimental. Set DATABRICKS_CLI_PIPELINES_TEST=true to enable it - -=== With the command off, an older report is still replaced - ->>> musterr [CLI] pipelines test --pipeline-id 1234 --junit-xml out.gate-off.xml -Error: pipelines test is experimental. Set DATABRICKS_CLI_PIPELINES_TEST=true to enable it - === pytest arguments must be passed with --pytest-arg >>> musterr [CLI] pipelines test --pipeline-id 1234 -k orders diff --git a/acceptance/pipelines/test/arguments/script b/acceptance/pipelines/test/arguments/script index ceb54ec432e..a18c49b0d2d 100644 --- a/acceptance/pipelines/test/arguments/script +++ b/acceptance/pipelines/test/arguments/script @@ -1,12 +1,5 @@ trace $CLI pipelines test --help -title "The command is experimental and off by default" -(unset DATABRICKS_CLI_PIPELINES_TEST; trace musterr $CLI pipelines test --pipeline-id 1234) - -title "With the command off, an older report is still replaced" -echo '' > out.gate-off.xml -(unset DATABRICKS_CLI_PIPELINES_TEST; trace musterr $CLI pipelines test --pipeline-id 1234 --junit-xml out.gate-off.xml) - title "pytest arguments must be passed with --pytest-arg" trace musterr $CLI pipelines test --pipeline-id 1234 -k orders trace musterr $CLI pipelines test --pipeline-id 1234 -- -k orders diff --git a/acceptance/pipelines/test/immutable/databricks.yml b/acceptance/pipelines/test/immutable/databricks.yml index 483234d0dd4..7f9a598cea2 100644 --- a/acceptance/pipelines/test/immutable/databricks.yml +++ b/acceptance/pipelines/test/immutable/databricks.yml @@ -11,3 +11,7 @@ resources: libraries: - file: path: pipeline_file.py + testing: + sources: + - glob: + include: ./tests/** diff --git a/acceptance/pipelines/test/immutable/output.txt b/acceptance/pipelines/test/immutable/output.txt index 27c6cd2712e..5996cdd714c 100644 --- a/acceptance/pipelines/test/immutable/output.txt +++ b/acceptance/pipelines/test/immutable/output.txt @@ -50,6 +50,7 @@ Update: [UUID][2] "method": "POST", "path": "/api/2.0/pipelines/[UUID][0]/updates", "body": { - "test_only": true + "test_only": true, + "test_options": {} } } diff --git a/acceptance/pipelines/test/no-test-sources/databricks.yml b/acceptance/pipelines/test/no-test-sources/databricks.yml new file mode 100644 index 00000000000..708fd010d78 --- /dev/null +++ b/acceptance/pipelines/test/no-test-sources/databricks.yml @@ -0,0 +1,10 @@ +bundle: + name: test-pipeline-test-no-test-sources + +resources: + pipelines: + my_pipeline: + name: test-pipeline-test-no-test-sources + libraries: + - file: + path: pipeline_file.py diff --git a/acceptance/pipelines/test/no-test-sources/out.test.toml b/acceptance/pipelines/test/no-test-sources/out.test.toml new file mode 100644 index 00000000000..18b1a88417e --- /dev/null +++ b/acceptance/pipelines/test/no-test-sources/out.test.toml @@ -0,0 +1 @@ +Cloud = false diff --git a/acceptance/pipelines/test/no-test-sources/output.txt b/acceptance/pipelines/test/no-test-sources/output.txt new file mode 100644 index 00000000000..a5932edae92 --- /dev/null +++ b/acceptance/pipelines/test/no-test-sources/output.txt @@ -0,0 +1,17 @@ + +>>> [CLI] pipelines deploy +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-pipeline-test-no-test-sources/default/files... +Created pipelines.my_pipeline +Files: 3 uploaded, 0 deleted +Resources: 1 created, 0 changed, 0 deleted, 0 unchanged +View your pipeline my_pipeline here: [DATABRICKS_URL]/pipelines/[UUID]?w=[WORKSPACE_ID] + +=== The bundle now sets testing, so the service error comes with a hint to deploy + +>>> musterr [CLI] pipelines test --no-wait +Recommendation: This command runs the last deployed version of the code + +If you've made local changes, run 'databricks pipelines deploy' first to ensure they are included. + +Error: [PIPELINE_TEST_NO_TEST_SOURCES] The pipeline has no test sources. Set `testing.sources` to the test files or folders to run. +The bundle sets testing for my_pipeline, but the deployed pipeline has none. Run 'databricks pipelines deploy' first diff --git a/acceptance/pipelines/test/no-test-sources/pipeline_file.py b/acceptance/pipelines/test/no-test-sources/pipeline_file.py new file mode 100644 index 00000000000..4a7a3a1878e --- /dev/null +++ b/acceptance/pipelines/test/no-test-sources/pipeline_file.py @@ -0,0 +1,6 @@ +from pyspark import pipelines as dp + + +@dp.table +def orders(): + return spark.range(10) diff --git a/acceptance/pipelines/test/no-test-sources/script b/acceptance/pipelines/test/no-test-sources/script new file mode 100644 index 00000000000..fa7ee30b275 --- /dev/null +++ b/acceptance/pipelines/test/no-test-sources/script @@ -0,0 +1,11 @@ +# The pipeline is deployed before the bundle sets testing. +trace $CLI pipelines deploy +rm "$OUT_REQUESTS" +update_file.py databricks.yml " path: pipeline_file.py" " path: pipeline_file.py + testing: + sources: + - glob: + include: ./tests/**" + +title "The bundle now sets testing, so the service error comes with a hint to deploy" +trace musterr $CLI pipelines test --no-wait diff --git a/acceptance/pipelines/test/no-test-sources/test.toml b/acceptance/pipelines/test/no-test-sources/test.toml new file mode 100644 index 00000000000..c62a3b8ab00 --- /dev/null +++ b/acceptance/pipelines/test/no-test-sources/test.toml @@ -0,0 +1,10 @@ +# The deployed pipeline has no test sources. +[[Server]] +Pattern = "POST /api/2.0/pipelines/{pipeline_id}/updates" +Response.StatusCode = 400 +Response.Body = ''' +{ + "error_code": "INVALID_PARAMETER_VALUE", + "message": "[PIPELINE_TEST_NO_TEST_SOURCES] The pipeline has no test sources. Set `testing.sources` to the test files or folders to run." +} +''' diff --git a/acceptance/pipelines/test/no-test-sources/tests/test_orders.py b/acceptance/pipelines/test/no-test-sources/tests/test_orders.py new file mode 100644 index 00000000000..6058cdd0bba --- /dev/null +++ b/acceptance/pipelines/test/no-test-sources/tests/test_orders.py @@ -0,0 +1,6 @@ +def test_valid_order(): + assert True + + +def test_backfill(): + assert True diff --git a/acceptance/pipelines/test/not-enabled/out.not-enabled.xml b/acceptance/pipelines/test/not-enabled/out.not-enabled.xml new file mode 100644 index 00000000000..2e3314a1f21 --- /dev/null +++ b/acceptance/pipelines/test/not-enabled/out.not-enabled.xml @@ -0,0 +1,8 @@ + + + + + Pipeline testing is not enabled for this pipeline. Contact your Databricks account team to join the preview. + + + diff --git a/acceptance/pipelines/test/not-enabled/out.test.toml b/acceptance/pipelines/test/not-enabled/out.test.toml new file mode 100644 index 00000000000..18b1a88417e --- /dev/null +++ b/acceptance/pipelines/test/not-enabled/out.test.toml @@ -0,0 +1 @@ +Cloud = false diff --git a/acceptance/pipelines/test/not-enabled/output.txt b/acceptance/pipelines/test/not-enabled/output.txt new file mode 100644 index 00000000000..da81ba5cd34 --- /dev/null +++ b/acceptance/pipelines/test/not-enabled/output.txt @@ -0,0 +1,15 @@ + +=== Where the testing API is off, a run of all tests is rejected, not run as an older test-only update + +>>> musterr [CLI] pipelines test --pipeline-id [UUID] --junit-xml out.not-enabled.xml +Error: Pipeline testing is not enabled for this pipeline. Contact your Databricks account team to join the preview. + +>>> print_requests.py //updates +{ + "method": "POST", + "path": "/api/2.0/pipelines/[UUID]/updates", + "body": { + "test_only": true, + "test_options": {} + } +} diff --git a/acceptance/pipelines/test/not-enabled/script b/acceptance/pipelines/test/not-enabled/script new file mode 100644 index 00000000000..053924a20d4 --- /dev/null +++ b/acceptance/pipelines/test/not-enabled/script @@ -0,0 +1,6 @@ +pipeline_id=$($CLI pipelines create --json '{"name": "orders", "root_path": "/Workspace/Users/someone@example.com/orders"}' | jq -r .pipeline_id) +rm "$OUT_REQUESTS" + +title "Where the testing API is off, a run of all tests is rejected, not run as an older test-only update" +trace musterr $CLI pipelines test --pipeline-id $pipeline_id --junit-xml out.not-enabled.xml +trace print_requests.py //updates diff --git a/acceptance/pipelines/test/not-enabled/test.toml b/acceptance/pipelines/test/not-enabled/test.toml new file mode 100644 index 00000000000..ce53b5dd9fb --- /dev/null +++ b/acceptance/pipelines/test/not-enabled/test.toml @@ -0,0 +1,11 @@ +# The service rejects a request with test_options where the testing API is off. The test server +# does not model that per-workspace setting, so the response is stubbed. +[[Server]] +Pattern = "POST /api/2.0/pipelines/{pipeline_id}/updates" +Response.Body = ''' +{ + "error_code": "INVALID_PARAMETER_VALUE", + "message": "Pipeline testing is not enabled for this pipeline. Contact your Databricks account team to join the preview." +} +''' +Response.StatusCode = 400 diff --git a/acceptance/pipelines/test/run-control/timeout/out.report.xml b/acceptance/pipelines/test/run-control/timeout/out.report.xml index 3f8b855a58d..68bd8d6ca42 100644 --- a/acceptance/pipelines/test/run-control/timeout/out.report.xml +++ b/acceptance/pipelines/test/run-control/timeout/out.report.xml @@ -5,7 +5,7 @@ - stopped waiting for update [UUID][1] after 1s; the update keeps running, to get its results run: databricks pipelines test --pipeline-id [UUID][0] --junit-xml out.report.xml --resume [UUID][1] Update: [UUID][1] + stopped waiting for update [UUID][1] after 3s; the update keeps running, to get its results run: databricks pipelines test --pipeline-id [UUID][0] --junit-xml out.report.xml --resume [UUID][1] Update: [UUID][1] diff --git a/acceptance/pipelines/test/run-control/timeout/output.txt b/acceptance/pipelines/test/run-control/timeout/output.txt index b7eac150675..de059de581b 100644 --- a/acceptance/pipelines/test/run-control/timeout/output.txt +++ b/acceptance/pipelines/test/run-control/timeout/output.txt @@ -1,9 +1,9 @@ === --timeout stops waiting but not the update, and prints the command that reads the results ->>> musterr [CLI] pipelines test --pipeline-id [UUID][0] --resume [UUID][1] --timeout 1s --junit-xml out.report.xml +>>> musterr [CLI] pipelines test --pipeline-id [UUID][0] --resume [UUID][1] --timeout 3s --junit-xml out.report.xml Pipeline: [UUID][0] Update: [UUID][1] Running tests... JUnit report: out.report.xml -Error: stopped waiting for update [UUID][1] after 1s; the update keeps running, to get its results run: databricks pipelines test --pipeline-id [UUID][0] --junit-xml out.report.xml --resume [UUID][1] +Error: stopped waiting for update [UUID][1] after 3s; the update keeps running, to get its results run: databricks pipelines test --pipeline-id [UUID][0] --junit-xml out.report.xml --resume [UUID][1] diff --git a/acceptance/pipelines/test/run-control/timeout/script b/acceptance/pipelines/test/run-control/timeout/script index b95c8689fdd..4bb032def3d 100644 --- a/acceptance/pipelines/test/run-control/timeout/script +++ b/acceptance/pipelines/test/run-control/timeout/script @@ -1,2 +1,2 @@ title "--timeout stops waiting but not the update, and prints the command that reads the results" -trace musterr $CLI pipelines test --pipeline-id $pipeline_id --resume 00000000-0000-0000-0000-0000000000a1 --timeout 1s --junit-xml out.report.xml +trace musterr $CLI pipelines test --pipeline-id $pipeline_id --resume 00000000-0000-0000-0000-0000000000a1 --timeout 3s --junit-xml out.report.xml diff --git a/acceptance/pipelines/test/selection/databricks.yml b/acceptance/pipelines/test/selection/databricks.yml index 0cf849a7919..ea0662b1043 100644 --- a/acceptance/pipelines/test/selection/databricks.yml +++ b/acceptance/pipelines/test/selection/databricks.yml @@ -8,3 +8,7 @@ resources: libraries: - file: path: pipeline_file.py + testing: + sources: + - glob: + include: ./tests/** diff --git a/acceptance/pipelines/test/selection/output.txt b/acceptance/pipelines/test/selection/output.txt index a4fab81a602..d989fede538 100644 --- a/acceptance/pipelines/test/selection/output.txt +++ b/acceptance/pipelines/test/selection/output.txt @@ -21,7 +21,8 @@ Update: [UUID][1] "method": "POST", "path": "/api/2.0/pipelines/[UUID][0]/updates", "body": { - "test_only": true + "test_only": true, + "test_options": {} } } diff --git a/acceptance/pipelines/test/submit-error/output.txt b/acceptance/pipelines/test/submit-error/output.txt index 2bc638a6fcc..2951c9b22c2 100644 --- a/acceptance/pipelines/test/submit-error/output.txt +++ b/acceptance/pipelines/test/submit-error/output.txt @@ -10,6 +10,7 @@ Wait for it to finish, or pass its update ID to --resume to read its results "method": "POST", "path": "/api/2.0/pipelines/[UUID][0]/updates", "body": { - "test_only": true + "test_only": true, + "test_options": {} } } diff --git a/acceptance/pipelines/test/test.toml b/acceptance/pipelines/test/test.toml index 66f23523071..4a1a3bb8f55 100644 --- a/acceptance/pipelines/test/test.toml +++ b/acceptance/pipelines/test/test.toml @@ -1,4 +1,2 @@ RecordRequests = true Ignore = ['.databricks'] -# The command is experimental; the gate case in arguments turns it off. -Env.DATABRICKS_CLI_PIPELINES_TEST = "true" diff --git a/cmd/pipelines/test.go b/cmd/pipelines/test.go index 9e3e9aa1426..3b1fce0f944 100644 --- a/cmd/pipelines/test.go +++ b/cmd/pipelines/test.go @@ -25,7 +25,6 @@ import ( "github.com/databricks/cli/cmd/root" "github.com/databricks/cli/libs/cmdctx" "github.com/databricks/cli/libs/cmdgroup" - "github.com/databricks/cli/libs/env" "github.com/databricks/cli/libs/flags" "github.com/databricks/cli/libs/logdiag" "github.com/databricks/cli/libs/shellquote" @@ -36,18 +35,16 @@ import ( "github.com/spf13/pflag" ) -// newStartTestUpdateRequest returns the Start Update request of a test run. +// newStartTestUpdateRequest returns the Start Update request of a test run. It always sends +// test_options, empty to run every test: only a request with test_options is rejected where the +// testing API is off; without them, the service runs its older test-only update instead. func newStartTestUpdateRequest(selection, pytestArgs []string) pipelines.StartUpdate { - req := pipelines.StartUpdate{TestOnly: true} - if len(selection) > 0 || len(pytestArgs) > 0 { - req.TestOptions = &pipelines.PipelineTestOptions{TestSelection: selection, PytestArgs: pytestArgs} + return pipelines.StartUpdate{ + TestOnly: true, + TestOptions: &pipelines.PipelineTestOptions{TestSelection: selection, PytestArgs: pytestArgs}, } - return req } -// pipelinesTestEnvVar enables the experimental pipelines test command. -const pipelinesTestEnvVar = "DATABRICKS_CLI_PIPELINES_TEST" - const pytestArgHint = "pass pytest arguments with --pytest-arg, for example --pytest-arg=-k --pytest-arg='orders and not slow'" // validatePytestArgs accepts only -k and -m, each followed by its value in the next argument, as the API @@ -232,6 +229,23 @@ func startTestUpdate(ctx context.Context, w *databricks.WorkspaceClient, pipelin return response.UpdateId, nil } +// pipelineTestNoTestSources is the error class of Start Update for a pipeline without testing.sources. +const pipelineTestNoTestSources = "PIPELINE_TEST_NO_TEST_SOURCES" + +// withDeployHint adds a hint to deploy when Start Update says the pipeline has no test sources but +// the bundle sets testing: the bundle was changed after its last deploy. +func withDeployHint(cmd *cobra.Command, t testTarget, err error) error { + apiErr, ok := errors.AsType[*apierr.APIError](err) + if !t.bundleHasTesting || !ok { + return err + } + // The class is the error code or, for errors with a generic code, the [CLASS] prefix of the message. + if apiErr.ErrorCode != pipelineTestNoTestSources && !strings.Contains(apiErr.Message, pipelineTestNoTestSources) { + return err + } + return fmt.Errorf("%w\nThe bundle sets testing for %s, but the deployed pipeline has none. Run '%s deploy' first", err, t.key, cmd.Parent().CommandPath()) +} + // testTarget is the pipeline a test run is submitted to. type testTarget struct { key string @@ -239,6 +253,9 @@ type testTarget struct { selections []string w *databricks.WorkspaceClient + // bundleHasTesting is true when the bundle sets testing for the pipeline. + bundleHasTesting bool + // projectFolder is the deployed folder that test IDs are shown relative to: the bundle's // synchronized files, or root_path. It is "" when unknown. projectFolder string @@ -338,7 +355,15 @@ func resolveTestTargetInBundle(cmd *cobra.Command, args []string, resume bool) ( if err != nil { return testTarget{}, err } - return testTarget{key: key, pipelineID: pipelineID, selections: selections, w: b.WorkspaceClient(ctx), projectFolder: filesRoot}, nil + pipeline := b.Config.Resources.Pipelines[key] + return testTarget{ + key: key, + pipelineID: pipelineID, + selections: selections, + w: b.WorkspaceClient(ctx), + bundleHasTesting: pipeline != nil && pipeline.Testing != nil, + projectFolder: filesRoot, + }, nil } // resumeCommand returns the command that reads the result of the update later. It keeps the @@ -542,9 +567,6 @@ type testFlags struct { // checkTestFlags rejects the flag combinations that pipelines test does not support, before any API call. func checkTestFlags(cmd *cobra.Command, args []string, f testFlags) error { - if enabled, _ := env.GetBool(cmd.Context(), pipelinesTestEnvVar); !enabled { - return fmt.Errorf("pipelines test is experimental. Set %s=true to enable it", pipelinesTestEnvVar) - } if cmd.ArgsLenAtDash() >= 0 { return errors.New("the -- separator is not supported: " + pytestArgHint) } @@ -614,11 +636,9 @@ func notPipelineKeyError(cmd *cobra.Command, b *bundle.Bundle, key string, args func testCommand() *cobra.Command { cmd := &cobra.Command{ Use: "test [flags] [KEY] [TEST_SELECTION...]", - Short: "*Experimental* Run the tests of a pipeline", + Short: "*Beta* Run the tests of a pipeline", Long: `Run the tests of a pipeline in a test-only update. -This command is experimental. Set DATABRICKS_CLI_PIPELINES_TEST=true to enable it. - KEY is the unique name of the pipeline, as defined in its YAML file. It is required when test selections are given. If there is only one pipeline in the project and no arguments are given, it is selected automatically. @@ -718,7 +738,7 @@ of the deployed snapshot, which changes with each deployment.`, req := newStartTestUpdateRequest(target.selections, f.pytestArgs) updateID, err = startTestUpdate(ctx, target.w, target.pipelineID, req) if err != nil { - return report.failed(ctx, withActiveUpdateHint(cmd, target, err)) + return report.failed(ctx, withDeployHint(cmd, target, withActiveUpdateHint(cmd, target, err))) } } else if err := checkTestUpdate(ctx, target.w, target.pipelineID, updateID); err != nil { return report.failed(ctx, err) diff --git a/cmd/pipelines/test_test.go b/cmd/pipelines/test_test.go index 51553b161bd..7dc99d66cb6 100644 --- a/cmd/pipelines/test_test.go +++ b/cmd/pipelines/test_test.go @@ -3,6 +3,7 @@ package pipelines import ( "bytes" "context" + "encoding/json" "errors" "net/http" "net/http/httptest" @@ -81,7 +82,12 @@ func TestResolveTestSelections(t *testing.T) { } func TestNewStartTestUpdateRequest(t *testing.T) { - assert.Equal(t, pipelines.StartUpdate{TestOnly: true}, newStartTestUpdateRequest(nil, nil)) + all := newStartTestUpdateRequest(nil, nil) + assert.Equal(t, pipelines.StartUpdate{TestOnly: true, TestOptions: &pipelines.PipelineTestOptions{}}, all) + // An empty test_options must reach the service, where it is rejected if the testing API is off. + body, err := json.Marshal(all) + require.NoError(t, err) + assert.JSONEq(t, `{"test_only": true, "test_options": {}}`, string(body)) assert.Equal(t, pipelines.StartUpdate{ TestOnly: true, TestOptions: &pipelines.PipelineTestOptions{TestSelection: []string{"/Workspace/tests"}, PytestArgs: []string{"-k", "orders"}}, @@ -137,6 +143,23 @@ func TestNotPipelineKeyError(t *testing.T) { assert.EqualError(t, err, `"tests" is not a pipeline in this bundle, and the bundle has no pipelines`) } +func TestWithDeployHint(t *testing.T) { + parent := &cobra.Command{Use: "pipelines"} + cmd := &cobra.Command{Use: "test"} + parent.AddCommand(cmd) + noSources := &apierr.APIError{ErrorCode: "INVALID_PARAMETER_VALUE", Message: "[PIPELINE_TEST_NO_TEST_SOURCES] The pipeline has no test sources."} + withTesting := testTarget{key: "orders", bundleHasTesting: true} + + err := withDeployHint(cmd, withTesting, noSources) + assert.ErrorIs(t, err, noSources) + assert.EqualError(t, err, "[PIPELINE_TEST_NO_TEST_SOURCES] The pipeline has no test sources.\nThe bundle sets testing for orders, but the deployed pipeline has none. Run 'pipelines deploy' first") + + // No hint without testing in the bundle, or for another error. + assert.Same(t, error(noSources), withDeployHint(cmd, testTarget{key: "orders"}, noSources)) + conflict := &apierr.APIError{ErrorCode: "RESOURCE_CONFLICT", Message: "An active update already exists."} + assert.Same(t, error(conflict), withDeployHint(cmd, withTesting, conflict)) +} + func TestTestRunError(t *testing.T) { ev := newTestEvents(t) tests := []struct {