From ef406ac10464c60852f84b5ad5f0048dc21b8965 Mon Sep 17 00:00:00 2001 From: hazelmayank Date: Wed, 27 May 2026 02:02:22 +0530 Subject: [PATCH] feat(test): document required positional args and use cobra.ExactArgs Signed-off-by: hazelmayank --- cmd/test.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/cmd/test.go b/cmd/test.go index 2d76db5..a20addf 100644 --- a/cmd/test.go +++ b/cmd/test.go @@ -41,13 +41,23 @@ func NewTestCommand(globalClientOpts *connectors.ClientOptions) *cobra.Command { oAuth2Context string ) var testCmd = &cobra.Command{ - Use: "test ", Short: "Run tests on Microcks", - Long: `Run tests on Microcks`, - Args: cobra.ExactArgs(3), + Long: `Run a test on a Microcks server against a deployed implementation. + +Required arguments: + Service reference, e.g. "Beer Catalog API:0.9". + URL of the deployed implementation under test. + Test strategy. One of: HTTP, SOAP_HTTP, SOAP_UI, + POSTMAN, OPEN_API_SCHEMA, ASYNC_API_SCHEMA, + GRPC_PROTOBUF, GRAPHQL_SCHEMA.`, + Example: ` microcks test "Beer Catalog API:0.9" http://my-service/api/ POSTMAN \ + --microcksURL=http://microcks.example.com/api \ + --keycloakClientId=microcks-serviceaccount \ + --keycloakClientSecret= \ + --waitFor=10sec`, + Args: cobra.ExactArgs(3), Run: func(cmd *cobra.Command, args []string) { - serviceRef := args[0] testEndpoint := args[1] runnerType := args[2]