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

Failure message is nested text now: allows to see newlines in Jenkins… #17

Closed
wants to merge 2 commits into from

Conversation

maxim-grishaev
Copy link

… reports

@palmerj3
Copy link
Collaborator

Please remove the yarn.lock file. For libs it's best not to include it. Yarn ignores dependencies yarn.lock files anyways and it's best to not give the impression that deps are locked down for a lib. You lock down dependencies for applications, not libs.

@palmerj3
Copy link
Collaborator

I'm a little worried about the use of strip-ansi.. the bit I read about it it is actually removing characters. So I'm not sure how this enables you to see newlines? If you could explain that a bit further I would appreciate. Thanks!

Copy link
Collaborator

@palmerj3 palmerj3 left a comment

Choose a reason for hiding this comment

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

Please see comments below and on the code

message: failure || ''
}
}]
'failure': stripAnsi(failure || '')
Copy link
Collaborator

Choose a reason for hiding this comment

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

The "_attr" attribute needs to be there otherwise the format of the junit.xml won't be to spec

@yangshun
Copy link
Contributor

I'm facing a problem where I'm unable to open the exported XML file in Chrome browser. My file contents can be found here.

I believe that the stripping ansi feature will solve the issue I'm facing too.

@palmerj3
Copy link
Collaborator

I see - I think the issue here is actually that the stack trace should be within the tags not within a property of the failure tag. I'll work on a separate PR to adjust that.

Going to close this.

I do really appreciate the PR but I want to avoid stripping out data if possible since I think that could break other implementations.

@palmerj3 palmerj3 closed this Jul 12, 2017
@maxim-grishaev
Copy link
Author

maxim-grishaev commented Jul 12, 2017

Hi! Thanks for response.

I see - I think the issue here is actually that the stack trace should be within the tags not within a property of the failure tag. I'll work on a separate PR to adjust that.

Mainly, yes.

I do really appreciate the PR but I want to avoid stripping out data if possible since I think that could break other implementations.

Than couldn't, actually. The problem here is because xml is like tty. But it introduces problems since xml contents usually displays as-is, so Escape codes simply introduces bugs like above. I've added it myself because Jenkins shows them as plain text, ruining readability.

No worries, stripAnsi is written by author of well-known npm module: chalk, it doesn't do any unknown untested crap.

@maxim-grishaev
Copy link
Author

As for yarn.lock: I've updated PR, just in case.

@palmerj3
Copy link
Collaborator

I created another PR which accomplishes what you were looking to do. Even included strip-ansi now that I understand a bit more what it does. I was able to use the modified code in an example project, throw an error in a test case, and get the kinds of results you showed me.

Please see https://github.com/palmerj3/jest-junit/pull/21

@KidsKilla @yangshun

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