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
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 jestOther 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.
Rename the commands
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.
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-idRemove the option or the variable you do not want the command to use.
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
currentswithout a command prints the help and exits with1. In 1.x, it ranupload. With upload options or their environment variables set, it printsupload is no longer the default command. Run 'currents run upload ...' instead.currents apitakes a REST API route and sends a request to it, such ascurrents api /v1/runs/<run-id>.The commit and branch come from
@currents/commit-info2.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'sCI_REPOSITORY_URL.currents cache setandcache getwithout--idmake 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.--debugoutput replaces keys with*****.
New commands
currents run attach: upload files, such as logs, to a run recorded in CIcurrents session: capture an agent or browser session as evidence, attach screenshots and traces, and share a linkcurrents skill: install the agent skill that tells coding agents how to use the CLI
Last updated
Was this helpful?