From cb8b7968228bfc4581e8e63644784a7e97a67a69 Mon Sep 17 00:00:00 2001 From: nacal Date: Sat, 15 Feb 2025 23:20:29 +0900 Subject: [PATCH 01/10] create-spec runn --- src/runn.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/runn.ts diff --git a/src/runn.ts b/src/runn.ts new file mode 100644 index 000000000000..981b29ec5ff1 --- /dev/null +++ b/src/runn.ts @@ -0,0 +1,21 @@ +const completionSpec: Fig.Spec = { + name: "runn", + description: "A tool for running operations following a scenario", + subcommands: [ + { + name: "help", + description: "Help for runn", + }, + ], + options: [ + { + name: ["--help", "-h"], + description: "Help for runn", + }, + { + name: ["--version", "-v"], + description: "Version for runn", + }, + ], +}; +export default completionSpec; From 7ac1c6fdf6b54c79318dd66db99e43f09b5f6c8f Mon Sep 17 00:00:00 2001 From: nacal Date: Sat, 15 Feb 2025 23:21:32 +0900 Subject: [PATCH 02/10] add "completion" subcommand --- src/runn.ts | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/runn.ts b/src/runn.ts index 981b29ec5ff1..33781ba2319c 100644 --- a/src/runn.ts +++ b/src/runn.ts @@ -6,6 +6,52 @@ const completionSpec: Fig.Spec = { name: "help", description: "Help for runn", }, + { + name: "completion", + description: "Generate the autocompletion script for the specified shell", + subcommands: [ + { + name: "bash", + description: "Generate the autocompletion script for bash", + options: [ + { + name: "--no-descriptions", + description: "Disable completion descriptions", + }, + ], + }, + { + name: "fish", + description: "Generate the autocompletion script for fish", + options: [ + { + name: "--no-descriptions", + description: "Disable completion descriptions", + }, + ], + }, + { + name: "powershell", + description: "Generate the autocompletion script for powershell", + options: [ + { + name: "--no-descriptions", + description: "Disable completion descriptions", + }, + ], + }, + { + name: "zsh", + description: "Generate the autocompletion script for zsh", + options: [ + { + name: "--no-descriptions", + description: "Disable completion descriptions", + }, + ], + }, + ], + }, ], options: [ { From e3e43fdec350f75209b7749b46785af56513bce7 Mon Sep 17 00:00:00 2001 From: nacal Date: Sat, 15 Feb 2025 23:21:49 +0900 Subject: [PATCH 03/10] add "coverage" subcommand --- src/runn.ts | 155 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) diff --git a/src/runn.ts b/src/runn.ts index 33781ba2319c..8d5f201f6b2d 100644 --- a/src/runn.ts +++ b/src/runn.ts @@ -52,6 +52,161 @@ const completionSpec: Fig.Spec = { }, ], }, + { + name: "coverage", + description: + "Show coverage for paths/operations of OpenAPI spec and methods of protocol buffers", + options: [ + { + name: "--cache-dir", + description: "Specify cache directory for remote runbooks", + args: { + template: "folders", + }, + }, + { + name: "--debug", + description: "Debug", + }, + { + name: "--env-file", + description: "Load environment variables from a file", + args: { + template: "filepaths", + }, + }, + { + name: "--format", + description: "Format of result output", + args: { + suggestions: ["json", "none"], + }, + }, + { + name: "--grpc-buf-config", + description: "Set the path to buf.yaml for gRPC runners", + args: { + template: "filepaths", + }, + }, + { + name: "--grpc-buf-dir", + description: "Set the path to the buf directory for gRPC runners", + args: { + template: "folders", + }, + }, + { + name: "--grpc-buf-lock", + description: "Set the path to buf.lock for gRPC runners", + args: { + template: "filepaths", + }, + }, + { + name: "--grpc-buf-module", + description: + 'Set the buf modules for gRPC runners ("buf.build/owner/repository" or "buf.build/owner/repository/tree/branch-or-commit")', + args: { + name: "buf modules", + }, + }, + { + name: "--grpc-import-path", + description: + "Set the path to the directory where proto sources can be imported for gRPC runners", + args: { + template: "filepaths", + }, + }, + { + name: "--grpc-no-tls", + description: "Disable TLS use in all gRPC runners", + }, + { + name: "--grpc-proto", + description: "Set the name of proto source for gRPC runners", + args: { + name: "proto source", + }, + }, + { + name: ["-h", "--help"], + description: "Help for coverage", + }, + { + name: "--http-openapi3", + description: + 'Set the path to the OpenAPI v3 document for HTTP runners ("path/to/spec.yml" or "key:path/to/spec.yml")', + args: { + name: "filepaths", + }, + }, + { + name: "--id", + description: + "Run the matching runbooks in order if there is only one runbook with a forward matching ID", + args: { + name: "id", + }, + }, + { + name: "--label", + description: "Run all runbooks matching the label specification", + args: { + name: "label", + }, + }, + { + name: ["-l", "-long"], + description: "Long format", + }, + { + name: "--overlay", + description: "Overlay values on the runbook", + args: { + name: "values", + }, + }, + { + name: "--retain-cache-dir", + description: "Retain cache directory for remote runbooks", + }, + { + name: "--run", + description: + "Run all runbooks with a matching file path, treating the value passed to the option as an unanchored regular expression", + args: { + name: "path regex", + }, + }, + { + name: "--runner", + description: 'Set runner to runbook("key:dsn")', + args: { + name: "runner", + }, + }, + { + name: "--skip-included", + description: "Skip running the included runbook by itself", + }, + { + name: "--underlay", + description: "Lay values under the runbook", + args: { + name: "values", + }, + }, + { + name: "--var", + description: 'Set var to runbook("key:value")', + args: { + name: "value", + }, + }, + ], + }, ], options: [ { From 202728dc36e2c3026e8692ca41cdfc285651b97f Mon Sep 17 00:00:00 2001 From: nacal Date: Sat, 15 Feb 2025 23:39:05 +0900 Subject: [PATCH 04/10] add "list" subcommand --- src/runn.ts | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) diff --git a/src/runn.ts b/src/runn.ts index 8d5f201f6b2d..c36f96ba463e 100644 --- a/src/runn.ts +++ b/src/runn.ts @@ -207,6 +207,143 @@ const completionSpec: Fig.Spec = { }, ], }, + { + name: ["list", "ls"], + description: "List runbooks", + args: { + template: "filepaths", + }, + options: [ + { + name: "--cache-dir", + description: "Specify cache directory for remote runbooks", + args: { + template: "folders", + }, + }, + { + name: "--env-file", + description: "Load environment variables from a file", + args: { + template: "filepaths", + }, + }, + { + name: ["-h", "--help"], + description: "Help for list", + }, + { + name: "--id", + description: + "Run the matching runbooks in order if there is only one runbook with a forward matching ID", + args: { + name: "id", + }, + }, + { + name: "--label", + description: "Run all runbooks matching the label specification", + args: { + name: "label", + }, + }, + { + name: ["-l", "-long"], + description: "Long format", + }, + { + name: "--overlay", + description: "Overlay values on the runbook", + args: { + name: "values", + }, + }, + { + name: "--random", + description: "Run the specified number of runbooks at random", + args: { + name: "specified number", + }, + }, + { + name: "--retain-cache-dir", + description: "Retain cache directory for remote runbooks", + }, + { + name: "--run", + description: + "Run all runbooks with a matching file path, treating the value passed to the option as an unanchored regular expression", + args: { + name: "path regex", + }, + }, + { + name: "--runner", + description: 'Set runner to runbook("key:dsn")', + args: { + name: "runner", + }, + }, + { + name: "--sample", + description: "Sample the specified number of runbooks", + args: { + name: "specified number", + }, + }, + { + name: "--shard-index", + description: "Index of distributed runbooks", + args: { + name: "index", + }, + }, + { + name: "--shard-n", + description: "Number of shards for distributing runbooks", + args: { + name: "number", + }, + }, + { + name: "--shuffle", + description: "Randomize the order of running runbooks", + args: { + isOptional: true, + suggestions: [ + { + name: '"off"', + description: "(Default)", + }, + { + name: '"on"', + }, + { + name: "N", + }, + ], + }, + }, + { + name: "--skip-included", + description: "Skip running the included runbook by itself", + }, + { + name: "--underlay", + description: "Lay values under the runbook", + args: { + name: "values", + }, + }, + { + name: "--var", + description: 'Set var to runbook("key:value")', + args: { + name: "value", + }, + }, + ], + }, ], options: [ { From af9b2df4d13e1d757ecbc6c61e3b68011c2fafe9 Mon Sep 17 00:00:00 2001 From: nacal Date: Sat, 15 Feb 2025 23:55:28 +0900 Subject: [PATCH 05/10] add globalFlags --- src/runn.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/runn.ts b/src/runn.ts index c36f96ba463e..a369a51a434c 100644 --- a/src/runn.ts +++ b/src/runn.ts @@ -1,3 +1,25 @@ +const globalFlags: Fig.Option[] = [ + { + name: "--scopes", + description: "Additional scopes for runn", + args: { + suggestions: [ + { + name: "read:parent", + description: "Required for reading files above the working directory", + }, + { + name: "read:remote", + description: "Required for reading remote files", + }, + { + name: "run:exec", + description: "Required for running Exec runner", + }, + ], + }, + }, +]; const completionSpec: Fig.Spec = { name: "runn", description: "A tool for running operations following a scenario", @@ -5,6 +27,7 @@ const completionSpec: Fig.Spec = { { name: "help", description: "Help for runn", + options: [...globalFlags], }, { name: "completion", @@ -51,12 +74,14 @@ const completionSpec: Fig.Spec = { ], }, ], + options: [...globalFlags], }, { name: "coverage", description: "Show coverage for paths/operations of OpenAPI spec and methods of protocol buffers", options: [ + ...globalFlags, { name: "--cache-dir", description: "Specify cache directory for remote runbooks", @@ -214,6 +239,7 @@ const completionSpec: Fig.Spec = { template: "filepaths", }, options: [ + ...globalFlags, { name: "--cache-dir", description: "Specify cache directory for remote runbooks", From f36623f31bf7e5a0bd2f77a60f18d00e5e292cc8 Mon Sep 17 00:00:00 2001 From: nacal Date: Sun, 16 Feb 2025 21:23:53 +0900 Subject: [PATCH 06/10] add "loadt" subcommand --- src/runn.ts | 283 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 283 insertions(+) diff --git a/src/runn.ts b/src/runn.ts index a369a51a434c..657708c20eda 100644 --- a/src/runn.ts +++ b/src/runn.ts @@ -370,6 +370,287 @@ const completionSpec: Fig.Spec = { }, ], }, + { + name: ["loadt", "loadtest"], + description: "Run load test using runbooks", + args: { + template: "filepaths", + }, + options: [ + ...globalFlags, + { + name: "--cache-dir", + description: "Specify cache directory for remote runbooks", + args: { + template: "folders", + }, + }, + { + name: "--capture", + description: "Destination of runbook run capture results", + args: { + template: "folders", + }, + }, + { + name: "--concurrent", + description: "Run runbooks concurrently", + args: { + isOptional: true, + suggestions: [ + { + name: '"off"', + description: "(Default)", + }, + { + name: '"on"', + }, + { + name: "N", + }, + ], + }, + }, + { + name: "--debug", + description: "Debug", + }, + { + name: "--duration", + description: 'Load test running duration (default "10sec")', + args: { + name: "duration", + }, + }, + { + name: "--env-file", + description: "Load environment variables from a file", + args: { + template: "filepaths", + }, + }, + { + name: "fail-fast", + description: "Fail fast", + }, + { + name: "--grpc-buf-config", + description: "Set the path to buf.yaml for gRPC runners", + args: { + template: "filepaths", + }, + }, + { + name: "--grpc-buf-dir", + description: "Set the path to the buf directory for gRPC runners", + args: { + template: "folders", + }, + }, + { + name: "--grpc-buf-lock", + description: "Set the path to buf.lock for gRPC runners", + args: { + template: "filepaths", + }, + }, + { + name: "--grpc-buf-module", + description: + 'Set the buf modules for gRPC runners ("buf.build/owner/repository" or "buf.build/owner/repository/tree/branch-or-commit")', + args: { + name: "buf modules", + }, + }, + { + name: "--grpc-import-path", + description: + "Set the path to the directory where proto sources can be imported for gRPC runners", + args: { + template: "filepaths", + }, + }, + { + name: "--grpc-no-tls", + description: "Disable TLS use in all gRPC runners", + }, + { + name: "--grpc-proto", + description: "Set the name of proto source for gRPC runners", + args: { + name: "proto source", + }, + }, + { + name: ["-h", "--help"], + description: "Help for coverage", + }, + { + name: "--host-rules", + description: 'Host rules for runn. ("host rule,host rule,...")', + args: { + name: "host rules", + }, + }, + { + name: "--http-openapi3", + description: + 'Set the path to the OpenAPI v3 document for HTTP runners ("path/to/spec.yml" or "key:path/to/spec.yml")', + args: { + name: "filepaths", + }, + }, + { + name: "--id", + description: + "Run the matching runbooks in order if there is only one runbook with a forward matching ID", + args: { + name: "id", + }, + }, + { + name: "--label", + description: "Run all runbooks matching the label specification", + args: { + name: "label", + }, + }, + { + name: "--load-concurrent", + description: + "Number of concurrent load test runs. 0 means unlimited (default 1)", + args: { + name: "number", + }, + }, + { + name: "--max-rps", + description: + "Max RunN per second for load test. 0 means unlimited (default 1)", + args: { + name: "number", + }, + }, + { + name: "--overlay", + description: "Overlay values on the runbook", + args: { + name: "values", + }, + }, + { + name: "--random", + description: "Run the specified number of runbooks at random", + args: { + name: "specified number", + }, + }, + { + name: "--retain-cache-dir", + description: "Retain cache directory for remote runbooks", + }, + { + name: "--run", + description: + "Run all runbooks with a matching file path, treating the value passed to the option as an unanchored regular expression", + args: { + name: "path regex", + }, + }, + { + name: "--runner", + description: 'Set runner to runbook("key:dsn")', + args: { + name: "runner", + }, + }, + { + name: "--sample", + description: "Sample the specified number of runbooks", + args: { + name: "specified number", + }, + }, + { + name: "--shard-index", + description: "Index of distributed runbooks", + args: { + name: "index", + }, + }, + { + name: "--shard-n", + description: "Number of shards for distributing runbooks", + args: { + name: "number", + }, + }, + { + name: "--shuffle", + description: "Randomize the order of running runbooks", + args: { + isOptional: true, + suggestions: [ + { + name: '"off"', + description: "(Default)", + }, + { + name: '"on"', + }, + { + name: "N", + }, + ], + }, + }, + { + name: "--skip-included", + description: "Skip running the included runbook by itself", + }, + { + name: "--skip-test", + description: 'Skip "test:" section', + }, + { + name: "--threshold", + description: + "If this threshold condition is not met, loadt command returns exit status 1 (EXIT_FAILURE)", + args: { + name: "threshold", + }, + }, + { + name: "--underlay", + description: "Lay values under the runbook", + args: { + name: "values", + }, + }, + { + name: "--var", + description: 'Set var to runbook("key:value")', + args: { + name: "value", + }, + }, + { + name: "--wait-timeout", + description: + 'Timeout for waiting for cleanup process after running runbooks (default "10sec")', + args: { + name: "timeout", + }, + }, + { + name: "--warm-up", + description: 'Warn-up time for load test (default "5sec")', + args: { + name: "time", + }, + }, + ], + }, ], options: [ { @@ -383,3 +664,5 @@ const completionSpec: Fig.Spec = { ], }; export default completionSpec; + +// debug, env-file, --cache-dir From dd234b767dcafc098f93e46ee23b15fb0f00e38e Mon Sep 17 00:00:00 2001 From: nacal Date: Sun, 16 Feb 2025 21:27:41 +0900 Subject: [PATCH 07/10] add "new" subcommand --- src/runn.ts | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/runn.ts b/src/runn.ts index 657708c20eda..f93c8267e704 100644 --- a/src/runn.ts +++ b/src/runn.ts @@ -651,6 +651,54 @@ const completionSpec: Fig.Spec = { }, ], }, + { + name: ["new", "append"], + description: "Create new runbook or append step to runbook", + options: [ + ...globalFlags, + { + name: "--and-run", + description: "Run created runbook and capture the response for test", + }, + { + name: "--desc", + description: "Description of runbook", + args: { + name: "description", + }, + }, + { + name: "--grpc-import-path", + description: + "Set the path to the directory where proto sources can be imported for gRPC runners", + args: { + template: "filepaths", + }, + }, + { + name: "--grpc-no-tls", + description: "Disable TLS use in all gRPC runners", + }, + { + name: "--grpc-proto", + description: "Set the name of proto source for gRPC runners", + args: { + name: "proto source", + }, + }, + { + name: ["-h", "--help"], + description: "Help for coverage", + }, + { + name: "--out", + description: "Target path of runbook", + args: { + template: "folders", + }, + }, + ], + }, ], options: [ { From b7a8e0fc23b052f86bd47ae8f789750fbef8734d Mon Sep 17 00:00:00 2001 From: nacal Date: Sun, 16 Feb 2025 21:41:23 +0900 Subject: [PATCH 08/10] add "rprof" subcommand --- src/runn.ts | 91 ++++++++++++++++++++++++++--------------------------- 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/src/runn.ts b/src/runn.ts index f93c8267e704..394759695acc 100644 --- a/src/runn.ts +++ b/src/runn.ts @@ -333,21 +333,10 @@ const completionSpec: Fig.Spec = { }, { name: "--shuffle", - description: "Randomize the order of running runbooks", + description: + 'Randomize the order of running runbooks (default "off")', args: { - isOptional: true, - suggestions: [ - { - name: '"off"', - description: "(Default)", - }, - { - name: '"on"', - }, - { - name: "N", - }, - ], + suggestions: ["off", "on", "N"], }, }, { @@ -394,21 +383,9 @@ const completionSpec: Fig.Spec = { }, { name: "--concurrent", - description: "Run runbooks concurrently", + description: 'Run runbooks concurrently (default "off")', args: { - isOptional: true, - suggestions: [ - { - name: '"off"', - description: "(Default)", - }, - { - name: '"on"', - }, - { - name: "N", - }, - ], + suggestions: ["off", "on", "N"], }, }, { @@ -483,7 +460,7 @@ const completionSpec: Fig.Spec = { }, { name: ["-h", "--help"], - description: "Help for coverage", + description: "Help for loadt", }, { name: "--host-rules", @@ -587,21 +564,10 @@ const completionSpec: Fig.Spec = { }, { name: "--shuffle", - description: "Randomize the order of running runbooks", + description: + 'Randomize the order of running runbooks (default "off")', args: { - isOptional: true, - suggestions: [ - { - name: '"off"', - description: "(Default)", - }, - { - name: '"on"', - }, - { - name: "N", - }, - ], + suggestions: ["off", "on", "N"], }, }, { @@ -688,7 +654,7 @@ const completionSpec: Fig.Spec = { }, { name: ["-h", "--help"], - description: "Help for coverage", + description: "Help for new", }, { name: "--out", @@ -699,6 +665,41 @@ const completionSpec: Fig.Spec = { }, ], }, + { + name: ["rprof", "rrprof", "rrrprof", "prof"], + description: "Read the runbook run profile", + args: { + template: "filepaths", + }, + options: [ + ...globalFlags, + { + name: "--depth", + description: "Depth of profile (default 4)", + args: { + name: "depth", + }, + }, + { + name: ["-h", "--help"], + description: "Help for rprof", + }, + { + name: "--sort", + description: "Sort order", + args: { + suggestions: ["elapsed", "started-at", "stopped-at"], + }, + }, + { + name: "--unit", + description: 'Time unit(default "ms")', + args: { + suggestions: ["ns", "us", "ms", "s", "m"], + }, + }, + ], + }, ], options: [ { @@ -712,5 +713,3 @@ const completionSpec: Fig.Spec = { ], }; export default completionSpec; - -// debug, env-file, --cache-dir From 9a85237bd16426bd9730941ea0c0b02fa8204521 Mon Sep 17 00:00:00 2001 From: nacal Date: Sun, 16 Feb 2025 21:49:00 +0900 Subject: [PATCH 09/10] add "run" subcommand --- src/runn.ts | 252 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 251 insertions(+), 1 deletion(-) diff --git a/src/runn.ts b/src/runn.ts index 394759695acc..99e34a083924 100644 --- a/src/runn.ts +++ b/src/runn.ts @@ -407,7 +407,7 @@ const completionSpec: Fig.Spec = { }, }, { - name: "fail-fast", + name: "--fail-fast", description: "Fail fast", }, { @@ -700,6 +700,256 @@ const completionSpec: Fig.Spec = { }, ], }, + { + name: "run", + description: "Run scenarios of runbooks", + args: { + template: "filepaths", + }, + options: [ + ...globalFlags, + { + name: "-attach", + description: "Attach to runn process", + }, + { + name: "--cache-dir", + description: "Specify cache directory for remote runbooks", + args: { + template: "folders", + }, + }, + { + name: "--capture", + description: "Destination of runbook run capture results", + args: { + template: "folders", + }, + }, + { + name: "--concurrent", + description: 'Run runbooks concurrently (default "off")', + args: { + suggestions: ["off", "on", "N"], + }, + }, + { + name: "--debug", + description: "Debug", + }, + { + name: "--env-file", + description: "Load environment variables from a file", + args: { + template: "filepaths", + }, + }, + { + name: "--fail-fast", + description: "Fail fast", + }, + { + name: "--force--color", + description: "Force colorized output even in non-tty output streams", + }, + { + name: "--format", + description: "Format of result output", + args: { + suggestions: ["json", "none"], + }, + }, + { + name: "--grpc-buf-config", + description: "Set the path to buf.yaml for gRPC runners", + args: { + template: "filepaths", + }, + }, + { + name: "--grpc-buf-dir", + description: "Set the path to the buf directory for gRPC runners", + args: { + template: "folders", + }, + }, + { + name: "--grpc-buf-lock", + description: "Set the path to buf.lock for gRPC runners", + args: { + template: "filepaths", + }, + }, + { + name: "--grpc-buf-module", + description: + 'Set the buf modules for gRPC runners ("buf.build/owner/repository" or "buf.build/owner/repository/tree/branch-or-commit")', + args: { + name: "buf modules", + }, + }, + { + name: "--grpc-import-path", + description: + "Set the path to the directory where proto sources can be imported for gRPC runners", + args: { + template: "filepaths", + }, + }, + { + name: "--grpc-no-tls", + description: "Disable TLS use in all gRPC runners", + }, + { + name: "--grpc-proto", + description: "Set the name of proto source for gRPC runners", + args: { + name: "proto source", + }, + }, + { + name: ["-h", "--help"], + description: "Help for run", + }, + { + name: "--host-rules", + description: 'Host rules for runn. ("host rule,host rule,...")', + args: { + name: "host rules", + }, + }, + { + name: "--http-openapi3", + description: + 'Set the path to the OpenAPI v3 document for HTTP runners ("path/to/spec.yml" or "key:path/to/spec.yml")', + args: { + name: "filepaths", + }, + }, + { + name: "--id", + description: + "Run the matching runbooks in order if there is only one runbook with a forward matching ID", + args: { + name: "id", + }, + }, + { + name: "--label", + description: "Run all runbooks matching the label specification", + args: { + name: "label", + }, + }, + { + name: "--overlay", + description: "Overlay values on the runbook", + args: { + name: "values", + }, + }, + { + name: "--profile", + description: "Profile runs of runbooks", + }, + { + name: "--profile--out", + description: 'Profile output path (default "runn.prof")', + args: { + template: "filepaths", + }, + }, + { + name: "--random", + description: "Run the specified number of runbooks at random", + args: { + name: "specified number", + }, + }, + { + name: "--retain-cache-dir", + description: "Retain cache directory for remote runbooks", + }, + { + name: "--run", + description: + "Run all runbooks with a matching file path, treating the value passed to the option as an unanchored regular expression", + args: { + name: "path regex", + }, + }, + { + name: "--runner", + description: 'Set runner to runbook("key:dsn")', + args: { + name: "runner", + }, + }, + { + name: "--sample", + description: "Sample the specified number of runbooks", + args: { + name: "specified number", + }, + }, + { + name: "--shard-index", + description: "Index of distributed runbooks", + args: { + name: "index", + }, + }, + { + name: "--shard-n", + description: "Number of shards for distributing runbooks", + args: { + name: "number", + }, + }, + { + name: "--shuffle", + description: + 'Randomize the order of running runbooks (default "off")', + args: { + suggestions: ["off", "on", "N"], + }, + }, + { + name: "--skip-included", + description: "Skip running the included runbook by itself", + }, + { + name: "--skip-test", + description: 'Skip "test:" section', + }, + { + name: "--underlay", + description: "Lay values under the runbook", + args: { + name: "values", + }, + }, + { + name: "--var", + description: 'Set var to runbook("key:value")', + args: { + name: "value", + }, + }, + { + name: "--verbose", + description: "Verbose", + }, + { + name: "--wait-timeout", + description: + 'Timeout for waiting for cleanup process after running runbooks (default "10sec")', + args: { + name: "timeout", + }, + }, + ], + }, ], options: [ { From 6e8e3c3b0eb5f2ae8c5204133da8945b95f57f2f Mon Sep 17 00:00:00 2001 From: nacal Date: Sun, 16 Feb 2025 22:30:59 +0900 Subject: [PATCH 10/10] refactor --- src/runn.ts | 1276 ++++++++++++++++++--------------------------------- 1 file changed, 453 insertions(+), 823 deletions(-) diff --git a/src/runn.ts b/src/runn.ts index 99e34a083924..265a5d981f6f 100644 --- a/src/runn.ts +++ b/src/runn.ts @@ -20,6 +20,331 @@ const globalFlags: Fig.Option[] = [ }, }, ]; + +const helpOption = (target: string): Fig.Option => ({ + name: ["-h", "--help"], + description: `Help for ${target}`, +}); + +const options: { [key: string]: Fig.Option } = { + andRun: { + name: "--and-run", + description: "Run created runbook and capture the response for test", + }, + attach: { + name: "--attach", + description: "Attach to runn process", + }, + cacheDir: { + name: "--cache-dir", + description: "Specify cache directory for remote runbooks", + args: { + template: "folders", + }, + }, + capture: { + name: "--capture", + description: "Destination of runbook run capture results", + args: { + template: "folders", + }, + }, + concurrent: { + name: "--concurrent", + description: 'Run runbooks concurrently (default "off")', + args: { + suggestions: ["off", "on", "N"], + }, + }, + debug: { + name: "--debug", + description: "Debug", + }, + depth: { + name: "--depth", + description: "Depth of profile (default 4)", + args: { + name: "depth", + }, + }, + desc: { + name: "--desc", + description: "Description of runbook", + args: { + name: "description", + }, + }, + duration: { + name: "--duration", + description: 'Load test running duration (default "10sec")', + args: { + name: "duration", + }, + }, + envFile: { + name: "--env-file", + description: "Load environment variables from a file", + args: { + template: "filepaths", + }, + }, + failFast: { + name: "--fail-fast", + description: "Fail fast", + }, + forceColor: { + name: "--force--color", + description: "Force colorized output even in non-tty output streams", + }, + format: { + name: "--format", + description: "Format of result output", + args: { + suggestions: ["json", "none"], + }, + }, + grpcBugConfig: { + name: "--grpc-buf-config", + description: "Set the path to buf.yaml for gRPC runners", + args: { + template: "filepaths", + }, + }, + grpcBufDir: { + name: "--grpc-buf-dir", + description: "Set the path to the buf directory for gRPC runners", + args: { + template: "folders", + }, + }, + grpcBufLock: { + name: "--grpc-buf-lock", + description: "Set the path to buf.lock for gRPC runners", + args: { + template: "filepaths", + }, + }, + grpcBufModule: { + name: "--grpc-buf-module", + description: + 'Set the buf modules for gRPC runners ("buf.build/owner/repository" or "buf.build/owner/repository/tree/branch-or-commit")', + args: { + name: "buf modules", + }, + }, + grpcImportPath: { + name: "--grpc-import-path", + description: + "Set the path to the directory where proto sources can be imported for gRPC runners", + args: { + template: "filepaths", + }, + }, + grpcNoTls: { + name: "--grpc-no-tls", + description: "Disable TLS use in all gRPC runners", + }, + grpcProto: { + name: "--grpc-proto", + description: "Set the name of proto source for gRPC runners", + args: { + name: "proto source", + }, + }, + hostRules: { + name: "--host-rules", + description: 'Host rules for runn. ("host rule,host rule,...")', + args: { + name: "host rules", + }, + }, + httpOpenapi3: { + name: "--http-openapi3", + description: + 'Set the path to the OpenAPI v3 document for HTTP runners ("path/to/spec.yml" or "key:path/to/spec.yml")', + args: { + name: "filepaths", + }, + }, + id: { + name: "--id", + description: + "Run the matching runbooks in order if there is only one runbook with a forward matching ID", + args: { + name: "id", + }, + }, + label: { + name: "--label", + description: "Run all runbooks matching the label specification", + args: { + name: "label", + }, + }, + loadConcurrent: { + name: "--load-concurrent", + description: + "Number of concurrent load test runs. 0 means unlimited (default 1)", + args: { + name: "number", + }, + }, + long: { + name: ["-l", "--long"], + description: "Long format", + }, + maxRps: { + name: "--max-rps", + description: + "Max RunN per second for load test. 0 means unlimited (default 1)", + args: { + name: "number", + }, + }, + out: { + name: "--out", + description: "Target path of runbook", + args: { + template: "folders", + }, + }, + overlay: { + name: "--overlay", + description: "Overlay values on the runbook", + args: { + name: "values", + }, + }, + profile: { + name: "--profile", + description: "Profile runs of runbooks", + }, + profileOut: { + name: "--profile--out", + description: 'Profile output path (default "runn.prof")', + args: { + template: "filepaths", + }, + }, + random: { + name: "--random", + description: "Run the specified number of runbooks at random", + args: { + name: "specified number", + }, + }, + retainCacheDir: { + name: "--retain-cache-dir", + description: "Retain cache directory for remote runbooks", + }, + run: { + name: "--run", + description: + "Run all runbooks with a matching file path, treating the value passed to the option as an unanchored regular expression", + args: { + name: "path regex", + }, + }, + runner: { + name: "--runner", + description: 'Set runner to runbook("key:dsn")', + args: { + name: "runner", + }, + }, + sample: { + name: "--sample", + description: "Sample the specified number of runbooks", + args: { + name: "specified number", + }, + }, + shardIndex: { + name: "--shard-index", + description: "Index of distributed runbooks", + args: { + name: "index", + }, + }, + shardN: { + name: "--shard-n", + description: "Number of shards for distributing runbooks", + args: { + name: "number", + }, + }, + shuffle: { + name: "--shuffle", + description: 'Randomize the order of running runbooks (default "off")', + args: { + suggestions: ["off", "on", "N"], + }, + }, + skipIncluded: { + name: "--skip-included", + description: "Skip running the included runbook by itself", + }, + skipTest: { + name: "--skip-test", + description: 'Skip "test:" section', + }, + sort: { + name: "--sort", + description: "Sort order", + args: { + suggestions: ["elapsed", "started-at", "stopped-at"], + }, + }, + threshold: { + name: "--threshold", + description: + "If this threshold condition is not met, loadt command returns exit status 1 (EXIT_FAILURE)", + args: { + name: "threshold", + }, + }, + underlay: { + name: "--underlay", + description: "Lay values under the runbook", + args: { + name: "values", + }, + }, + unit: { + name: "--unit", + description: 'Time unit(default "ms")', + args: { + suggestions: ["ns", "us", "ms", "s", "m"], + }, + }, + var: { + name: "--var", + description: 'Set var to runbook("key:value")', + args: { + name: "value", + }, + }, + verbose: { + name: "--verbose", + description: "Verbose", + }, + waitTimeout: { + name: "--wait-timeout", + description: + 'Timeout for waiting for cleanup process after running runbooks (default "10sec")', + args: { + name: "timeout", + }, + }, + warmUp: { + name: "--warm-up", + description: 'Warn-up time for load test (default "5sec")', + args: { + name: "time", + }, + }, +}; + const completionSpec: Fig.Spec = { name: "runn", description: "A tool for running operations following a scenario", @@ -82,154 +407,29 @@ const completionSpec: Fig.Spec = { "Show coverage for paths/operations of OpenAPI spec and methods of protocol buffers", options: [ ...globalFlags, - { - name: "--cache-dir", - description: "Specify cache directory for remote runbooks", - args: { - template: "folders", - }, - }, - { - name: "--debug", - description: "Debug", - }, - { - name: "--env-file", - description: "Load environment variables from a file", - args: { - template: "filepaths", - }, - }, - { - name: "--format", - description: "Format of result output", - args: { - suggestions: ["json", "none"], - }, - }, - { - name: "--grpc-buf-config", - description: "Set the path to buf.yaml for gRPC runners", - args: { - template: "filepaths", - }, - }, - { - name: "--grpc-buf-dir", - description: "Set the path to the buf directory for gRPC runners", - args: { - template: "folders", - }, - }, - { - name: "--grpc-buf-lock", - description: "Set the path to buf.lock for gRPC runners", - args: { - template: "filepaths", - }, - }, - { - name: "--grpc-buf-module", - description: - 'Set the buf modules for gRPC runners ("buf.build/owner/repository" or "buf.build/owner/repository/tree/branch-or-commit")', - args: { - name: "buf modules", - }, - }, - { - name: "--grpc-import-path", - description: - "Set the path to the directory where proto sources can be imported for gRPC runners", - args: { - template: "filepaths", - }, - }, - { - name: "--grpc-no-tls", - description: "Disable TLS use in all gRPC runners", - }, - { - name: "--grpc-proto", - description: "Set the name of proto source for gRPC runners", - args: { - name: "proto source", - }, - }, - { - name: ["-h", "--help"], - description: "Help for coverage", - }, - { - name: "--http-openapi3", - description: - 'Set the path to the OpenAPI v3 document for HTTP runners ("path/to/spec.yml" or "key:path/to/spec.yml")', - args: { - name: "filepaths", - }, - }, - { - name: "--id", - description: - "Run the matching runbooks in order if there is only one runbook with a forward matching ID", - args: { - name: "id", - }, - }, - { - name: "--label", - description: "Run all runbooks matching the label specification", - args: { - name: "label", - }, - }, - { - name: ["-l", "-long"], - description: "Long format", - }, - { - name: "--overlay", - description: "Overlay values on the runbook", - args: { - name: "values", - }, - }, - { - name: "--retain-cache-dir", - description: "Retain cache directory for remote runbooks", - }, - { - name: "--run", - description: - "Run all runbooks with a matching file path, treating the value passed to the option as an unanchored regular expression", - args: { - name: "path regex", - }, - }, - { - name: "--runner", - description: 'Set runner to runbook("key:dsn")', - args: { - name: "runner", - }, - }, - { - name: "--skip-included", - description: "Skip running the included runbook by itself", - }, - { - name: "--underlay", - description: "Lay values under the runbook", - args: { - name: "values", - }, - }, - { - name: "--var", - description: 'Set var to runbook("key:value")', - args: { - name: "value", - }, - }, + options.cacheDir, + options.debug, + options.envFile, + options.format, + options.grpcBugConfig, + options.grpcBufDir, + options.grpcBufLock, + options.grpcBufModule, + options.grpcImportPath, + options.grpcNoTls, + options.grpcProto, + helpOption("coverage"), + options.httpOpenapi3, + options.id, + options.label, + options.long, + options.overlay, + options.retainCacheDir, + options.run, + options.runner, + options.skipIncluded, + options.underlay, + options.var, ], }, { @@ -240,123 +440,24 @@ const completionSpec: Fig.Spec = { }, options: [ ...globalFlags, - { - name: "--cache-dir", - description: "Specify cache directory for remote runbooks", - args: { - template: "folders", - }, - }, - { - name: "--env-file", - description: "Load environment variables from a file", - args: { - template: "filepaths", - }, - }, - { - name: ["-h", "--help"], - description: "Help for list", - }, - { - name: "--id", - description: - "Run the matching runbooks in order if there is only one runbook with a forward matching ID", - args: { - name: "id", - }, - }, - { - name: "--label", - description: "Run all runbooks matching the label specification", - args: { - name: "label", - }, - }, - { - name: ["-l", "-long"], - description: "Long format", - }, - { - name: "--overlay", - description: "Overlay values on the runbook", - args: { - name: "values", - }, - }, - { - name: "--random", - description: "Run the specified number of runbooks at random", - args: { - name: "specified number", - }, - }, - { - name: "--retain-cache-dir", - description: "Retain cache directory for remote runbooks", - }, - { - name: "--run", - description: - "Run all runbooks with a matching file path, treating the value passed to the option as an unanchored regular expression", - args: { - name: "path regex", - }, - }, - { - name: "--runner", - description: 'Set runner to runbook("key:dsn")', - args: { - name: "runner", - }, - }, - { - name: "--sample", - description: "Sample the specified number of runbooks", - args: { - name: "specified number", - }, - }, - { - name: "--shard-index", - description: "Index of distributed runbooks", - args: { - name: "index", - }, - }, - { - name: "--shard-n", - description: "Number of shards for distributing runbooks", - args: { - name: "number", - }, - }, - { - name: "--shuffle", - description: - 'Randomize the order of running runbooks (default "off")', - args: { - suggestions: ["off", "on", "N"], - }, - }, - { - name: "--skip-included", - description: "Skip running the included runbook by itself", - }, - { - name: "--underlay", - description: "Lay values under the runbook", - args: { - name: "values", - }, - }, - { - name: "--var", - description: 'Set var to runbook("key:value")', - args: { - name: "value", - }, - }, + options.cacheDir, + options.envFile, + helpOption("list"), + options.id, + options.label, + options.long, + options.overlay, + options.random, + options.retainCacheDir, + options.run, + options.runner, + options.sample, + options.shardIndex, + options.shardN, + options.shuffle, + options.skipIncluded, + options.underlay, + options.var, ], }, { @@ -367,254 +468,43 @@ const completionSpec: Fig.Spec = { }, options: [ ...globalFlags, - { - name: "--cache-dir", - description: "Specify cache directory for remote runbooks", - args: { - template: "folders", - }, - }, - { - name: "--capture", - description: "Destination of runbook run capture results", - args: { - template: "folders", - }, - }, - { - name: "--concurrent", - description: 'Run runbooks concurrently (default "off")', - args: { - suggestions: ["off", "on", "N"], - }, - }, - { - name: "--debug", - description: "Debug", - }, - { - name: "--duration", - description: 'Load test running duration (default "10sec")', - args: { - name: "duration", - }, - }, - { - name: "--env-file", - description: "Load environment variables from a file", - args: { - template: "filepaths", - }, - }, - { - name: "--fail-fast", - description: "Fail fast", - }, - { - name: "--grpc-buf-config", - description: "Set the path to buf.yaml for gRPC runners", - args: { - template: "filepaths", - }, - }, - { - name: "--grpc-buf-dir", - description: "Set the path to the buf directory for gRPC runners", - args: { - template: "folders", - }, - }, - { - name: "--grpc-buf-lock", - description: "Set the path to buf.lock for gRPC runners", - args: { - template: "filepaths", - }, - }, - { - name: "--grpc-buf-module", - description: - 'Set the buf modules for gRPC runners ("buf.build/owner/repository" or "buf.build/owner/repository/tree/branch-or-commit")', - args: { - name: "buf modules", - }, - }, - { - name: "--grpc-import-path", - description: - "Set the path to the directory where proto sources can be imported for gRPC runners", - args: { - template: "filepaths", - }, - }, - { - name: "--grpc-no-tls", - description: "Disable TLS use in all gRPC runners", - }, - { - name: "--grpc-proto", - description: "Set the name of proto source for gRPC runners", - args: { - name: "proto source", - }, - }, - { - name: ["-h", "--help"], - description: "Help for loadt", - }, - { - name: "--host-rules", - description: 'Host rules for runn. ("host rule,host rule,...")', - args: { - name: "host rules", - }, - }, - { - name: "--http-openapi3", - description: - 'Set the path to the OpenAPI v3 document for HTTP runners ("path/to/spec.yml" or "key:path/to/spec.yml")', - args: { - name: "filepaths", - }, - }, - { - name: "--id", - description: - "Run the matching runbooks in order if there is only one runbook with a forward matching ID", - args: { - name: "id", - }, - }, - { - name: "--label", - description: "Run all runbooks matching the label specification", - args: { - name: "label", - }, - }, - { - name: "--load-concurrent", - description: - "Number of concurrent load test runs. 0 means unlimited (default 1)", - args: { - name: "number", - }, - }, - { - name: "--max-rps", - description: - "Max RunN per second for load test. 0 means unlimited (default 1)", - args: { - name: "number", - }, - }, - { - name: "--overlay", - description: "Overlay values on the runbook", - args: { - name: "values", - }, - }, - { - name: "--random", - description: "Run the specified number of runbooks at random", - args: { - name: "specified number", - }, - }, - { - name: "--retain-cache-dir", - description: "Retain cache directory for remote runbooks", - }, - { - name: "--run", - description: - "Run all runbooks with a matching file path, treating the value passed to the option as an unanchored regular expression", - args: { - name: "path regex", - }, - }, - { - name: "--runner", - description: 'Set runner to runbook("key:dsn")', - args: { - name: "runner", - }, - }, - { - name: "--sample", - description: "Sample the specified number of runbooks", - args: { - name: "specified number", - }, - }, - { - name: "--shard-index", - description: "Index of distributed runbooks", - args: { - name: "index", - }, - }, - { - name: "--shard-n", - description: "Number of shards for distributing runbooks", - args: { - name: "number", - }, - }, - { - name: "--shuffle", - description: - 'Randomize the order of running runbooks (default "off")', - args: { - suggestions: ["off", "on", "N"], - }, - }, - { - name: "--skip-included", - description: "Skip running the included runbook by itself", - }, - { - name: "--skip-test", - description: 'Skip "test:" section', - }, - { - name: "--threshold", - description: - "If this threshold condition is not met, loadt command returns exit status 1 (EXIT_FAILURE)", - args: { - name: "threshold", - }, - }, - { - name: "--underlay", - description: "Lay values under the runbook", - args: { - name: "values", - }, - }, - { - name: "--var", - description: 'Set var to runbook("key:value")', - args: { - name: "value", - }, - }, - { - name: "--wait-timeout", - description: - 'Timeout for waiting for cleanup process after running runbooks (default "10sec")', - args: { - name: "timeout", - }, - }, - { - name: "--warm-up", - description: 'Warn-up time for load test (default "5sec")', - args: { - name: "time", - }, - }, + options.cacheDir, + options.capture, + options.concurrent, + options.debug, + options.duration, + options.envFile, + options.failFast, + options.grpcBugConfig, + options.grpcBufDir, + options.grpcBufLock, + options.grpcBufModule, + options.grpcImportPath, + options.grpcNoTls, + options.grpcProto, + helpOption("loadt"), + options.hostRules, + options.httpOpenapi3, + options.id, + options.label, + options.loadConcurrent, + options.maxRps, + options.overlay, + options.random, + options.retainCacheDir, + options.run, + options.runner, + options.sample, + options.shardIndex, + options.shardN, + options.shuffle, + options.skipIncluded, + options.skipTest, + options.threshold, + options.underlay, + options.var, + options.waitTimeout, + options.warmUp, ], }, { @@ -622,47 +512,13 @@ const completionSpec: Fig.Spec = { description: "Create new runbook or append step to runbook", options: [ ...globalFlags, - { - name: "--and-run", - description: "Run created runbook and capture the response for test", - }, - { - name: "--desc", - description: "Description of runbook", - args: { - name: "description", - }, - }, - { - name: "--grpc-import-path", - description: - "Set the path to the directory where proto sources can be imported for gRPC runners", - args: { - template: "filepaths", - }, - }, - { - name: "--grpc-no-tls", - description: "Disable TLS use in all gRPC runners", - }, - { - name: "--grpc-proto", - description: "Set the name of proto source for gRPC runners", - args: { - name: "proto source", - }, - }, - { - name: ["-h", "--help"], - description: "Help for new", - }, - { - name: "--out", - description: "Target path of runbook", - args: { - template: "folders", - }, - }, + options.andRun, + options.desc, + options.grpcImportPath, + options.grpcNoTls, + options.grpcProto, + helpOption("new"), + options.out, ], }, { @@ -673,31 +529,10 @@ const completionSpec: Fig.Spec = { }, options: [ ...globalFlags, - { - name: "--depth", - description: "Depth of profile (default 4)", - args: { - name: "depth", - }, - }, - { - name: ["-h", "--help"], - description: "Help for rprof", - }, - { - name: "--sort", - description: "Sort order", - args: { - suggestions: ["elapsed", "started-at", "stopped-at"], - }, - }, - { - name: "--unit", - description: 'Time unit(default "ms")', - args: { - suggestions: ["ns", "us", "ms", "s", "m"], - }, - }, + options.depth, + helpOption("rprof"), + options.sort, + options.unit, ], }, { @@ -708,254 +543,49 @@ const completionSpec: Fig.Spec = { }, options: [ ...globalFlags, - { - name: "-attach", - description: "Attach to runn process", - }, - { - name: "--cache-dir", - description: "Specify cache directory for remote runbooks", - args: { - template: "folders", - }, - }, - { - name: "--capture", - description: "Destination of runbook run capture results", - args: { - template: "folders", - }, - }, - { - name: "--concurrent", - description: 'Run runbooks concurrently (default "off")', - args: { - suggestions: ["off", "on", "N"], - }, - }, - { - name: "--debug", - description: "Debug", - }, - { - name: "--env-file", - description: "Load environment variables from a file", - args: { - template: "filepaths", - }, - }, - { - name: "--fail-fast", - description: "Fail fast", - }, - { - name: "--force--color", - description: "Force colorized output even in non-tty output streams", - }, - { - name: "--format", - description: "Format of result output", - args: { - suggestions: ["json", "none"], - }, - }, - { - name: "--grpc-buf-config", - description: "Set the path to buf.yaml for gRPC runners", - args: { - template: "filepaths", - }, - }, - { - name: "--grpc-buf-dir", - description: "Set the path to the buf directory for gRPC runners", - args: { - template: "folders", - }, - }, - { - name: "--grpc-buf-lock", - description: "Set the path to buf.lock for gRPC runners", - args: { - template: "filepaths", - }, - }, - { - name: "--grpc-buf-module", - description: - 'Set the buf modules for gRPC runners ("buf.build/owner/repository" or "buf.build/owner/repository/tree/branch-or-commit")', - args: { - name: "buf modules", - }, - }, - { - name: "--grpc-import-path", - description: - "Set the path to the directory where proto sources can be imported for gRPC runners", - args: { - template: "filepaths", - }, - }, - { - name: "--grpc-no-tls", - description: "Disable TLS use in all gRPC runners", - }, - { - name: "--grpc-proto", - description: "Set the name of proto source for gRPC runners", - args: { - name: "proto source", - }, - }, - { - name: ["-h", "--help"], - description: "Help for run", - }, - { - name: "--host-rules", - description: 'Host rules for runn. ("host rule,host rule,...")', - args: { - name: "host rules", - }, - }, - { - name: "--http-openapi3", - description: - 'Set the path to the OpenAPI v3 document for HTTP runners ("path/to/spec.yml" or "key:path/to/spec.yml")', - args: { - name: "filepaths", - }, - }, - { - name: "--id", - description: - "Run the matching runbooks in order if there is only one runbook with a forward matching ID", - args: { - name: "id", - }, - }, - { - name: "--label", - description: "Run all runbooks matching the label specification", - args: { - name: "label", - }, - }, - { - name: "--overlay", - description: "Overlay values on the runbook", - args: { - name: "values", - }, - }, - { - name: "--profile", - description: "Profile runs of runbooks", - }, - { - name: "--profile--out", - description: 'Profile output path (default "runn.prof")', - args: { - template: "filepaths", - }, - }, - { - name: "--random", - description: "Run the specified number of runbooks at random", - args: { - name: "specified number", - }, - }, - { - name: "--retain-cache-dir", - description: "Retain cache directory for remote runbooks", - }, - { - name: "--run", - description: - "Run all runbooks with a matching file path, treating the value passed to the option as an unanchored regular expression", - args: { - name: "path regex", - }, - }, - { - name: "--runner", - description: 'Set runner to runbook("key:dsn")', - args: { - name: "runner", - }, - }, - { - name: "--sample", - description: "Sample the specified number of runbooks", - args: { - name: "specified number", - }, - }, - { - name: "--shard-index", - description: "Index of distributed runbooks", - args: { - name: "index", - }, - }, - { - name: "--shard-n", - description: "Number of shards for distributing runbooks", - args: { - name: "number", - }, - }, - { - name: "--shuffle", - description: - 'Randomize the order of running runbooks (default "off")', - args: { - suggestions: ["off", "on", "N"], - }, - }, - { - name: "--skip-included", - description: "Skip running the included runbook by itself", - }, - { - name: "--skip-test", - description: 'Skip "test:" section', - }, - { - name: "--underlay", - description: "Lay values under the runbook", - args: { - name: "values", - }, - }, - { - name: "--var", - description: 'Set var to runbook("key:value")', - args: { - name: "value", - }, - }, - { - name: "--verbose", - description: "Verbose", - }, - { - name: "--wait-timeout", - description: - 'Timeout for waiting for cleanup process after running runbooks (default "10sec")', - args: { - name: "timeout", - }, - }, + options.attach, + options.cacheDir, + options.capture, + options.concurrent, + options.debug, + options.envFile, + options.failFast, + options.forceColor, + options.format, + options.grpcBugConfig, + options.grpcBufDir, + options.grpcBufLock, + options.grpcBufModule, + options.grpcImportPath, + options.grpcNoTls, + options.grpcProto, + helpOption("run"), + options.hostRules, + options.httpOpenapi3, + options.id, + options.label, + options.overlay, + options.profile, + options.profileOut, + options.random, + options.retainCacheDir, + options.run, + options.runner, + options.sample, + options.shardIndex, + options.shardN, + options.shuffle, + options.skipIncluded, + options.skipTest, + options.underlay, + options.var, + options.verbose, + options.waitTimeout, ], }, ], options: [ - { - name: ["--help", "-h"], - description: "Help for runn", - }, + helpOption("runn"), { name: ["--version", "-v"], description: "Version for runn",