Skip to content

Commit

Permalink
fix: use execution names together with ids (#2801)
Browse files Browse the repository at this point in the history
* fix: use execution names together with ids

* fix: use execution name in commands

* docs: update docs for name instead of ids

* docs: update cli docs
  • Loading branch information
nicufk committed Dec 1, 2022
1 parent 2d6dde3 commit ee4471d
Show file tree
Hide file tree
Showing 86 changed files with 125 additions and 174 deletions.
12 changes: 6 additions & 6 deletions cmd/kubectl-testkube/commands/artifacts/artifacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ var (

func NewListArtifactsCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "artifact <executionID>",
Use: "artifact <executionName>",
Aliases: []string{"artifacts"},
Short: "List artifacts of the given execution ID",
Args: validator.ExecutionID,
Short: "List artifacts of the given execution name",
Args: validator.ExecutionName,
Run: func(cmd *cobra.Command, args []string) {
executionID = args[0]
cmd.SilenceUsage = true
Expand All @@ -42,7 +42,7 @@ func NewListArtifactsCmd() *cobra.Command {

func NewDownloadSingleArtifactsCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "single <executionID> <fileName> <destinationDir>",
Use: "single <executionName> <fileName> <destinationDir>",
Short: "download artifact",
Args: validator.ExecutionIDAndFileNames,
Run: func(cmd *cobra.Command, args []string) {
Expand All @@ -68,9 +68,9 @@ func NewDownloadSingleArtifactsCmd() *cobra.Command {

func NewDownloadAllArtifactsCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "all <executionID>",
Use: "all <executionName>",
Short: "download artifacts",
Args: validator.ExecutionID,
Args: validator.ExecutionName,
Run: func(cmd *cobra.Command, args []string) {
executionID := args[0]
client, _ := common.GetClient(cmd)
Expand Down
4 changes: 2 additions & 2 deletions cmd/kubectl-testkube/commands/common/validator/executionid.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"github.com/spf13/cobra"
)

func ExecutionID(cmd *cobra.Command, args []string) error {
func ExecutionName(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return errors.New("please pass execution ID as argument")
return errors.New("please pass execution name as argument")
}
return nil
}
14 changes: 7 additions & 7 deletions cmd/kubectl-testkube/commands/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func NewDownloadCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "download <resource>",
Short: "Artifacts management commands",
Args: validator.ExecutionID,
Args: validator.ExecutionName,
Run: func(cmd *cobra.Command, args []string) {
err := cmd.Help()
ui.PrintOnError("Displaying help", err)
Expand All @@ -41,9 +41,9 @@ func NewDownloadCmd() *cobra.Command {

func NewListArtifactsCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "list <executionID>",
Short: "List artifacts of the given execution ID",
Args: validator.ExecutionID,
Use: "list <executionName>",
Short: "List artifacts of the given execution name",
Args: validator.ExecutionName,
Run: func(cmd *cobra.Command, args []string) {
executionID = args[0]
cmd.SilenceUsage = true
Expand All @@ -66,7 +66,7 @@ func NewListArtifactsCmd() *cobra.Command {

func NewDownloadSingleArtifactsCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "artifact <executionID> <fileName> <destinationDir>",
Use: "artifact <executionName> <fileName> <destinationDir>",
Short: "download artifact",
Args: validator.ExecutionIDAndFileNames,
Run: func(cmd *cobra.Command, args []string) {
Expand Down Expand Up @@ -95,10 +95,10 @@ func NewDownloadSingleArtifactsCmd() *cobra.Command {

func NewDownloadAllArtifactsCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "artifacts <executionID>",
Use: "artifacts <executionName>",
Aliases: []string{"a"},
Short: "download artifacts",
Args: validator.ExecutionID,
Args: validator.ExecutionName,
Run: func(cmd *cobra.Command, args []string) {
executionID := args[0]
client, _ := common.GetClient(cmd)
Expand Down
4 changes: 2 additions & 2 deletions cmd/kubectl-testkube/commands/tests/abort.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (

func NewAbortExecutionCmd() *cobra.Command {
return &cobra.Command{
Use: "execution <executionID>",
Use: "execution <executionName>",
Short: "Aborts execution of the test",
Args: validator.ExecutionID,
Args: validator.ExecutionName,
Run: func(cmd *cobra.Command, args []string) {
executionID := args[0]

Expand Down
4 changes: 2 additions & 2 deletions cmd/kubectl-testkube/commands/tests/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (

func NewWatchExecutionCmd() *cobra.Command {
return &cobra.Command{
Use: "execution <executionID>",
Use: "execution <executionName>",
Aliases: []string{"e", "executions"},
Short: "Watch logs output from executor pod",
Long: `Gets test execution details, until it's in success/error state, blocks until gets complete state`,
Args: validator.ExecutionID,
Args: validator.ExecutionName,
Run: func(cmd *cobra.Command, args []string) {
client, _ := common.GetClient(cmd)

Expand Down
4 changes: 2 additions & 2 deletions cmd/kubectl-testkube/commands/testsuites/abort.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (

func NewAbortTestSuiteExecutionCmd() *cobra.Command {
return &cobra.Command{
Use: "testsuiteexecution <executionID>",
Use: "testsuiteexecution <executionName>",
Aliases: []string{"tse", "testsuites-execution", "testsuite-execution"},
Short: "Abort test suite execution",
Args: validator.ExecutionID,
Args: validator.ExecutionName,
Run: func(cmd *cobra.Command, args []string) {
executionID := args[0]

Expand Down
4 changes: 2 additions & 2 deletions cmd/kubectl-testkube/commands/testsuites/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (

func NewWatchTestSuiteExecutionCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "testsuiteexecution <executionID>",
Use: "testsuiteexecution <executionName>",
Aliases: []string{"tse", "testsuites-execution", "testsuite-execution"},
Short: "Watch test suite",
Long: `Watch test suite by execution ID, returns results to console`,
Args: validator.ExecutionID,
Args: validator.ExecutionName,
Run: func(cmd *cobra.Command, args []string) {

client, _ := common.GetClient(cmd)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/5-cli-reference/kubectl-testkube.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ kubectl-testkube [flags]
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
-h, --help help for kubectl-testkube
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/5-cli-reference/kubectl-testkube_abort.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ kubectl-testkube abort <resourceName> [flags]
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/5-cli-reference/kubectl-testkube_abort_execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Aborts execution of the test

```
kubectl-testkube abort execution <executionID> [flags]
kubectl-testkube abort execution <executionName> [flags]
```

### Options
Expand All @@ -18,7 +18,7 @@ kubectl-testkube abort execution <executionID> [flags]
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Abort test suite execution

```
kubectl-testkube abort testsuiteexecution <executionID> [flags]
kubectl-testkube abort testsuiteexecution <executionName> [flags]
```

### Options
Expand All @@ -18,7 +18,7 @@ kubectl-testkube abort testsuiteexecution <executionID> [flags]
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/5-cli-reference/kubectl-testkube_completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ See each sub-command's help for details on how to use the generated script.
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ kubectl-testkube completion bash
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ kubectl-testkube completion fish [flags]
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ kubectl-testkube completion powershell [flags]
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ kubectl-testkube completion zsh [flags]
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/5-cli-reference/kubectl-testkube_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ kubectl-testkube config <feature> <value> [flags]
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ kubectl-testkube config api-uri <value> [flags]
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ kubectl-testkube config namespace <value> [flags]
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/5-cli-reference/kubectl-testkube_config_oauth.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ kubectl-testkube config oauth <value> [flags]
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ kubectl-testkube create-ticket [flags]
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/5-cli-reference/kubectl-testkube_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ kubectl-testkube create <resourceName> [flags]
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ kubectl-testkube create executor [flags]
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--crd-only generate only crd
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/5-cli-reference/kubectl-testkube_create_test.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ kubectl-testkube create test [flags]
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--crd-only generate only crd
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ kubectl-testkube create testsource [flags]
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--crd-only generate only crd
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ kubectl-testkube create testsuite [flags]
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--crd-only generate only crd
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ kubectl-testkube create webhook [flags]
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--crd-only generate only crd
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/5-cli-reference/kubectl-testkube_dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ kubectl-testkube dashboard [flags]
```
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/5-cli-reference/kubectl-testkube_debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ kubectl-testkube debug [flags]
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/5-cli-reference/kubectl-testkube_debug_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ kubectl-testkube debug info [flags]
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct (default "proxy")
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose show additional debug messages
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/5-cli-reference/kubectl-testkube_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ kubectl-testkube delete <resourceName> [flags]

```
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
```

### SEE ALSO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ kubectl-testkube delete executor [executorName] [flags]
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string Client used for connecting to testkube API one of proxy|direct (default "proxy")
--namespace string kubernetes namespace (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose should I show additional debug messages
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/5-cli-reference/kubectl-testkube_delete_test.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ kubectl-testkube delete test [testName] [flags]
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string Client used for connecting to testkube API one of proxy|direct (default "proxy")
--namespace string kubernetes namespace (default "testkube")
--oauth-enabled enable oauth
--oauth-enabled enable oauth (default true)
--verbose should I show additional debug messages
```

Expand Down

0 comments on commit ee4471d

Please sign in to comment.