diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2021-11-26 14:23:12 +0100 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2021-11-26 14:23:12 +0100 |
commit | 1bca1eac3c8bb8375976266593274f0ce158b634 (patch) | |
tree | e77c624343204cfd90ab9a544d4d9d32812662e0 /client | |
parent | 18ff7302d149f0c47f547b09c280e34a1b9ebff7 (diff) |
Verify test count > 0 for submit too
Diffstat (limited to 'client')
-rw-r--r-- | client/go/cmd/test.go | 6 | ||||
-rw-r--r-- | client/go/cmd/test_test.go | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/client/go/cmd/test.go b/client/go/cmd/test.go index e8fac8de699..8122c321cdc 100644 --- a/client/go/cmd/test.go +++ b/client/go/cmd/test.go @@ -52,9 +52,6 @@ $ vespa test src/test/application/tests/system-test/feed-and-query.json`, fmt.Fprintln(stdout, test) } exitFunc(3) - } else if count == 0 { - fmt.Fprintf(stdout, "Failed to find any tests at %v\n", testPath) - exitFunc(3) } else { plural := "s" if count == 1 { @@ -98,6 +95,9 @@ func runTests(rootPath string, target vespa.Target, dryRun bool) (int, []string) } count++ } + if count == 0 { + fatalErrHint(fmt.Errorf("Failed to find any tests at %s", rootPath), "See https://cloud.vespa.ai/en/reference/testing") + } return count, failed } diff --git a/client/go/cmd/test_test.go b/client/go/cmd/test_test.go index a75f5384a30..1e2805e3229 100644 --- a/client/go/cmd/test_test.go +++ b/client/go/cmd/test_test.go @@ -58,9 +58,8 @@ func TestTestWithoutAssertions(t *testing.T) { func TestSuiteWithoutTests(t *testing.T) { client := &mockHttpClient{} - outBytes, errBytes := execute(command{args: []string{"test", "testdata/tests/staging-test"}}, t, client) - assert.Equal(t, "Failed to find any tests at testdata/tests/staging-test\n", outBytes) - assert.Equal(t, "", errBytes) + _, errBytes := execute(command{args: []string{"test", "testdata/tests/staging-test"}}, t, client) + assert.Equal(t, "Error: Failed to find any tests at testdata/tests/staging-test\nHint: See https://cloud.vespa.ai/en/reference/testing\n", errBytes) } func TestSingleTest(t *testing.T) { |