New functionality to rerun failed tests. When selecting this option (see image below), only a subset of tests are rerun, instead of rerunning the entire test suite when a transient test failure arises.
Historically, when your testing job in a workflow has flaky tests, the only option to get to a successful workflow was to rerun your workflow from failed. This type of rerun executes all tests from your testing job, including tests that passed, which prolongs time-to-feedback and consumes credits unneccessarily.
This functionality reruns failed tests from the same commit, not new ones.
This is fantastic feature. Has anyone gotten this to work in a test suite also submits coverage to CodeClimate? Trying to figure out how to get coverage to pass when the workflow run is only running a few of the tests.
@heyogrady I’m curious what error message you’re getting back from CodeClimate? Is it the lack of a coverage report or an incomplete report?
I’m talking to another user where I’m suggesting adding in some logic which says, “if report exists, pass it along; else, do nothing” (ie. don’t fail)
I’m having trouble because the following error has occurred.
Error: Failed to download and install circleci-tests-plugin-cli plugin: Error downloading circleci-tests-plugin-cli: rename /tmp/circleci-tests-plugin-cli/1.0.5743-3632d00/linux/amd64/circleci-tests-plugin-cli.tmp /tmp/circleci-tests-plugin-cli/1.0.5743-3632d00/linux/amd64/circleci-tests-plugin-cli: no such file or directory
I have modified my yml file referring to the python example in the docs. The job runs (and has test failures as expected) but the feature (rerun failed tests only) is not showing up in UI post the run.
Any suggestions on what could be going wrong ? Below is the job info from my config.yml. Thanks !
Hi @mehtarupesh, the feature is currently in a closed preview/beta. We’re hoping to open this up to all users in the upcoming weeks at which point you’ll have the option available in the UI.
I am also seeing “Error: Failed to download and install circleci-tests-plugin-cli plugin: Error downloading circleci-tests-plugin-cli: rename /tmp/circleci-tests-plugin-cli/1.0.5743-3632d00/linux/amd64/circleci-tests-plugin-cli.tmp /tmp/circleci-tests-plugin-cli/1.0.5743-3632d00/linux/amd64/circleci-tests-plugin-cli: no such file or directory”
I think it might be happening when you execute “circleci tests run” in parallel more than once on a single executor. I do not encounter the issue when I execute “circleci tests run” only once. As soon as it is exected a second time, the install fails with this error message. So my guess is that “circle tests run” trigger this installation implicitly, but it is not safe to run multiple installations in parallel.
Here is why we would execute the command multiple times. We have a monorepo with multiple npm packages in one repo. Our CircleCI config triggers the tests in all packages via lerna (a Node.js monorepo management tool) in parallel. The test commands in the individual packages then start the actual tests via “circleci tests run”, and as soon as this is started for the second package, the install fails.
Link to the failed job: https --app.circleci.com/pipelines/github/instana/nodejs/5714/workflows/d5d37991-1869-42eb-bf12-4a805f70126c/jobs/20147
Thank you! My problem was exactly the same as yours.
I resolved this issue by running circleci tests run --help before executing the test to complete the installation process.
One update, we saw a handful of reports of users running into intermittent jobs that failed with exit code 141. We have just pushed what we believe is a fix to that issue.
If you see a job fail with exit code 141, please let me know!
Hey, it seems to work nicely, I can re-run my failed Cypress tests, however I see this error in the logs right after Cypress results:
WARN[2023-05-16T12:10:36Z] There was an error when uploading test results from with batchID 3c53b247-4b13-4b63-ba9d-2f41dca214e3: no path given
DEBU[2023-05-16T12:10:36Z] Error encountered with test batch 3c53b247-4b13-4b63-ba9d-2f41dca214e3
INFO[2023-05-16T12:10:36Z] ending execution
hey @villelahdenvuo I am trying to get this working for our cypress tests but hitting some issues.
We currently use the circleci test split command but when trying to change that to use tests run instead as per docs we get errors. Can't run because no spec files were found.
Do you mind sharing an example of your setup?
If you’d be wiling to share it, @villelahdenvuo, can you paste the command you’re using with the circleci tests run tool? (obscure whatever path or project name information you’d like)
I think you could have the result you’re looking for (the list of values sent to the -spec flag comma separated) by using the tr translate tool, like so:
Removing the initial echo command, and having the contents of the --command flag be --command="tr ' ' ',' | xargs -I {} cypress run -spec {}".
The tool currently expects input to the tool to be space or newline delimited, but how it’s assembled or arranged for the specific test runner you’re using is very flexible, depending on your comfort and familiarity with built-in bash tools.