Skip to content

Commit

Permalink
chore: rename testsuite to test and scripts to tests - commands
Browse files Browse the repository at this point in the history
  • Loading branch information
exu committed Feb 10, 2022
1 parent 2a7f814 commit b7c80e4
Show file tree
Hide file tree
Showing 58 changed files with 999 additions and 998 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,22 @@ test-e2e-namespace:

create-examples:
kubectl delete script testkube-dashboard -ntestkube || true
kubectl testkube scripts create --uri https://github.com/kubeshop/testkube-dashboard.git --git-path test --git-branch main --name testkube-dashboard --type cypress/project
kubectl testkube tests create --uri https://github.com/kubeshop/testkube-dashboard.git --git-path test --git-branch main --name testkube-dashboard --type cypress/project
kubectl delete script testkube-todo-frontend -ntestkube || true
kubectl testkube scripts create --git-branch main --uri https://github.com/kubeshop/testkube-example-cypress-project.git --git-path "cypress" --name testkube-todo-frontend --type cypress/project
kubectl testkube tests create --git-branch main --uri https://github.com/kubeshop/testkube-example-cypress-project.git --git-path "cypress" --name testkube-todo-frontend --type cypress/project
kubectl delete script testkube-todo-api -ntestkube || true
kubectl testkube scripts create --file test/e2e/TODO.postman_collection.json --name testkube-todo-api
kubectl testkube tests create --file test/e2e/TODO.postman_collection.json --name testkube-todo-api
kubectl delete script kubeshop-site -ntestkube || true
kubectl testkube scripts create --file test/e2e/Kubeshop.postman_collection.json --name kubeshop-site
kubectl testkube tests create --file test/e2e/Kubeshop.postman_collection.json --name kubeshop-site
kubectl delete test testkube-global-test -ntestkube || true
cat test/e2e/test-example-1.json | kubectl testkube tests create --name testkube-global-test
cat test/e2e/test-example-1.json | kubectl testkube testsuites create --name testkube-global-test
kubectl delete test kubeshop-sites-test -ntestkube || true
cat test/e2e/test-example-2.json | kubectl testkube tests create --name kubeshop-sites-test
cat test/e2e/test-example-2.json | kubectl testkube testsuites create --name kubeshop-sites-test


test-reload-sanity-script:
kubectl delete script sanity -ntestkube || true
kubectl testkube scripts create -f test/e2e/Testkube-Sanity.postman_collection.json --name sanity
kubectl testkube tests create -f test/e2e/Testkube-Sanity.postman_collection.json --name sanity


# test local api server intance - need local-postman/collection type registered to local postman executor
Expand All @@ -97,7 +97,7 @@ test-api-port-forwarded:

# run script by testkube plugin
test-api-on-cluster:
kubectl testkube scripts start sanity -f -p api_uri=http://testkube-api-server:8088 -p script_api_uri=http://testkube-api-server:8088 -p script_type=postman/collection -p script_name=fill-me -p execution_name=fill-me
kubectl testkube tests start sanity -f -p api_uri=http://testkube-api-server:8088 -p script_api_uri=http://testkube-api-server:8088 -p script_type=postman/collection -p script_name=fill-me -p execution_name=fill-me


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

"github.com/kubeshop/testkube/cmd/kubectl-testkube/commands/common"
"github.com/kubeshop/testkube/cmd/kubectl-testkube/commands/common/validator"
"github.com/kubeshop/testkube/cmd/kubectl-testkube/commands/scripts"
"github.com/kubeshop/testkube/cmd/kubectl-testkube/commands/tests"
"github.com/kubeshop/testkube/pkg/ui"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -110,7 +110,7 @@ func NewDownloadAllArtifactsCmd() *cobra.Command {
Run: func(cmd *cobra.Command, args []string) {
executionID := args[0]
client, _ := common.GetClient(cmd)
scripts.DownloadArtifacts(executionID, downloadDir, client)
tests.DownloadArtifacts(executionID, downloadDir, client)
},
}

Expand Down
16 changes: 0 additions & 16 deletions cmd/kubectl-testkube/commands/common/validator/scriptname.go

This file was deleted.

4 changes: 2 additions & 2 deletions cmd/kubectl-testkube/commands/common/validator/testname.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
)

func TestName(cmd *cobra.Command, args []string) error {
// TODO validate test name as valid kubernetes resource name
// TODO validate script name as valid kubernetes resource name

if len(args) < 1 {
return errors.New("please pass valid test-name")
return errors.New("please pass valid script-name")
}
return nil
}
16 changes: 16 additions & 0 deletions cmd/kubectl-testkube/commands/common/validator/testsuitename.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package validator

import (
"errors"

"github.com/spf13/cobra"
)

func TestSuiteName(cmd *cobra.Command, args []string) error {
// TODO validate test name as valid kubernetes resource name

if len(args) < 1 {
return errors.New("please pass valid test-name")
}
return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (

func NewCRDScriptsCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "scripts <manifestDirectory>",
Short: "Generate scripts CRD file based on directory",
Long: `Generate scripts manifest based on directory (e.g. for ArgoCD sync based on scripts files)`,
Use: "tests <manifestDirectory>",
Short: "Generate tests CRD file based on directory",
Long: `Generate tests manifest based on directory (e.g. for ArgoCD sync based on tests files)`,
Args: validator.ManifestsDirectory,
Run: func(cmd *cobra.Command, args []string) {
var err error
Expand Down
2 changes: 1 addition & 1 deletion cmd/kubectl-testkube/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func init() {
RootCmd.AddCommand(NewDashboardCmd())
RootCmd.AddCommand(NewExecutorsCmd())
RootCmd.AddCommand(NewArtifactsCmd())
RootCmd.AddCommand(NewTestsCmd())
RootCmd.AddCommand(NewTestSuitesCmd())
RootCmd.AddCommand(NewMigrateCmd())
}

Expand Down
204 changes: 0 additions & 204 deletions cmd/kubectl-testkube/commands/scripts/common.go

This file was deleted.

67 changes: 0 additions & 67 deletions cmd/kubectl-testkube/commands/scripts/create.go

This file was deleted.

0 comments on commit b7c80e4

Please sign in to comment.