@fromeroc9/testform 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action/index.js +1 -1
- package/dist/action.js +60 -0
- package/dist/adapters/github.js +467 -0
- package/dist/adapters/resources.js +363 -0
- package/dist/cli/index.js +3 -3
- package/dist/commands/apply.js +390 -0
- package/dist/commands/destroy.js +85 -0
- package/dist/commands/diff.js +131 -0
- package/dist/commands/fmt.js +166 -0
- package/dist/commands/force-unlock.js +55 -0
- package/dist/commands/generate.js +143 -0
- package/dist/commands/graph.js +159 -0
- package/dist/commands/import.js +222 -0
- package/dist/commands/init.js +167 -0
- package/dist/commands/login.js +71 -0
- package/dist/commands/logout.js +20 -0
- package/dist/commands/plan.js +250 -0
- package/dist/commands/refresh.js +165 -0
- package/dist/commands/report.js +724 -0
- package/dist/commands/show.js +61 -0
- package/dist/commands/state.js +197 -0
- package/dist/commands/taint.js +49 -0
- package/dist/commands/validate.js +128 -0
- package/dist/commands/workspace.js +102 -0
- package/dist/const.js +105 -0
- package/dist/core/backends/azurerm.js +201 -0
- package/dist/core/backends/backend.js +2 -0
- package/dist/core/backends/gcs.js +200 -0
- package/dist/core/backends/local.js +162 -0
- package/dist/core/backends/s3.js +224 -0
- package/dist/core/command-context.js +59 -0
- package/dist/core/config.js +131 -0
- package/dist/core/credentials.js +53 -0
- package/dist/core/parser.js +62 -0
- package/dist/core/parsers/base-parser.js +215 -0
- package/dist/core/parsers/testcase-parser.js +115 -0
- package/dist/core/parsers/testplan-parser.js +41 -0
- package/dist/core/parsers/testrun-parser.js +43 -0
- package/dist/core/policy.js +341 -0
- package/dist/core/prompt.js +109 -0
- package/dist/core/state.js +185 -0
- package/dist/core/utils.js +94 -0
- package/dist/core/variables.js +108 -0
- package/dist/core/workspace.js +56 -0
- package/dist/help.js +797 -0
- package/dist/index.js +650 -0
- package/dist/logger.js +134 -0
- package/dist/notify.js +36 -0
- package/dist/types.js +2 -0
- package/package.json +2 -2
package/dist/help.js
ADDED
|
@@ -0,0 +1,797 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HELP_REPORT = exports.HELP_DIFF = exports.HELP_WORKSPACE = exports.HELP_VERSION = exports.HELP_UNTAINT = exports.HELP_TAINT = exports.HELP_STATE_SHOW = exports.HELP_STATE_RM = exports.HELP_STATE_PUSH = exports.HELP_STATE_PULL = exports.HELP_STATE_MV = exports.HELP_STATE_LIST = exports.HELP_STATE_IDENTITIES = exports.HELP_STATE = exports.HELP_LOGOUT = exports.HELP_LOGIN = exports.HELP_GRAPH = exports.HELP_FORCE_UNLOCK = exports.HELP_FMT = exports.HELP_SHOW = exports.HELP_REFRESH = exports.HELP_IMPORT = exports.HELP_DESTROY = exports.HELP_APPLY = exports.HELP_VALIDATE = exports.HELP_PLAN = exports.HELP_INIT = exports.HELP_GLOBAL = void 0;
|
|
4
|
+
exports.getCommandHelp = getCommandHelp;
|
|
5
|
+
const const_1 = require("./const");
|
|
6
|
+
const chalk_1 = require("chalk");
|
|
7
|
+
exports.HELP_GLOBAL = `
|
|
8
|
+
${(0, chalk_1.bold)('Usage:')} ${const_1.TITLE_CLI} [global options] [subcommand] [args]
|
|
9
|
+
|
|
10
|
+
The available commands for execution are listed below.
|
|
11
|
+
The primary workflow commands are given first, followed by
|
|
12
|
+
less common or more advanced commands.
|
|
13
|
+
|
|
14
|
+
${(0, chalk_1.bold)('Main commands:')}
|
|
15
|
+
init Prepare working directory for other commands
|
|
16
|
+
validate Check whether the configuration is valid
|
|
17
|
+
plan Show changes required by current configuration
|
|
18
|
+
apply Create or update resources
|
|
19
|
+
destroy Destroy previously-created resources
|
|
20
|
+
|
|
21
|
+
${(0, chalk_1.bold)('All other commands:')}
|
|
22
|
+
diff Show drift between local configuration and state
|
|
23
|
+
fmt Reformat your configuration in the standard style
|
|
24
|
+
force-unlock Release a stuck lock on the current workspace
|
|
25
|
+
graph Generate a Graphviz graph of the steps in an operation
|
|
26
|
+
import Associate existing infrastructure with a ${const_1.TITLE_APP} resource
|
|
27
|
+
login Obtain and save credentials for a remote host
|
|
28
|
+
logout Remove locally-stored credentials for a remote host
|
|
29
|
+
refresh Update the state to match remote systems
|
|
30
|
+
report Generate multi-dimensional test execution reports
|
|
31
|
+
show Show the current state or a saved plan
|
|
32
|
+
state Advanced state management
|
|
33
|
+
taint Mark a resource instance as not fully functional
|
|
34
|
+
untaint Remove the 'tainted' state from a resource instance
|
|
35
|
+
version Show the current ${const_1.TITLE_APP} version
|
|
36
|
+
workspace Workspace management
|
|
37
|
+
|
|
38
|
+
${(0, chalk_1.bold)('Global options (use these before the subcommand, if any):')}
|
|
39
|
+
-chdir=DIR Switch to a different working directory before executing the given subcommand.
|
|
40
|
+
-projectId=ID Override the default project ID defined in your testform.json.
|
|
41
|
+
-scope=SCOPE Limit the scope of the execution (e.g. to a specific feature or tag).
|
|
42
|
+
-help Show this help output, or the help for a specified subcommand.
|
|
43
|
+
-version An alias for the "version" subcommand.
|
|
44
|
+
`;
|
|
45
|
+
exports.HELP_INIT = `
|
|
46
|
+
Usage: ${const_1.TITLE_CLI} [global options] init [options]
|
|
47
|
+
|
|
48
|
+
Initialize a new or existing ${const_1.TITLE_APP} working directory by creating
|
|
49
|
+
initial files and loading any remote state.
|
|
50
|
+
|
|
51
|
+
This is the first command that should be run for any new or existing
|
|
52
|
+
${const_1.TITLE_APP} configuration per machine. This sets up all the local data
|
|
53
|
+
necessary to run ${const_1.TITLE_APP}.
|
|
54
|
+
|
|
55
|
+
This command is always safe to run multiple times.
|
|
56
|
+
|
|
57
|
+
Options:
|
|
58
|
+
|
|
59
|
+
-backend=false Disable backend initialization for this configuration
|
|
60
|
+
and use what was previously initialized instead.
|
|
61
|
+
|
|
62
|
+
-backend-config=path Configuration to be merged with what is in the
|
|
63
|
+
configuration file's 'backend' block. This can be
|
|
64
|
+
a 'key=value' format, and can be specified multiple
|
|
65
|
+
times.
|
|
66
|
+
|
|
67
|
+
-lock=false Don't hold a state lock during backend migration.
|
|
68
|
+
This is dangerous if others might concurrently run
|
|
69
|
+
commands against the same workspace.
|
|
70
|
+
|
|
71
|
+
-lock-timeout=0s Duration to retry a state lock.
|
|
72
|
+
|
|
73
|
+
-no-color If specified, output won't contain any color.
|
|
74
|
+
|
|
75
|
+
-json If specified, machine readable output will be
|
|
76
|
+
printed in JSON format.
|
|
77
|
+
|
|
78
|
+
-reconfigure Reconfigure a backend, ignoring any saved
|
|
79
|
+
configuration.
|
|
80
|
+
|
|
81
|
+
-migrate-state Reconfigure a backend, and attempt to migrate any
|
|
82
|
+
existing state.
|
|
83
|
+
`.trim();
|
|
84
|
+
exports.HELP_PLAN = `
|
|
85
|
+
Usage: ${const_1.TITLE_CLI} [global options] plan [options]
|
|
86
|
+
|
|
87
|
+
Generates a speculative execution plan, showing what actions ${const_1.TITLE_APP}
|
|
88
|
+
would take to apply the current configuration. This command will not
|
|
89
|
+
actually perform the planned actions.
|
|
90
|
+
|
|
91
|
+
You can optionally save the plan to a file, which you can then pass to
|
|
92
|
+
the "apply" command to perform exactly the actions described in the plan.
|
|
93
|
+
|
|
94
|
+
Plan Customization Options:
|
|
95
|
+
|
|
96
|
+
The following options customize how ${const_1.TITLE_APP} will produce its plan. You
|
|
97
|
+
can also use these options when you run "${const_1.TITLE_CLI} apply" without passing
|
|
98
|
+
it a saved plan, in order to plan and apply in a single command.
|
|
99
|
+
|
|
100
|
+
-destroy Select the "destroy" planning mode, which creates a plan
|
|
101
|
+
to destroy all objects currently managed by this
|
|
102
|
+
${const_1.TITLE_APP} configuration instead of the usual behavior.
|
|
103
|
+
|
|
104
|
+
-refresh-only Select the "refresh only" planning mode, which checks
|
|
105
|
+
whether remote objects still match the outcome of the
|
|
106
|
+
most recent ${const_1.TITLE_APP} apply but does not propose any
|
|
107
|
+
actions to undo any changes made outside of ${const_1.TITLE_APP}.
|
|
108
|
+
|
|
109
|
+
-refresh=false Skip checking for external changes to remote objects
|
|
110
|
+
while creating the plan. This can potentially make
|
|
111
|
+
planning faster, but at the expense of possibly planning
|
|
112
|
+
against a stale record of the remote system state.
|
|
113
|
+
|
|
114
|
+
-replace=resource Force replacement of a particular resource instance using
|
|
115
|
+
its resource address. If the plan would've normally
|
|
116
|
+
produced an update or no-op action for this instance,
|
|
117
|
+
${const_1.TITLE_APP} will plan to replace it instead. You can use
|
|
118
|
+
this option multiple times to replace more than one object.
|
|
119
|
+
|
|
120
|
+
-target=resource Limit the planning operation to only the given module,
|
|
121
|
+
resource, or resource instance and all of its
|
|
122
|
+
dependencies. You can use this option multiple times to
|
|
123
|
+
include more than one object. This is for exceptional
|
|
124
|
+
use only.
|
|
125
|
+
|
|
126
|
+
-var 'foo=bar' Set a value for one of the input variables in the root
|
|
127
|
+
module of the configuration. Use this option more than
|
|
128
|
+
once to set more than one variable.
|
|
129
|
+
|
|
130
|
+
-var-file=filename Load variable values from the given file, in addition
|
|
131
|
+
to the default files ${const_1.TITLE_CLI}.tfvars and *.auto.tfvars.
|
|
132
|
+
Use this option more than once to include more than one
|
|
133
|
+
variables file.
|
|
134
|
+
|
|
135
|
+
Other Options:
|
|
136
|
+
|
|
137
|
+
-compact-warnings If ${const_1.TITLE_APP} produces any warnings that are not
|
|
138
|
+
accompanied by errors, shows them in a more compact
|
|
139
|
+
form that includes only the summary messages.
|
|
140
|
+
|
|
141
|
+
-detailed-exitcode Return detailed exit codes when the command exits.
|
|
142
|
+
This will change the meaning of exit codes to:
|
|
143
|
+
0 - Succeeded, diff is empty (no changes)
|
|
144
|
+
1 - Errored
|
|
145
|
+
2 - Succeeded, there is a diff
|
|
146
|
+
|
|
147
|
+
-lock=false Don't hold a state lock during the operation. This
|
|
148
|
+
is dangerous if others might concurrently run
|
|
149
|
+
commands against the same workspace.
|
|
150
|
+
|
|
151
|
+
-lock-timeout=0s Duration to retry a state lock.
|
|
152
|
+
|
|
153
|
+
-no-color If specified, output won't contain any color.
|
|
154
|
+
|
|
155
|
+
-out=path Write a plan file to the given path. This can be
|
|
156
|
+
used as input to the "apply" command.
|
|
157
|
+
|
|
158
|
+
-parallelism=n Limit the number of concurrent operations. Defaults
|
|
159
|
+
to 10.
|
|
160
|
+
|
|
161
|
+
-state=statefile A legacy option used for the local backend only.
|
|
162
|
+
See the local backend's documentation for more
|
|
163
|
+
information.
|
|
164
|
+
|
|
165
|
+
-backup=path Path to backup the existing state file before
|
|
166
|
+
modifying. Defaults to the "-state" path with
|
|
167
|
+
".backup" extension.
|
|
168
|
+
|
|
169
|
+
-test-directory=path Set the ${const_1.TITLE_APP} test directory. If omitted,
|
|
170
|
+
defaults to the chdir directory.
|
|
171
|
+
`.trim();
|
|
172
|
+
exports.HELP_VALIDATE = `
|
|
173
|
+
Usage: ${const_1.TITLE_CLI} [global options] validate [options]
|
|
174
|
+
|
|
175
|
+
Validate the configuration files in a directory, referring only to the
|
|
176
|
+
configuration and not accessing any remote services.
|
|
177
|
+
|
|
178
|
+
Validate runs checks that verify whether a configuration is syntactically
|
|
179
|
+
valid and internally consistent.
|
|
180
|
+
|
|
181
|
+
Options:
|
|
182
|
+
|
|
183
|
+
-json Produce output in a machine-readable JSON format.
|
|
184
|
+
Always disables color.
|
|
185
|
+
|
|
186
|
+
-no-color If specified, output won't contain any color.
|
|
187
|
+
|
|
188
|
+
-no-tests If specified, ${const_1.TITLE_APP} will only parse the files and
|
|
189
|
+
skip policy validations.
|
|
190
|
+
|
|
191
|
+
-test-directory=path Set the ${const_1.TITLE_APP} test directory, defaults to "tests".
|
|
192
|
+
|
|
193
|
+
-query=string Filter the parsed documents to locate specific test
|
|
194
|
+
scenarios across the active scope.
|
|
195
|
+
`.trim();
|
|
196
|
+
exports.HELP_APPLY = `
|
|
197
|
+
Usage: ${const_1.TITLE_CLI} [global options] apply [options] [PLAN]
|
|
198
|
+
|
|
199
|
+
Creates or updates infrastructure according to ${const_1.TITLE_APP} configuration
|
|
200
|
+
files in the current directory.
|
|
201
|
+
|
|
202
|
+
By default, ${const_1.TITLE_APP} will generate a new plan and present it for your
|
|
203
|
+
approval before taking any action. You can optionally provide a plan
|
|
204
|
+
file created by a previous call to "${const_1.TITLE_CLI} plan", in which case
|
|
205
|
+
${const_1.TITLE_APP} will take the actions described in that plan without any
|
|
206
|
+
confirmation prompt.
|
|
207
|
+
|
|
208
|
+
Options:
|
|
209
|
+
|
|
210
|
+
-auto-approve Skip interactive approval of plan before applying.
|
|
211
|
+
|
|
212
|
+
-backup=path Path to backup the existing state file before
|
|
213
|
+
modifying. Defaults to the "-state" path with
|
|
214
|
+
".backup" extension. Set to "-" to disable backup.
|
|
215
|
+
|
|
216
|
+
-compact-warnings If ${const_1.TITLE_APP} produces any warnings that are not
|
|
217
|
+
accompanied by errors, show them in a more compact
|
|
218
|
+
form that includes only the summary messages.
|
|
219
|
+
|
|
220
|
+
-destroy Destroy ${const_1.TITLE_APP}-managed infrastructure.
|
|
221
|
+
The command "${const_1.TITLE_CLI} destroy" is a convenience alias
|
|
222
|
+
for this option.
|
|
223
|
+
|
|
224
|
+
-lock=false Don't hold a state lock during the operation. This is
|
|
225
|
+
dangerous if others might concurrently run commands
|
|
226
|
+
against the same workspace.
|
|
227
|
+
|
|
228
|
+
-lock-timeout=0s Duration to retry a state lock.
|
|
229
|
+
|
|
230
|
+
-input=true Ask for input for variables if not directly set.
|
|
231
|
+
|
|
232
|
+
-no-color If specified, output won't contain any color.
|
|
233
|
+
|
|
234
|
+
-parallelism=n Limit the number of parallel resource operations.
|
|
235
|
+
Defaults to 10.
|
|
236
|
+
|
|
237
|
+
-replace=resource ${const_1.TITLE_APP} will plan to replace this resource instance
|
|
238
|
+
instead of doing an update or no-op action.
|
|
239
|
+
|
|
240
|
+
-set-status=assigns Injects or updates the status field in your local
|
|
241
|
+
testrun features before applying.
|
|
242
|
+
(e.g., "tc1=passed,tc2=failed").
|
|
243
|
+
Supported statuses: passed, failed, pending,
|
|
244
|
+
blocked, skipped, unexecuted.
|
|
245
|
+
|
|
246
|
+
-state=path Path to read and save state. Defaults to "testform.tfstate".
|
|
247
|
+
Legacy option for the local backend only. See the local
|
|
248
|
+
backend's documentation for more information.
|
|
249
|
+
|
|
250
|
+
-var 'foo=bar' Set a value for one of the input variables in the root
|
|
251
|
+
module of the configuration. Use this option more than
|
|
252
|
+
once to set more than one variable.
|
|
253
|
+
|
|
254
|
+
-var-file=filename Load variable values from the given file, in addition
|
|
255
|
+
to the default files ${const_1.TITLE_CLI}.tfvars and *.auto.tfvars.
|
|
256
|
+
Use this option more than once to include more than one
|
|
257
|
+
variables file.
|
|
258
|
+
|
|
259
|
+
-test-directory=path Set the ${const_1.TITLE_APP} test directory. If omitted,
|
|
260
|
+
defaults to the chdir directory.
|
|
261
|
+
|
|
262
|
+
If you don't provide a saved plan file then this command will also accept
|
|
263
|
+
all of the plan-customization options accepted by the ${const_1.TITLE_CLI} plan command.
|
|
264
|
+
For more information on those options, run:
|
|
265
|
+
${const_1.TITLE_CLI} plan -help
|
|
266
|
+
`.trim();
|
|
267
|
+
exports.HELP_DESTROY = `
|
|
268
|
+
Usage: ${const_1.TITLE_CLI} [global options] destroy [options]
|
|
269
|
+
|
|
270
|
+
Destroy ${const_1.TITLE_APP}-managed infrastructure.
|
|
271
|
+
|
|
272
|
+
This command is a convenience alias for:
|
|
273
|
+
${const_1.TITLE_CLI} apply -destroy
|
|
274
|
+
|
|
275
|
+
This command also accepts many of the plan-customization options accepted by
|
|
276
|
+
the ${const_1.TITLE_CLI} plan command. For more information on those options, run:
|
|
277
|
+
${const_1.TITLE_CLI} plan -help
|
|
278
|
+
`.trim();
|
|
279
|
+
exports.HELP_IMPORT = `
|
|
280
|
+
Usage: ${const_1.TITLE_CLI} [global options] import [options] ADDR ISSUE_NUMBER
|
|
281
|
+
|
|
282
|
+
Import an existing GitHub Issue into your ${const_1.TITLE_APP} state.
|
|
283
|
+
|
|
284
|
+
This command connects to GitHub, fetches the specified ISSUE_NUMBER, and
|
|
285
|
+
imports it into your local ${const_1.TITLE_APP} state under the given ADDR (Identity).
|
|
286
|
+
This allows existing GitHub Issues to come under ${const_1.TITLE_APP} management
|
|
287
|
+
without having to be initially created via a 'testform apply'.
|
|
288
|
+
|
|
289
|
+
ADDR: The identity of the scenario (e.g., 'test1').
|
|
290
|
+
ISSUE_NUMBER: The numeric ID of the GitHub Issue to import (e.g., '123').
|
|
291
|
+
|
|
292
|
+
This command will make network requests to GitHub but will not modify
|
|
293
|
+
the remote issue.
|
|
294
|
+
|
|
295
|
+
Options:
|
|
296
|
+
|
|
297
|
+
-lock=false Don't hold a state lock during the operation. This is
|
|
298
|
+
dangerous if others might concurrently run commands
|
|
299
|
+
against the same workspace.
|
|
300
|
+
|
|
301
|
+
-lock-timeout=0s Duration to retry a state lock.
|
|
302
|
+
|
|
303
|
+
-no-color If specified, output won't contain any color.
|
|
304
|
+
|
|
305
|
+
-state, and -backup Custom paths for the state and backup files.
|
|
306
|
+
`.trim();
|
|
307
|
+
exports.HELP_REFRESH = `
|
|
308
|
+
Usage: ${const_1.TITLE_CLI} [global options] refresh [options]
|
|
309
|
+
|
|
310
|
+
Update the local state file by checking the real-world status of all tracked
|
|
311
|
+
GitHub Issues and updating their metadata (e.g., titles, descriptions).
|
|
312
|
+
|
|
313
|
+
This command will not modify your GitHub Issues, but it will modify your
|
|
314
|
+
local state file to reflect any changes made on GitHub. These state changes
|
|
315
|
+
might cause new actions to occur when you generate a plan or call apply next.
|
|
316
|
+
|
|
317
|
+
Options:
|
|
318
|
+
|
|
319
|
+
-compact-warnings If ${const_1.TITLE_APP} produces any warnings that are not
|
|
320
|
+
accompanied by errors, show them in a more compact form
|
|
321
|
+
that includes only the summary messages.
|
|
322
|
+
|
|
323
|
+
-lock=false Don't hold a state lock during the operation. This is
|
|
324
|
+
dangerous if others might concurrently run commands
|
|
325
|
+
against the same workspace.
|
|
326
|
+
|
|
327
|
+
-lock-timeout=0s Duration to retry a state lock.
|
|
328
|
+
|
|
329
|
+
-no-color If specified, output won't contain any color.
|
|
330
|
+
|
|
331
|
+
-parallelism=n Limit the number of concurrent operations. Defaults to 10.
|
|
332
|
+
|
|
333
|
+
-state, and -backup Custom paths for the state and backup files.
|
|
334
|
+
`.trim();
|
|
335
|
+
exports.HELP_SHOW = `
|
|
336
|
+
Usage: ${const_1.TITLE_CLI} [global options] show [options] [path]
|
|
337
|
+
|
|
338
|
+
Reads and outputs a ${const_1.TITLE_APP} state or plan file in a human-readable
|
|
339
|
+
form. If no path is specified, the current state will be shown.
|
|
340
|
+
|
|
341
|
+
Options:
|
|
342
|
+
|
|
343
|
+
-no-color If specified, output won't contain any color.
|
|
344
|
+
-json If specified, output the ${const_1.TITLE_APP} plan or state in
|
|
345
|
+
a machine-readable form.
|
|
346
|
+
`.trim();
|
|
347
|
+
exports.HELP_FMT = `
|
|
348
|
+
Usage: ${const_1.TITLE_CLI} [global options] fmt [options] [target...]
|
|
349
|
+
|
|
350
|
+
Rewrites all ${const_1.TITLE_APP} scenario files to a canonical format. All
|
|
351
|
+
testing files (.feature) are updated using standard Gherkin syntax
|
|
352
|
+
indentation.
|
|
353
|
+
|
|
354
|
+
By default, fmt scans the current directory for .feature files. If you
|
|
355
|
+
provide a directory for the target argument, then fmt will scan that
|
|
356
|
+
directory instead.
|
|
357
|
+
|
|
358
|
+
The content must be in the Gherkin language native syntax.
|
|
359
|
+
|
|
360
|
+
Options:
|
|
361
|
+
|
|
362
|
+
-list=false Don't list files whose formatting differs
|
|
363
|
+
|
|
364
|
+
-write=false Don't write to source files
|
|
365
|
+
|
|
366
|
+
-check Check if the input is formatted. Exit status will be 3 if
|
|
367
|
+
any input is not properly formatted and zero otherwise.
|
|
368
|
+
|
|
369
|
+
-no-color If specified, output won't contain any color.
|
|
370
|
+
|
|
371
|
+
-recursive Also process files in subdirectories. By default, only the
|
|
372
|
+
given directory (or current directory) is processed.
|
|
373
|
+
`.trim();
|
|
374
|
+
exports.HELP_FORCE_UNLOCK = `
|
|
375
|
+
Usage: ${const_1.TITLE_CLI} [global options] force-unlock LOCK_ID
|
|
376
|
+
|
|
377
|
+
Manually unlock the state for the defined configuration.
|
|
378
|
+
|
|
379
|
+
This will not modify your infrastructure. This command removes the lock on the
|
|
380
|
+
state for the current workspace. The behavior of this lock is dependent
|
|
381
|
+
on the backend being used. Local state files cannot be unlocked by another
|
|
382
|
+
process.
|
|
383
|
+
|
|
384
|
+
Options:
|
|
385
|
+
|
|
386
|
+
-force Don't ask for input for unlock confirmation.
|
|
387
|
+
`.trim();
|
|
388
|
+
exports.HELP_GRAPH = `
|
|
389
|
+
Usage: ${const_1.TITLE_CLI} [global options] graph [options]
|
|
390
|
+
|
|
391
|
+
Produces an ASCII tree representation of the dependency graph between
|
|
392
|
+
different objects in the current test configuration and state.
|
|
393
|
+
|
|
394
|
+
By default the graph shows the relationships between the hierarchical
|
|
395
|
+
components in your configuration: Test Plans -> Test Runs -> Test Cases.
|
|
396
|
+
|
|
397
|
+
Options:
|
|
398
|
+
|
|
399
|
+
-draw-cycles Highlight the dependency links in the graph with colored
|
|
400
|
+
edges to explicitly visualize the dependency between
|
|
401
|
+
Plans, Runs, and Cases.
|
|
402
|
+
|
|
403
|
+
-type=TYPE (deprecated) In prior versions of Testform, specified the
|
|
404
|
+
type of operation graph to output.
|
|
405
|
+
|
|
406
|
+
-module-depth=n (deprecated) In prior versions of Testform, specified the
|
|
407
|
+
depth of modules to show in the output.
|
|
408
|
+
`.trim();
|
|
409
|
+
exports.HELP_LOGIN = `
|
|
410
|
+
Usage: ${const_1.TITLE_CLI} [global options] login [hostname]
|
|
411
|
+
|
|
412
|
+
Retrieves an authentication token for the given hostname, if it supports
|
|
413
|
+
automatic login, and saves it in a credentials file in your home directory.
|
|
414
|
+
|
|
415
|
+
If no hostname is provided, the default hostname is github.com, to
|
|
416
|
+
log in to GitHub.
|
|
417
|
+
|
|
418
|
+
If not overridden by credentials helper settings in the CLI configuration,
|
|
419
|
+
the credentials will be written to the following local file:
|
|
420
|
+
~/.testform.d/credentials.json
|
|
421
|
+
`.trim();
|
|
422
|
+
exports.HELP_LOGOUT = `
|
|
423
|
+
Usage: ${const_1.TITLE_CLI} [global options] logout [hostname]
|
|
424
|
+
|
|
425
|
+
Removes locally-stored credentials for specified hostname.
|
|
426
|
+
|
|
427
|
+
Note: the API token is only removed from local storage, not destroyed on the
|
|
428
|
+
remote server, so it will remain valid until manually revoked.
|
|
429
|
+
|
|
430
|
+
If no hostname is provided, the default hostname is github.com.
|
|
431
|
+
`.trim();
|
|
432
|
+
exports.HELP_STATE = `
|
|
433
|
+
Usage: ${const_1.TITLE_CLI} [global options] state [subcommand] [options] [args]
|
|
434
|
+
|
|
435
|
+
This command has subcommands for advanced state management.
|
|
436
|
+
|
|
437
|
+
These subcommands can be used to slice and dice the ${const_1.TITLE_APP} state.
|
|
438
|
+
This is sometimes necessary in advanced cases. For your safety, all
|
|
439
|
+
state management commands that modify the state create a timestamped
|
|
440
|
+
backup of the state prior to making modifications.
|
|
441
|
+
|
|
442
|
+
Subcommands:
|
|
443
|
+
identities List the identities of resources in the state
|
|
444
|
+
list List resources in the state
|
|
445
|
+
mv Move an item in the state
|
|
446
|
+
pull Pull current state and output to stdout
|
|
447
|
+
push Update remote state from a local state file
|
|
448
|
+
rm Remove instances from the state
|
|
449
|
+
show Show a resource in the state
|
|
450
|
+
`.trim();
|
|
451
|
+
exports.HELP_STATE_IDENTITIES = `
|
|
452
|
+
Usage: ${const_1.TITLE_CLI} [global options] state identities [options] -json [address...]
|
|
453
|
+
|
|
454
|
+
List the json format of the identities of resources in the ${const_1.TITLE_APP} state.
|
|
455
|
+
|
|
456
|
+
This command lists the identities of resource instances in the ${const_1.TITLE_APP} state in json format.
|
|
457
|
+
The address argument can be used to filter the instances by resource or module. If
|
|
458
|
+
no pattern is given, identities for all resource instances are listed.
|
|
459
|
+
|
|
460
|
+
The addresses must either be module addresses or absolute resource
|
|
461
|
+
addresses, such as:
|
|
462
|
+
github_testcase.example
|
|
463
|
+
module.example
|
|
464
|
+
module.example.module.child
|
|
465
|
+
module.example.github_testcase.example
|
|
466
|
+
|
|
467
|
+
An error will be returned if any of the resources or modules given as
|
|
468
|
+
filter addresses do not exist in the state.
|
|
469
|
+
|
|
470
|
+
Options:
|
|
471
|
+
|
|
472
|
+
-state=statefile Path to a ${const_1.TITLE_APP} state file to use to look
|
|
473
|
+
up ${const_1.TITLE_APP}-managed resources. By default, ${const_1.TITLE_APP}
|
|
474
|
+
will consult the state of the currently-selected
|
|
475
|
+
workspace.
|
|
476
|
+
|
|
477
|
+
-id=ID Filters the results to include only instances whose
|
|
478
|
+
resource types have an attribute named "id" whose value
|
|
479
|
+
equals the given id string.
|
|
480
|
+
`.trim();
|
|
481
|
+
exports.HELP_STATE_LIST = `
|
|
482
|
+
Usage: ${const_1.TITLE_CLI} [global options] state list [options] [address...]
|
|
483
|
+
|
|
484
|
+
List resources in the ${const_1.TITLE_APP} state.
|
|
485
|
+
|
|
486
|
+
This command lists resource instances in the ${const_1.TITLE_APP} state. The address
|
|
487
|
+
argument can be used to filter the instances by resource or module. If
|
|
488
|
+
no pattern is given, all resource instances are listed.
|
|
489
|
+
|
|
490
|
+
The addresses must either be module addresses or absolute resource
|
|
491
|
+
addresses, such as:
|
|
492
|
+
github_testcase.example
|
|
493
|
+
module.example
|
|
494
|
+
module.example.module.child
|
|
495
|
+
module.example.github_testcase.example
|
|
496
|
+
|
|
497
|
+
An error will be returned if any of the resources or modules given as
|
|
498
|
+
filter addresses do not exist in the state.
|
|
499
|
+
|
|
500
|
+
Options:
|
|
501
|
+
|
|
502
|
+
-state=statefile Path to a ${const_1.TITLE_APP} state file to use to look
|
|
503
|
+
up ${const_1.TITLE_APP}-managed resources. By default, ${const_1.TITLE_APP}
|
|
504
|
+
will consult the state of the currently-selected
|
|
505
|
+
workspace.
|
|
506
|
+
|
|
507
|
+
-id=ID Filters the results to include only instances whose
|
|
508
|
+
resource types have an attribute named "id" whose value
|
|
509
|
+
equals the given id string.
|
|
510
|
+
`.trim();
|
|
511
|
+
exports.HELP_STATE_MV = `
|
|
512
|
+
Usage: ${const_1.TITLE_CLI} [global options] state mv [options] SOURCE DESTINATION
|
|
513
|
+
|
|
514
|
+
This command will move an item matched by the address given to the
|
|
515
|
+
destination address. This command can also move to a destination address
|
|
516
|
+
in a completely different state file.
|
|
517
|
+
|
|
518
|
+
This can be used for simple resource renaming, moving items to and from
|
|
519
|
+
a module, moving entire modules, and more. And because this command can also
|
|
520
|
+
move data to a completely new state, it can also be used for refactoring
|
|
521
|
+
one configuration into multiple separately managed ${const_1.TITLE_APP} configurations.
|
|
522
|
+
|
|
523
|
+
This command will output a backup copy of the state prior to saving any
|
|
524
|
+
changes. The backup cannot be disabled. Due to the destructive nature
|
|
525
|
+
of this command, backups are required.
|
|
526
|
+
|
|
527
|
+
If you're moving an item to a different state file, a backup will be created
|
|
528
|
+
for each state file.
|
|
529
|
+
|
|
530
|
+
Options:
|
|
531
|
+
|
|
532
|
+
-dry-run If set, prints out what would've been moved but doesn't
|
|
533
|
+
actually move anything.
|
|
534
|
+
|
|
535
|
+
-lock=false Don't hold a state lock during the operation. This is
|
|
536
|
+
dangerous if others might concurrently run commands
|
|
537
|
+
against the same workspace.
|
|
538
|
+
|
|
539
|
+
-lock-timeout=0s Duration to retry a state lock.
|
|
540
|
+
|
|
541
|
+
-ignore-remote-version A rare option used for the remote backend only. See
|
|
542
|
+
the remote backend documentation for more information.
|
|
543
|
+
|
|
544
|
+
-state, state-out, and -backup are legacy options supported for the local
|
|
545
|
+
backend only. For more information, see the local backend's documentation.
|
|
546
|
+
`.trim();
|
|
547
|
+
exports.HELP_STATE_PULL = `
|
|
548
|
+
Usage: ${const_1.TITLE_CLI} [global options] state pull [options]
|
|
549
|
+
|
|
550
|
+
Pull the state from its location, upgrade the local copy, and output it
|
|
551
|
+
to stdout.
|
|
552
|
+
|
|
553
|
+
This command "pulls" the current state and outputs it to stdout.
|
|
554
|
+
As part of this process, ${const_1.TITLE_APP} will upgrade the state format of the
|
|
555
|
+
local copy to the current version.
|
|
556
|
+
|
|
557
|
+
The primary use of this is for state stored remotely. This command
|
|
558
|
+
will still work with local state but is less useful for this.
|
|
559
|
+
`.trim();
|
|
560
|
+
exports.HELP_STATE_PUSH = `
|
|
561
|
+
Usage: ${const_1.TITLE_CLI} [global options] state push [options] PATH
|
|
562
|
+
|
|
563
|
+
Update remote state from a local state file at PATH.
|
|
564
|
+
|
|
565
|
+
This command "pushes" a local state and overwrites remote state
|
|
566
|
+
with a local state file. The command will protect you against writing
|
|
567
|
+
an older serial or a different state file lineage unless you specify the
|
|
568
|
+
"-force" flag.
|
|
569
|
+
|
|
570
|
+
This command works with local state (it will overwrite the local
|
|
571
|
+
state), but is less useful for this use case.
|
|
572
|
+
|
|
573
|
+
If PATH is "-", then this command will read the state to push from stdin.
|
|
574
|
+
Data from stdin is not streamed to the backend: it is loaded completely
|
|
575
|
+
(until pipe close), verified, and then pushed.
|
|
576
|
+
|
|
577
|
+
Options:
|
|
578
|
+
|
|
579
|
+
-force Write the state even if lineages don't match or the
|
|
580
|
+
remote serial is higher.
|
|
581
|
+
|
|
582
|
+
-lock=false Don't hold a state lock during the operation. This is
|
|
583
|
+
dangerous if others might concurrently run commands
|
|
584
|
+
against the same workspace.
|
|
585
|
+
|
|
586
|
+
-lock-timeout=0s Duration to retry a state lock.
|
|
587
|
+
`.trim();
|
|
588
|
+
exports.HELP_STATE_RM = `
|
|
589
|
+
Usage: ${const_1.TITLE_CLI} [global options] state rm [options] ADDRESS...
|
|
590
|
+
|
|
591
|
+
Remove one or more items from the ${const_1.TITLE_APP} state, causing ${const_1.TITLE_APP} to
|
|
592
|
+
"forget" those items without first destroying them in the remote system.
|
|
593
|
+
|
|
594
|
+
This command removes one or more resource instances from the ${const_1.TITLE_APP} state
|
|
595
|
+
based on the addresses given. You can view and list the available instances
|
|
596
|
+
with "${const_1.TITLE_CLI} state list".
|
|
597
|
+
|
|
598
|
+
If you give the address of an entire module then all of the instances in
|
|
599
|
+
that module and any of its child modules will be removed from the state.
|
|
600
|
+
|
|
601
|
+
If you give the address of a resource that has "count" or "for_each" set,
|
|
602
|
+
all of the instances of that resource will be removed from the state.
|
|
603
|
+
|
|
604
|
+
Options:
|
|
605
|
+
|
|
606
|
+
-dry-run If set, prints out what would've been removed but
|
|
607
|
+
doesn't actually remove anything.
|
|
608
|
+
|
|
609
|
+
-backup=PATH Path where ${const_1.TITLE_APP} should write the backup
|
|
610
|
+
state.
|
|
611
|
+
|
|
612
|
+
-lock=false Don't hold a state lock during the operation. This is
|
|
613
|
+
dangerous if others might concurrently run commands
|
|
614
|
+
against the same workspace.
|
|
615
|
+
|
|
616
|
+
-lock-timeout=0s Duration to retry a state lock.
|
|
617
|
+
|
|
618
|
+
-state=PATH Path to the state file to update. Defaults to the
|
|
619
|
+
current workspace state.
|
|
620
|
+
Legacy option for the local backend only. See
|
|
621
|
+
the local backend's documentation for more
|
|
622
|
+
information.
|
|
623
|
+
|
|
624
|
+
-ignore-remote-version Continue even if remote and local ${const_1.TITLE_APP} versions
|
|
625
|
+
are incompatible. This may result in an unusable
|
|
626
|
+
workspace, and should be used with extreme caution.
|
|
627
|
+
`.trim();
|
|
628
|
+
exports.HELP_STATE_SHOW = `
|
|
629
|
+
Usage: ${const_1.TITLE_CLI} [global options] state show [options] ADDRESS
|
|
630
|
+
|
|
631
|
+
Shows the attributes of a resource in the ${const_1.TITLE_APP} state.
|
|
632
|
+
|
|
633
|
+
This command shows the attributes of a single resource in the ${const_1.TITLE_APP}
|
|
634
|
+
state. The address argument must be used to specify a single resource.
|
|
635
|
+
You can view the list of available resources with "${const_1.TITLE_CLI} state list".
|
|
636
|
+
|
|
637
|
+
Options:
|
|
638
|
+
|
|
639
|
+
-state=statefile Path to a ${const_1.TITLE_APP} state file to use to look
|
|
640
|
+
up ${const_1.TITLE_APP}-managed resources. By default it will
|
|
641
|
+
use the state "${const_1.FILE_STATE}" if it exists.
|
|
642
|
+
`.trim();
|
|
643
|
+
exports.HELP_TAINT = `
|
|
644
|
+
Usage: ${const_1.TITLE_CLI} [global options] taint [options] [address]
|
|
645
|
+
|
|
646
|
+
${const_1.TITLE_APP} uses the term "tainted" to describe a resource instance
|
|
647
|
+
which may not be fully functional, either because its creation
|
|
648
|
+
partially failed or because you've manually marked it as such using
|
|
649
|
+
this command.
|
|
650
|
+
|
|
651
|
+
This will not modify your infrastructure directly, but subsequent
|
|
652
|
+
${const_1.TITLE_APP} plans will include actions to destroy the remote object
|
|
653
|
+
and create a new object to replace it.
|
|
654
|
+
|
|
655
|
+
You can remove the "taint" state from a resource instance using
|
|
656
|
+
the "${const_1.TITLE_CLI} untaint" command.
|
|
657
|
+
|
|
658
|
+
The address is in the usual resource address syntax, such as:
|
|
659
|
+
aws_instance.foo
|
|
660
|
+
aws_instance.bar[1]
|
|
661
|
+
module.foo.module.bar.aws_instance.baz
|
|
662
|
+
|
|
663
|
+
Use your shell's quoting or escaping syntax to ensure that the
|
|
664
|
+
address will reach ${const_1.TITLE_APP} correctly, without any special
|
|
665
|
+
interpretation.
|
|
666
|
+
|
|
667
|
+
Options:
|
|
668
|
+
|
|
669
|
+
-allow-missing If specified, the command will succeed (exit code 0)
|
|
670
|
+
even if the resource is missing.
|
|
671
|
+
|
|
672
|
+
-lock=false Don't hold a state lock during the operation. This is
|
|
673
|
+
dangerous if others might concurrently run commands
|
|
674
|
+
against the same workspace.
|
|
675
|
+
|
|
676
|
+
-lock-timeout=0s Duration to retry a state lock.
|
|
677
|
+
|
|
678
|
+
-state, and -backup Custom paths for the state and backup files.
|
|
679
|
+
`.trim();
|
|
680
|
+
exports.HELP_UNTAINT = `
|
|
681
|
+
Usage: ${const_1.TITLE_CLI} [global options] untaint [options] name
|
|
682
|
+
|
|
683
|
+
${const_1.TITLE_APP} uses the term "tainted" to describe a resource instance
|
|
684
|
+
which may not be fully functional, either because its creation
|
|
685
|
+
partially failed or because you've manually marked it as such using
|
|
686
|
+
the "${const_1.TITLE_CLI} taint" command.
|
|
687
|
+
|
|
688
|
+
This command removes that state from a resource instance, causing
|
|
689
|
+
${const_1.TITLE_APP} to see it as fully-functional and not in need of
|
|
690
|
+
replacement.
|
|
691
|
+
|
|
692
|
+
This will not modify your infrastructure directly. It only avoids
|
|
693
|
+
${const_1.TITLE_APP} planning to replace a tainted instance in a future operation.
|
|
694
|
+
|
|
695
|
+
Options:
|
|
696
|
+
|
|
697
|
+
-allow-missing If specified, the command will succeed (exit code 0)
|
|
698
|
+
even if the resource is missing.
|
|
699
|
+
|
|
700
|
+
-lock=false Don't hold a state lock during the operation. This is
|
|
701
|
+
dangerous if others might concurrently run commands
|
|
702
|
+
against the same workspace.
|
|
703
|
+
|
|
704
|
+
-lock-timeout=0s Duration to retry a state lock.
|
|
705
|
+
|
|
706
|
+
-state, and -backup Custom paths for the state and backup files.
|
|
707
|
+
`.trim();
|
|
708
|
+
exports.HELP_VERSION = `
|
|
709
|
+
Usage: ${const_1.TITLE_CLI} version [options]
|
|
710
|
+
|
|
711
|
+
Displays the version of ${const_1.TITLE_APP}.
|
|
712
|
+
`.trim();
|
|
713
|
+
exports.HELP_WORKSPACE = `
|
|
714
|
+
Usage: ${const_1.TITLE_CLI} [global options] workspace
|
|
715
|
+
|
|
716
|
+
new, list, show, select and delete ${const_1.TITLE_APP} workspaces.
|
|
717
|
+
|
|
718
|
+
Subcommands:
|
|
719
|
+
delete Delete a workspace
|
|
720
|
+
list List Workspaces
|
|
721
|
+
new Create a new workspace
|
|
722
|
+
select Select a workspace
|
|
723
|
+
show Show the name of the current workspace
|
|
724
|
+
`.trim();
|
|
725
|
+
exports.HELP_DIFF = `
|
|
726
|
+
Usage: ${const_1.TITLE_CLI} [global options] diff [options]
|
|
727
|
+
|
|
728
|
+
Show drift between local configuration and state.
|
|
729
|
+
`.trim();
|
|
730
|
+
exports.HELP_REPORT = `
|
|
731
|
+
Usage: ${const_1.TITLE_CLI} [global options] report <type> [options]
|
|
732
|
+
|
|
733
|
+
Generates multi-dimensional test reports from the local state.
|
|
734
|
+
Available report types are grouped by scope:
|
|
735
|
+
|
|
736
|
+
📦 Scope: Test Case
|
|
737
|
+
testcase-summary List of all test cases and their status
|
|
738
|
+
test-case-activity Dashboard of test cases with graphs and trends
|
|
739
|
+
|
|
740
|
+
🏃 Scope: Test Run
|
|
741
|
+
testrun-summary Test runs and their pass/fail metrics
|
|
742
|
+
testrun-detailed In-depth view of a specific Test Run
|
|
743
|
+
|
|
744
|
+
📋 Scope: Test Plan
|
|
745
|
+
testplan-summary Overall Test Plan Progress and linked test runs
|
|
746
|
+
|
|
747
|
+
🌐 Cross-Scope (Multi-dimensional)
|
|
748
|
+
defects List of failed/blocked tests with issue links
|
|
749
|
+
traceability Mapping between requirements/tags and test runs
|
|
750
|
+
coverage Percentage of passed tests grouped by tags
|
|
751
|
+
two-dimensional Status distribution matrix
|
|
752
|
+
raw Extract all data for custom reporting
|
|
753
|
+
|
|
754
|
+
Options:
|
|
755
|
+
|
|
756
|
+
-format <md|csv|json> Output format. Default is "md" (Markdown).
|
|
757
|
+
-out <path> Path to save the generated report.
|
|
758
|
+
-filter <key=val> Filter data by any state attribute. Can be
|
|
759
|
+
specified multiple times.
|
|
760
|
+
-groupBy <field> Group results dynamically by a specific field
|
|
761
|
+
using JSONPath (e.g. attributes.custom_fields.sprint).
|
|
762
|
+
-apply Create a GitHub Issue for the report.
|
|
763
|
+
-field <key=val> Custom field values to attach when -apply is used.
|
|
764
|
+
Also accepts a JSON string (e.g. '{"key": "val"}').
|
|
765
|
+
Can be specified multiple times.
|
|
766
|
+
`.trim();
|
|
767
|
+
function getCommandHelp(command) {
|
|
768
|
+
switch (command) {
|
|
769
|
+
case 'init': return exports.HELP_INIT;
|
|
770
|
+
case 'validate': return exports.HELP_VALIDATE;
|
|
771
|
+
case 'plan': return exports.HELP_PLAN;
|
|
772
|
+
case 'apply': return exports.HELP_APPLY;
|
|
773
|
+
case 'destroy': return exports.HELP_DESTROY;
|
|
774
|
+
case 'import': return exports.HELP_IMPORT;
|
|
775
|
+
case 'refresh': return exports.HELP_REFRESH;
|
|
776
|
+
case 'diff': return exports.HELP_DIFF;
|
|
777
|
+
case 'show': return exports.HELP_SHOW;
|
|
778
|
+
case 'fmt': return exports.HELP_FMT;
|
|
779
|
+
case 'force-unlock': return exports.HELP_FORCE_UNLOCK;
|
|
780
|
+
case 'login': return exports.HELP_LOGIN;
|
|
781
|
+
case 'workspace': return exports.HELP_WORKSPACE;
|
|
782
|
+
case 'report': return exports.HELP_REPORT;
|
|
783
|
+
case 'logout': return exports.HELP_LOGOUT;
|
|
784
|
+
case 'state': return exports.HELP_STATE;
|
|
785
|
+
case 'state identities': return exports.HELP_STATE_IDENTITIES;
|
|
786
|
+
case 'state list': return exports.HELP_STATE_LIST;
|
|
787
|
+
case 'state mv': return exports.HELP_STATE_MV;
|
|
788
|
+
case 'state pull': return exports.HELP_STATE_PULL;
|
|
789
|
+
case 'state push': return exports.HELP_STATE_PUSH;
|
|
790
|
+
case 'state rm': return exports.HELP_STATE_RM;
|
|
791
|
+
case 'state show': return exports.HELP_STATE_SHOW;
|
|
792
|
+
case 'taint': return exports.HELP_TAINT;
|
|
793
|
+
case 'untaint': return exports.HELP_UNTAINT;
|
|
794
|
+
case 'version': return exports.HELP_VERSION;
|
|
795
|
+
default: return null;
|
|
796
|
+
}
|
|
797
|
+
}
|