-
Notifications
You must be signed in to change notification settings - Fork 109
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
Conversation
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. |
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! |
There was a problem hiding this 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 || '') |
There was a problem hiding this comment.
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
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. |
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. |
Hi! Thanks for response.
Mainly, yes.
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. |
As for yarn.lock: I've updated PR, just in case. |
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. |
… reports