@testrigor/testrigor-cli 2.0.0 → 2.0.1

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/README.md CHANGED
@@ -102,6 +102,11 @@ This overrides the device config stored in the test suite and forces mobile mode
102
102
 
103
103
  Every push to `master` runs the CircleCI `publish` workflow. It builds the tarballs, then publishes the package to npm under the `latest` tag. npm refuses to republish an existing version, so a change is only released when it bumps the version.
104
104
 
105
+ Pull requests to `master` must pass two CircleCI checks before they can be merged:
106
+
107
+ - `ci/circleci: test` runs the unit tests and the linter (`npm test`).
108
+ - `ci/circleci: check-version` fails unless the version in `package.json` is higher than every version on npm and matches `package-lock.json`. Every PR needs a version bump, including ones that only change docs or CI. Run the same check locally with `npx ts-node scripts/check-version.ts`.
109
+
105
110
  1. Pick the [semver](https://semver.org) bump: `patch` for fixes, `minor` for new flags or commands, `major` for breaking changes.
106
111
  2. Bump the version with npm (don't edit `package.json` by hand):
107
112
 
@@ -110,186 +115,7 @@ Every push to `master` runs the CircleCI `publish` workflow. It builds the tarba
110
115
  npm version patch --no-git-tag-version
111
116
  ```
112
117
 
113
- This updates the version in `package.json` and in both root entries of `package-lock.json` (`version` and `packages[""].version`). `--no-git-tag-version` stops npm from creating its own commit and `v*` tag. npm also runs the `version` script (`oclif readme && git add README.md`). That script loads the commands from `dist`, which is why you build first. It only rewrites README sections between oclif markers such as `<!-- commands -->
114
- * [`testrigor authenticate`](#testrigor-authenticate)
115
- * [`testrigor help [COMMANDS]`](#testrigor-help-commands)
116
- * [`testrigor test-suite config`](#testrigor-test-suite-config)
117
- * [`testrigor test-suite run [TESTSUITEID]`](#testrigor-test-suite-run-testsuiteid)
118
- * [`testrigor test-suite validate-syntax [TESTSUITEID]`](#testrigor-test-suite-validate-syntax-testsuiteid)
119
-
120
- ## `testrigor authenticate`
121
-
122
- Set your testRigor authentication token
123
-
124
- ```
125
- USAGE
126
- $ testrigor authenticate [--token <value>]
127
-
128
- FLAGS
129
- --token=<value> API authentication token to store, instead of prompting for it
130
-
131
- DESCRIPTION
132
- Set your testRigor authentication token
133
-
134
- EXAMPLES
135
- $ testrigor authenticate
136
-
137
- Prompts for your API authentication token
138
-
139
- $ testrigor authenticate --token YOUR_TOKEN
140
-
141
- Sets the token without prompting (for CI and scripts)
142
-
143
- Use 'testrigor test-suite config' to set default test suite ID separately
144
-
145
- Config will be stored in ~/.testrigor/testrigor.yml
146
- ```
147
-
148
- _See code: [src/commands/authenticate.ts](https://github.com/TestRigor/testrigor-cli/blob/v2.0.0/src/commands/authenticate.ts)_
149
-
150
- ## `testrigor help [COMMANDS]`
151
-
152
- Display help for testrigor.
153
-
154
- ```
155
- USAGE
156
- $ testrigor help [COMMANDS...] [-n]
157
-
158
- ARGUMENTS
159
- [COMMANDS...] Command to show help for.
160
-
161
- FLAGS
162
- -n, --nested-commands Include all nested commands in the output.
163
-
164
- DESCRIPTION
165
- Display help for testrigor.
166
- ```
167
-
168
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.20/src/commands/help.ts)_
169
-
170
- ## `testrigor test-suite config`
171
-
172
- Configure test suite settings and default test suite ID
173
-
174
- ```
175
- USAGE
176
- $ testrigor test-suite config [--default <value> | --delete | --show]
177
-
178
- FLAGS
179
- --default=<value> Set the default test suite ID
180
- --delete Remove the default test suite ID
181
- --show Show current configuration
182
-
183
- DESCRIPTION
184
- Configure test suite settings and default test suite ID
185
-
186
- EXAMPLES
187
- $ testrigor test-suite config --default TEST-SUITE-ID
188
-
189
- $ testrigor test-suite config --show
190
-
191
- $ testrigor test-suite config --delete
192
- ```
193
-
194
- _See code: [src/commands/test-suite/config.ts](https://github.com/TestRigor/testrigor-cli/blob/v2.0.0/src/commands/test-suite/config.ts)_
195
-
196
- ## `testrigor test-suite run [TESTSUITEID]`
197
-
198
- Run all tests of a Test Suite
199
-
200
- ```
201
- USAGE
202
- $ testrigor test-suite run [TESTSUITEID] [--auth-token <value>] [-t <value>] [--min-port <value>] [--max-port
203
- <value>] [--verbose] [-w] [--branch <value> --commit <value>] [--localhost] [--url <value>]
204
- [--junit-report-save-path <value>] [--variables-path <value>] [--test-cases-path <value>] [--rules-path <value>]
205
- [--settings-path <value>] [--local-test-nodes-path <value>] [--test-case-uuid <value>...] [--auto-create-ai-rules]
206
- [--explicit-mutations] [--labels <value>...] [--excluded-labels <value>...] [--base-url-web <value>] [--base-url-api
207
- <value>] [--chrome-extension <value>... | --file-path <value>] [--xray-execution-key <value>]
208
-
209
- ARGUMENTS
210
- [TESTSUITEID] The test suite id (optional if set in config)
211
-
212
- FLAGS
213
- -w, --async Don't wait for the test suite to finish
214
- --auto-create-ai-rules Enable auto create AI based rules
215
- --base-url-api=<value> Base URL for API2 (e.g., https://api2.testrigor.com)
216
- --base-url-web=<value> Base URL for web interface (e.g., https://app.testrigor.com)
217
- --branch=<value> [env: TR_BRANCH] The branch name
218
- --chrome-extension=<value>... Chrome extension: "name=EXT_NAME file=PATH_TO_CRX"
219
- --commit=<value> [env: TR_COMMIT] The commit
220
- --excluded-labels=<value>... Not run tests of specific labels
221
- --explicit-mutations In cases where you are always using mutations, such as storing test cases in
222
- your own repository, and you always send us the set of test cases you have
223
- through our API you should send "--explicit-mutations"
224
- --file-path=<value> Path to the file stored locally. It will upload the new file to be used. File
225
- type should be according to the file type accepted for the Test Suite type of
226
- testing. If the parameter --url is used, this parameter will be ignored.
227
- --junit-report-save-path=<value> JUnit report save path
228
- --labels=<value>... Run tests of specific labels
229
- --local-test-nodes-path=<value> Path to a YAML or JSON file with local test nodes configuration
230
- --localhost Localhost run (auto-detects web vs mobile)
231
- --max-port=<value> [default: 50000] Max port for tunnel
232
- --min-port=<value> [default: 40000] Min port for tunnel
233
- --rules-path=<value> Rules path
234
- --settings-path=<value> Settings path
235
- --test-case-uuid=<value>... Test case uuid (can be repeated). Requires --url (web) or --file-path (mobile
236
- app upload).
237
- --test-cases-path=<value> Test cases files
238
- --url=<value> The url
239
- --variables-path=<value> Variables path
240
- --xray-execution-key=<value> Reuse an existing Xray Cloud Test Execution by key (e.g. XR-123) instead of
241
- creating a new one. Optional; leave blank to create a new execution.
242
-
243
- GLOBAL FLAGS
244
- -t, --token=<value> Suite authentication token
245
- --auth-token=<value> Personal authentication token
246
- --verbose Verbose output
247
-
248
- DESCRIPTION
249
- Run all tests of a Test Suite
250
- ```
251
-
252
- _See code: [src/commands/test-suite/run.ts](https://github.com/TestRigor/testrigor-cli/blob/v2.0.0/src/commands/test-suite/run.ts)_
253
-
254
- ## `testrigor test-suite validate-syntax [TESTSUITEID]`
255
-
256
- Validate step syntax against a test suite's reusable rules, without running the steps
257
-
258
- ```
259
- USAGE
260
- $ testrigor test-suite validate-syntax [TESTSUITEID] [--auth-token <value>] [-t <value>] [--min-port <value>] [--max-port
261
- <value>] [--verbose] [--steps <value> | --test-cases-path <value>] [--base-url-api <value>] [--rules-path <value>]
262
- [--explicit-mutations]
263
-
264
- ARGUMENTS
265
- [TESTSUITEID] The test suite id (optional if set in config)
266
-
267
- FLAGS
268
- --base-url-api=<value> Base URL for API2 (e.g., https://api2.testrigor.com)
269
- --explicit-mutations Validate using only the supplied rules instead of merging them with the suite's saved rules
270
- --max-port=<value> [default: 50000] Max port for tunnel
271
- --min-port=<value> [default: 40000] Min port for tunnel
272
- --rules-path=<value> Ad hoc reusable rules to validate against, for rules not yet saved to this suite (same glob
273
- format as `test-suite run --rules-path`)
274
- --steps=<value> Raw step text to validate directly
275
- --test-cases-path=<value> Test case files to validate (same glob format as `test-suite run --test-cases-path`)
276
-
277
- GLOBAL FLAGS
278
- -t, --token=<value> Suite authentication token
279
- --auth-token=<value> Personal authentication token
280
- --verbose Verbose output
281
-
282
- DESCRIPTION
283
- Validate step syntax against a test suite's reusable rules, without running the steps
284
-
285
- EXAMPLES
286
- $ testrigor test-suite validate-syntax <test-suite-id> --steps "click \"Login\""
287
-
288
- $ testrigor test-suite validate-syntax <test-suite-id> --test-cases-path "test_cases/**/*.{yaml,txt}"
289
- ```
290
-
291
- _See code: [src/commands/test-suite/validate-syntax.ts](https://github.com/TestRigor/testrigor-cli/blob/v2.0.0/src/commands/test-suite/validate-syntax.ts)_
292
- <!-- commandsstop -->`, so this README currently stays unchanged.
118
+ This updates the version in `package.json` and in both root entries of `package-lock.json` (`version` and `packages[""].version`). `--no-git-tag-version` stops npm from creating its own commit and `v*` tag. npm also runs the `version` script (`oclif readme && git add README.md`). That script loads the commands from `dist`, which is why you build first. It only rewrites README sections between oclif's marker comments (`commands`, `usage`, `toc`). This README has none, so it stays unchanged. Don't write those markers literally anywhere in the README, not even in code spans: `oclif readme` also runs on every publish and would insert the command docs there.
293
119
  3. Check that the diff only touches the version fields, then build and test from the lockfile:
294
120
 
295
121
  ```
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@testrigor/testrigor-cli",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@testrigor/testrigor-cli",
9
- "version": "2.0.0",
9
+ "version": "2.0.1",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
@@ -32,6 +32,7 @@
32
32
  "@types/is-ci": "^3.0.4",
33
33
  "@types/mocha": "^9.0.0",
34
34
  "@types/node": "^20.19.43",
35
+ "@types/semver": "^7.8.0",
35
36
  "@types/tar-stream": "3.1.5",
36
37
  "@types/unzip-stream": "^0.3.4",
37
38
  "@types/unzipper": "^0.10.9",
@@ -46,6 +47,7 @@
46
47
  "mocha": "^12.0.2",
47
48
  "nock": "^14.0.17",
48
49
  "oclif": "^6.0.2",
50
+ "semver": "^7.8.5",
49
51
  "shx": "^0.3.4",
50
52
  "ts-node": "^10.9.1",
51
53
  "tslib": "^2.6.1",
@@ -3124,6 +3126,13 @@
3124
3126
  "integrity": "sha512-3xSjTp3v03X/lSQLkczaN9UIEwJMoMCA1+Nb5HfbJEQWogdeQIyVtTvxPXDQjZ5zws8rFQfVfRdz03ARihPJgw==",
3125
3127
  "license": "MIT"
3126
3128
  },
3129
+ "node_modules/@types/semver": {
3130
+ "version": "7.8.0",
3131
+ "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.8.0.tgz",
3132
+ "integrity": "sha512-1mAINjtQCXXeLkJ9ehXkwOcBpqtLxiVtKhpUf83DdRNdQKV0iXZpaHYqRr7nj+wvxuJzoAmAwXI+sCNMv1CzLQ==",
3133
+ "dev": true,
3134
+ "license": "MIT"
3135
+ },
3127
3136
  "node_modules/@types/sinon": {
3128
3137
  "version": "22.0.0",
3129
3138
  "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-22.0.0.tgz",
@@ -446,5 +446,5 @@
446
446
  ]
447
447
  }
448
448
  },
449
- "version": "2.0.0"
449
+ "version": "2.0.1"
450
450
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testrigor/testrigor-cli",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "TestRigor Command Line",
5
5
  "author": "Ivo Parun Rua @parunruaivo",
6
6
  "bin": {
@@ -39,6 +39,7 @@
39
39
  "@types/is-ci": "^3.0.4",
40
40
  "@types/mocha": "^9.0.0",
41
41
  "@types/node": "^20.19.43",
42
+ "@types/semver": "^7.8.0",
42
43
  "@types/tar-stream": "3.1.5",
43
44
  "@types/unzip-stream": "^0.3.4",
44
45
  "@types/unzipper": "^0.10.9",
@@ -53,6 +54,7 @@
53
54
  "mocha": "^12.0.2",
54
55
  "nock": "^14.0.17",
55
56
  "oclif": "^6.0.2",
57
+ "semver": "^7.8.5",
56
58
  "shx": "^0.3.4",
57
59
  "ts-node": "^10.9.1",
58
60
  "tslib": "^2.6.1",