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

chore: fix mocha junit reporter when running mocha <6 #29481

Merged
merged 3 commits into from May 7, 2024

Conversation

ryanthemanuel
Copy link
Collaborator

Additional details

Currently, we have an issue throughout the monorepo where mocha-junit-reporter will fail when running via mocha in versions under 6. This manifests itself via the failure:

Unhandled rejection TypeError: Base.generateDiff is not a function

In addition to not seeing the actual failure, since this is a crash, it causes the reporting to get all messed up in CI and you don't easily see which package is causing a problem.

To fix this, I am going to patch mocha-junit-reporter and not attempt to do the generateDiff if we're under a certain version. I would propose this fix back to them, but it appears they're not supporting less than 6 anymore: https://github.com/michaelleeallen/mocha-junit-reporter/blob/master/.github/workflows/build.yml#L11

In addition, since I was using the cli package as a test bed, I fixed a few tests to be able to properly run on an M1.

Steps to test

Run the various unit tests in each package locally. To specifically run the cli tests:

yarn workspace cypress test-unit

How has the user experience changed?

PR Tasks

Copy link

cypress bot commented May 7, 2024

6 flaky tests on run #55328 ↗︎

0 29193 1328 0 Flakiness 6

Details:

Update cli/test/lib/util_spec.js
Project: cypress Commit: 963e5e73ea
Status: Passed Duration: 19:01 💡
Started: May 7, 2024 2:09 PM Ended: May 7, 2024 2:28 PM
Flakiness  querying/querying.cy.js • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
... > throws when alias property isnt a digit or `all` Test Replay
Flakiness  net_stubbing.cy.ts • 2 flaky tests • 5x-driver-chrome

View Output

Test Artifacts
network stubbing > waiting and aliasing > yields the expected interception when two requests are raced Test Replay
... > stops waiting when an fetch request is canceled Test Replay
Flakiness  net_stubbing.cy.ts • 3 flaky tests • 5x-driver-webkit

View Output

Test Artifacts
network stubbing > intercepting request > can delay and throttle a StaticResponse
    </td>
  </tr>
  <tr>
    <td colspan="2">
      <a href="https://cloud.cypress.io/projects/ypt4pf/runs/55328/overview/5ef5077f-8f6a-4fd4-975c-118c3df0c140?reviewViewBy=FLAKY&utm_source=github&utm_medium=flaky&utm_campaign=view%20test">
        ... > with `resourceType` > can match a proxied image request by resourceType
      </a>
    </td>
    <td>
      
    </td>
  </tr>
  <tr>
    <td colspan="2">
      <a href="https://cloud.cypress.io/projects/ypt4pf/runs/55328/overview/11046fcf-5da4-4b89-b707-119c4a04ef3d?reviewViewBy=FLAKY&utm_source=github&utm_medium=flaky&utm_campaign=view%20test">
        ... > stops waiting when an xhr request is canceled
      </a>
    </td>
    <td>
      
    </td>
  </tr></table>

Review all test suite changes for PR #29481 ↗︎

@ryanthemanuel ryanthemanuel merged commit d875569 into develop May 7, 2024
79 of 82 checks passed
@ryanthemanuel ryanthemanuel deleted the ryanm/chore/fix-mocha-junit-reporter branch May 7, 2024 15:10
@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 8, 2024

Released in 13.9.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators May 8, 2024
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 this pull request may close these issues.

None yet

3 participants