Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Error codeframes in retry failures display the code that produced the error #30962

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

cacieprins
Copy link
Contributor

Additional details

With Cypress 14.0.0, the raw user invocation stacks can include codepoints that are internal to Cypress. The patterns we were searching during 14.0.0 were not robust enough.

Depending on several factors, the path to the first userland codepoint had many potential patterns. Trying to include them all one by one proved troublesome. Instead, now, we identify which style of paths the internal codepoints use and strip them out - there are fewer potential options here.

Steps to test

Write an E2E test that fails a determinate number of times before passing, and configure it to retry until it passes. With the binary, run the test and expand one of the failed test attempts. The codeframe should point to the assertion failure in the test.

How has the user experience changed?

PR Tasks

@cacieprins cacieprins marked this pull request as ready for review January 28, 2025 15:05
@AtofStryker AtofStryker self-requested a review January 28, 2025 15:35
Copy link

cypress bot commented Jan 28, 2025

cypress    Run #60093

Run Properties:  status check passed Passed #60093  •  git commit 9168cc4352: Merge branch 'develop' into cacie/30927/retry-error-codeframe
Project cypress
Branch Review cacie/30927/retry-error-codeframe
Run status status check passed Passed #60093
Run duration 17m 53s
Commit git commit 9168cc4352: Merge branch 'develop' into cacie/30927/retry-error-codeframe
Committer Cacie Prins
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 7
Tests that did not run due to a developer annotating a test with .skip  Pending 1099
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 26522
View all changes introduced in this branch ↗︎
UI Coverage  45.68%
  Untested elements 190  
  Tested elements 164  
Accessibility  92.54%
  Failed rules  3 critical   8 serious   2 moderate   2 minor
  Failed elements 891  

Copy link
Contributor

@AtofStryker AtofStryker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested with the built darwin arm64 binary and code frame is present in each retry which is not the case in 14.0.1

@@ -10,6 +10,7 @@ _Released 1/28/2025_
- Fixed a regression introduced in [`14.0.0`](https://docs.cypress.io/guides/references/changelog#14-0-0) where the incorrect visiblity would be returned when either `overflow-x` or `overflow-y` was visible but the other one was clipping. Fixed in [#30934](https://github.com/cypress-io/cypress/pull/30934).
- Fixed an issue where an `option` element would not return the correct visibility if its parent element has a clipping overflow. Fixed in [#30934](https://github.com/cypress-io/cypress/pull/30934).
- Fixed an issue where non-HTMLElement(s) may fail during assertions. Fixes [#30944](https://github.com/cypress-io/cypress/issues/30944)
- Fixed a regression introduced in [`14.0.0`](https://docs.cypress.io/guides/references/changelog#14-0-0) where error codeframes in the runner UI were not populated with the correct data in failed retry attempts. Fixes [#30927](https://github.com/cypress-io/cypress/issues/30927).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to move this to 14.0.2


const invocationFrame = second ?? first

//console.log(invocationFrame)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//console.log(invocationFrame)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing codeframe with the error that causes a test to be retried
2 participants