aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2021-12-06 10:35:18 +0100
committerJon Marius Venstad <venstad@gmail.com>2021-12-06 10:35:18 +0100
commit3046682d8c63b6d4bc903b1584e11b435cbecf7a (patch)
tree809dc2446183d6d65cf67b0acd35ef02bbc5e4f6 /client
parent76a3908ea1d3475d36a7b2d15b867a18d7952862 (diff)
Require test or directory argument
Diffstat (limited to 'client')
-rw-r--r--client/go/cmd/test.go13
1 files changed, 5 insertions, 8 deletions
diff --git a/client/go/cmd/test.go b/client/go/cmd/test.go
index 7ba7a19b235..e9d5e571845 100644
--- a/client/go/cmd/test.go
+++ b/client/go/cmd/test.go
@@ -29,24 +29,20 @@ func init() {
}
var testCmd = &cobra.Command{
- Use: "test [tests directory or test file]",
+ Use: "test <tests directory or test file>",
Short: "Run a test suite, or a single test",
Long: `Run a test suite, or a single test
-Runs all JSON test files in the specified directory (the working
-directory by default), or the single JSON test file specified.
+Runs all JSON test files in the specified directory, or the single JSON test file specified.
See https://cloud.vespa.ai/en/reference/testing.html for details.`,
Example: `$ vespa test src/test/application/tests/system-test
$ vespa test src/test/application/tests/system-test/feed-and-query.json`,
- Args: cobra.MaximumNArgs(1),
+ Args: cobra.ExactArgs(1),
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) {
target := getTarget()
- testPath := "."
- if len(args) > 0 {
- testPath = args[0]
- }
+ testPath := args[0]
if count, failed := runTests(testPath, target, false); len(failed) != 0 {
plural := "s"
if count == 1 {
@@ -77,6 +73,7 @@ func runTests(rootPath string, target vespa.Target, dryRun bool) (int, []string)
if err != nil {
fatalErrHint(err, "See https://cloud.vespa.ai/en/reference/testing")
}
+
previousFailed := false
for _, test := range tests {
if !test.IsDir() && filepath.Ext(test.Name()) == ".json" {