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(reporter): use default error formatter for JUnit #5626

Closed
wants to merge 4 commits into from

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Apr 26, 2024

Description

Since we now have reusable printErrorWrapper (introduced for github actions reporter #5093) to generate the default error formatting, probably using it for Junit would make sense.

This wrapper supports all the good things automatically:

  • expected/actual diff
  • stack
  • formatting of throw {somePlainObject} (which is what OP mentioned)

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Copy link

netlify bot commented Apr 26, 2024

Deploy Preview for fastidious-cascaron-4ded94 canceled.

Name Link
🔨 Latest commit ed781d5
🔍 Latest deploy log https://app.netlify.com/sites/fastidious-cascaron-4ded94/deploys/662b814c8a0e9e0008170970

@hi-ogawa hi-ogawa changed the title fix(reporter/junit): use same error formatting as default reporter fix(reporter): use default error formatter for junit Apr 26, 2024
@hi-ogawa hi-ogawa changed the title fix(reporter): use default error formatter for junit fix(reporter): use default error formatter for JUnit Apr 26, 2024
this.ctx,
this.ctx.getProjectByTaskId(task.id),
)
await this.baseLog(escapeXML(stripAnsi(result.output.trim())))
Copy link
Contributor Author

@hi-ogawa hi-ogawa Apr 26, 2024

Choose a reason for hiding this comment

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

I stripped the color for now, but it would be cool to have diff color if we can expect many consumers of junit reporter supports ansi code on their UI.
From the OP's screenshot, CircleCI probably supports it.

@hi-ogawa
Copy link
Contributor Author

I just noticed I've been pushing a branch directly on this repo...
Let me close this one and I'll recreate a PR from my fork

@hi-ogawa hi-ogawa closed this Apr 27, 2024
@hi-ogawa hi-ogawa deleted the fix-junit-error-format branch April 27, 2024 00:09
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.

JUnit reporter: ‘Unknown Error: undefined’
1 participant