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

refactor: use an xml parser for less brittle mocha result verification #30865

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

Conversation

cacieprins
Copy link
Contributor

@cacieprins cacieprins commented Jan 13, 2025

  • Closes

Additional details

After running unit tests in CI, the verify-mocha-results script is executed. This script ensures that:

  • An expected number of junit reports are in /tmp/cypress/junit
  • Reports do not have sensitive values in them
  • Suites do not have failing tests

Currently, a regex is used to extract attributes from the xml regarding the success or failure of tests for a given report. Unfortunately, mocha's junit reporter writes attributes in a different order than vitest's junit reporter. Using an xml parser allows the verification step to be more flexible about the order of attributes in the junit reports it parses.

Steps to test

How has the user experience changed?

PR Tasks

@cacieprins cacieprins marked this pull request as ready for review January 13, 2025 15:47
Copy link

cypress bot commented Jan 13, 2025

cypress    Run #60092

Run Properties:  status check passed Passed #60092  •  git commit 1b2defb84d: fix merge
Project cypress
Branch Review cacie/refactor/test-result-verification
Run status status check passed Passed #60092
Run duration 16m 49s
Commit git commit 1b2defb84d: fix merge
Committer Cacie Prins
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 73
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 5621
View all changes introduced in this branch ↗︎

Warning

No Report: Something went wrong and we could not generate a report for the Application Quality products.

@jennifer-shehane
Copy link
Member

@cacieprins Could you resolve the conflicts here?

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.

3 participants