@currents/cmd 2.1.0 → 2.3.0
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 +22 -1
- package/dist/bin/index.js +49 -41
- package/dist/index.js +9 -8
- package/dist/skills/currents-cli/SKILL.md +22 -104
- package/{dist/skills/currents-cli/references → docs}/ci-setup.md +12 -1
- package/{dist/skills/currents-cli/references → docs}/sessions.md +4 -0
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ For JUnit XML reports, `run upload` converts them to the Currents format first,
|
|
|
29
29
|
npx currents run upload --project-id=xxx --key=yyy --input-format junit --input-file "reports/*.xml" --framework postman
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
`--framework` takes `postman`, `node`, `vitest` or `wdio`. The converted reports are saved to `--output-dir`, or `--report-dir`, or a new folder in `.currents`. A folder you name must be empty or not exist yet.
|
|
32
|
+
`--framework` takes `cypress`, `postman`, `node`, `vitest` or `wdio`. For Cypress run results saved by `after:run`, use `--input-format cypress-json --input-file results.json` without `--framework`: it uploads every attempt, screenshot and video. The converted reports are saved to `--output-dir`, or `--report-dir`, or a new folder in `.currents`. A folder you name must be empty or not exist yet.
|
|
33
33
|
|
|
34
34
|
ℹ️ Get familiar with [CI Build ID 📖](https://docs.currents.dev/guides/ci-build-id) before using `currents` in CI. It is **important** to set the `CI Build ID` explicitly using `--ci-build-id` option, if you are using CI sharding or multiple CI machines to parallelize your tests. If not set explicitly, the `CI Build ID` will be set to a random value.
|
|
35
35
|
|
|
@@ -46,6 +46,21 @@ Obtain `--project-id` and [--key](https://docs.currents.dev/guides/record-key) f
|
|
|
46
46
|
|
|
47
47
|
For [Detox](https://wix.github.io/Detox/) runs reported by `@currents/jest`, `currents run upload` also attaches the videos, screenshots and logs that Detox recorded to the matching test attempt, adds the element actions of `detox.trace.json` as steps, and uploads `detox.trace.json`. Run it after `detox test` exits: Detox finishes writing the files only then.
|
|
48
48
|
|
|
49
|
+
`currents run upload` applies the [actions](https://docs.currents.dev/guides/currents-actions) of the project to the results before it sends them. The tests already ran, so each attempt keeps its result, errors and artifacts:
|
|
50
|
+
|
|
51
|
+
- a skip action marks the test as skipped
|
|
52
|
+
- a quarantine action marks a failed test as skipped
|
|
53
|
+
- a tag action adds its tags to the test
|
|
54
|
+
|
|
55
|
+
The dashboard shows which action changed each test. Actions with regex or date conditions are not applied yet. The command uploads the results without actions when it can't get them.
|
|
56
|
+
|
|
57
|
+
With `--fail-on-failures`, or `CURRENTS_FAIL_ON_FAILURES=true`, the command exits with 1 after it uploads the results when a test failed, and lists the failed tests. A test that an action quarantined or skipped does not count. Let the test command pass and use the upload to fail the CI job, so a quarantined test does not fail it:
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
npx detox test || true
|
|
61
|
+
npx currents run upload --fail-on-failures
|
|
62
|
+
```
|
|
63
|
+
|
|
49
64
|
### Configuration
|
|
50
65
|
|
|
51
66
|
Please note that all options apart from `--project-id` and `--key` are optional.
|
|
@@ -59,8 +74,10 @@ Please note that all options apart from `--project-id` and `--key` are optional.
|
|
|
59
74
|
| `--ci-build-id` | `string` | The id of the build to record the test run. Read more: https://currents.dev/readme/guides/ci-build-id | `CURRENTS_CI_BUILD_ID` | `auto:[random-string]` |
|
|
60
75
|
| `--debug` | `boolean` | Enable debug logs | `CURRENTS_DEBUG` | `false` |
|
|
61
76
|
| `-t, --tag` | `string` | Comma-separated tag(s) for recorded runs in Currents | `CURRENTS_TAG` | - |
|
|
77
|
+
| `--environment` | `string` | The environment to label the run with, e.g. `staging` | `CURRENTS_ENVIRONMENT` | - |
|
|
62
78
|
| `--disable-title-tags` | `boolean` | Disable extracting tags from test title, e.g. `Test name @smoke` would not be tagged with `smoke` | `CURRENTS_DISABLE_TITLE_TAGS` | `false` |
|
|
63
79
|
| `--remove-title-tags` | `boolean` | Remove tags from test names in Currents, e.g. `Test name @smoke` becomes `Test name` in the dashboard | `CURRENTS_REMOVE_TITLE_TAGS` | `false` |
|
|
80
|
+
| `--fail-on-failures` | `boolean` | Exit with 1 after uploading when a test failed. A test quarantined or skipped by a Currents action does not count | `CURRENTS_FAIL_ON_FAILURES` | `false` |
|
|
64
81
|
|
|
65
82
|
An option on the command line wins over its environment variable. The configuration is also available by running the CLI command with the `--help` argument.
|
|
66
83
|
|
|
@@ -163,6 +180,10 @@ npx currents skill --install --dir .claude/skills
|
|
|
163
180
|
|
|
164
181
|
The skill is also in this repository, in `skills/currents-cli`: `npx skills add https://github.com/currents-dev/currents-reporter --skill currents-cli`.
|
|
165
182
|
|
|
183
|
+
## Guides
|
|
184
|
+
|
|
185
|
+
`npx currents docs` lists the guides that ship with the package, such as the CI setup steps. `npx currents docs <topic>` prints one as Markdown. The guides are in [docs/](./docs).
|
|
186
|
+
|
|
166
187
|
## Troubleshooting
|
|
167
188
|
|
|
168
189
|
Run the CLI command with the `--debug` argument or prefix it with `DEBUG="currents,currents:*"` to obtain detailed information about the command execution process. Keys are hidden in the debug output.
|