question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When tests fail during `github-action@v3` the step does not emit failure exit code

See original GitHub issue

I’m executing parallelized tests recorded to the Cypress Dashboard using github-action@v3 Functionally everything works perfectly and as expected with the single exception that when tests fail the github-action@v3 step in my workflow appear with a grey checkmark instead of the expected red X. Thus that workflow run appears to have passed with a green checkmark when reviewing my Github workflow run history.

WORKS:

  • The Cypress test are successfully executed in parallel
  • Cypress successfully adds PR comments when the test execution has completed
  • The correct pass/fail results are present in the PR comment
  • The PR comment links to the correct Cypress Dashboard run
  • github-action@v3 logs all have the correct pass/fail results
  • github-action@v3 logs all link to the correct Cypress Dashboard run

DOES NOT WORK:

  • github-action@v3 step looks like it passed even though it should have failed because there are failed tests

Workflow run showing cypress (chrome, 6) with a green checkmark, and github-action@v3 with a checkmark.

Screen Shot 2022-07-20 at 8 02 13 PM

Expanding github-action@v3 and it clearly includes failed tests but does not include a failure exit for the step.

Screen Shot 2022-07-20 at 7 52 20 PM

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
cgraham-rscommented, Sep 28, 2022

@admah Sorry for the delay, I’m confirming the way we were using Cypress Module API was the root cause of my issues.

Unsure how to make this better, but some comments:

  • The documentation exists and provides all of the code necessary to avoid this issue 🥇
  • But I obviously didn’t realize the impact in relation to my CI jobs
  • Maybe call out how CI jobs require handling of results to correctly fail so people like me have less of a chance to fall into this scenario?
0reactions
kumarajiv1commented, Dec 16, 2022

@cgraham-rs , appreciate it for making me take a look again. I was doing console.log instead of console.error. The solution worked for me. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting exit codes for actions - GitHub Docs
You can use exit codes to set the status of an action. GitHub displays statuses to indicate passing or failing actions.
Read more >
No output on “Process completed with exit code 1” · Issue #1279
According to my troubleshooting, the error seems was returned by a certain command line in the called .sh script.
Read more >
Properly show continue-on-error jobs/steps in PR UI #15452
I do not want the job to cause other pull requests or CI workflows on main branches to reflect as "failing" or "failed"...
Read more >
Failing unit tests does not abort the action · Issue #119 - GitHub
I noticed in the job logs that my unit tests failed, but the action continued, making it seem that the check passed. But...
Read more >
Error: The process '/usr/bin/git' failed with exit code 128 · Issue ...
The issue in our case was with the auth token that gets generated for each run that the checkout action uses by default...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found