Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Upgrade to 2.0

Upgrade @currents/cmd from 1.x to 2.0: the breaking changes and the commands to change in scripts and CI jobs

@currents/cmd 2.0.0 groups the commands by resource: currents upload is currents run upload, currents cancel is currents run cancel, and currents api get-run is currents run get. This page lists the breaking changes and what to change in scripts and CI jobs. The full list is in the changelog.

Steps

1

Use Node.js 20 or later

@currents/cmd 2.0.0 requires Node.js 20 or later. In GitHub Actions, set node-version in actions/setup-node to 20 or later.

2

Install 2.0.0

npm install @currents/cmd@2 --save-dev
3

Install Jest where you upload sharded Jest results

@currents/cmd 2.0.1 and later do not install Jest. To upload the results of a sharded @currents/jest run (--shard), currents run upload runs the Jest installed in the current folder to list every test of the suite: one shard's results do not hold the tests of the other shards.

Run the upload of a shard in a folder where Jest 29.5 or later is installed, usually the project folder after npm ci. Without it, the upload fails:

Jest discovery needs the "jest" package, and it is not installed in /home/runner/work/app. Run the command from the folder of the project that ran the tests, or install Jest 29.5 or later: npm install --save-dev jest

Other uploads do not need Jest with @currents/cmd 2.0.2 or later. A run that is not sharded, also one filtered with -t or a test path, or stopped by --bail, takes the list of tests from its results. The upload of a Detox shard runs Jest without booting a device. With 2.0.1, filtered runs also need Jest in the current folder.

4

Rename the commands

1.x
2.0

currents --key ... (no command)

currents run upload --key ...

currents upload

currents run upload

currents convert ... followed by currents upload

currents run upload --input-format junit .... See Upload JUnit XML reports.

currents cancel

currents run cancel

currents api get-run

currents run get

The renamed commands take the same options, environment variables and exit codes.

currents upload, currents convert and currents api get-run still work in 2.0 but are not listed in the help. currents cancel still works and prints a deprecation warning. It will be removed in the next major version.

5

Check the options you also set as environment variables

A command-line option wins over its environment variable. In 1.x, the environment variable won. When both are set to different values, the command prints a warning:

WARNING  --project-id and CURRENTS_PROJECT_ID are set to different values; using --project-id

Remove the option or the variable you do not want the command to use.

6

Convert reports into an empty folder

currents run upload --input-format and currents convert fail when --output-dir or --report-dir names a folder that holds other files:

ERROR  The folder "out" is not empty. Reports already in it would be uploaded with the converted ones. Remove the folder, or leave out --output-dir to convert into a new folder in .currents.

In 1.x, the reports already in the folder were uploaded with the converted ones. Leave out --output-dir and --report-dir to convert into a new folder in .currents, or name a folder that is empty or does not exist.

What changes without a breaking error

  • currents without a command prints the help and exits with 1. In 1.x, it ran upload. With upload options or their environment variables set, it prints upload is no longer the default command. Run 'currents run upload ...' instead.

  • currents api takes a REST API route and sends a request to it, such as currents api /v1/runs/<run-id>.

  • The commit and branch come from @currents/commit-info 2.0.0. When git cannot read the repository, for example in a container that runs as another user, they come from the CI provider's variables. The repository URL is stored without the user name and password it can hold on CI, such as the job token in GitLab's CI_REPOSITORY_URL.

  • currents cache set and cache get without --id make the cache ID from the CI job on every CI provider they detect, not only GitHub Actions and GitLab CI. When they detect no CI job, they warn that the ID is random. See currents cache.

  • --debug output replaces keys with *****.

New commands

  • currents run attach: upload files, such as logs, to a run recorded in CI

  • currents session: capture an agent or browser session as evidence, attach screenshots and traces, and share a link

  • currents skill: install the agent skill that tells coding agents how to use the CLI

Last updated

Was this helpful?