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

Incorrect spec path relayed to dashboard #22971

Closed
rockhold opened this issue Jul 28, 2022 · 4 comments · Fixed by #23833
Closed

Incorrect spec path relayed to dashboard #22971

rockhold opened this issue Jul 28, 2022 · 4 comments · Fixed by #23833
Assignees

Comments

@rockhold
Copy link

Current behavior

An issue was logged to the dashboard about an incorrect GitHub link for specs, which upon further investigation, seems to suggest the test runner is at fault for the incorrect link. Speaking with @RobBickel about the issue, he shared some details of his investigation, noting the following:

cypress-services derives it from the database. It is constructed from the codeframe. The codeframe is generated in the test runner. The test runner uses the error message to generate a stacktrace, and uses the file uri from where the occured in the error, applies some regex, and adds the relative path to the codeframe. Most of the time the regex and join work just fine, but sometimes we get an bad url which causes that to boil up to the customer clicking and getting 404 from the dash.

Looking at an example generated link that fails compared to what it SHOULD BE, it is possible that monorepo's mess with the current logic.

Bad Link:
https://github.com/cypress-io/cypress-services/blob/5915dd88fd957431fbb1ee0642bf7e69292c62c1/cypress/integration/organizations/ProjectsList_spec.ts#L480

Good Link:
https://github.com/cypress-io/cypress-services/blob/5915dd88fd957431fbb1ee0642bf7e69292c62c1/frontend/packages/dashboard/cypress/integration/organizations/ProjectsList_spec.ts#L480

For more information regarding internal conversations about this issue, see the Cloud issue referenced above.

Desired behavior

When the dashboard displays a link for a failed spec, the URL is correct.

Test code to reproduce

  • Record a failing test to the dashboard (Note: this may have to be part of a monorepo)
  • Within Latest Runs, find the run including your failed test and click on it
  • Find and click on the failed test
  • Within the overlay that displays to the right, find and click on the link to the failing spec file
  • Note the 404 message

Cypress Version

10.3.1

Other

Here's a screenshot showing the specific link that is sometimes incorrect.
image

@rachelruderman
Copy link
Contributor

@rachelruderman
Copy link
Contributor

I agree with @RobBickel's assessment that this is related to monorepos given that...

  1. Testing with cypress-examples-kitchensink single repo worked as expected. See dashboard link
  2. Our very own monorepo for the Cypress app is experiencing the same error. See dashboard link

@rockhold
Copy link
Author

As you roll off Fire Watch this iteration, @rachelruderman let's pick this one back up. I've added it to the next iteration.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 27, 2022

Released in 10.9.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v10.9.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Sep 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants