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

JUnit XML should contain more information in the failure text #2452

Closed
philmtd opened this issue Jan 3, 2022 · 1 comment · Fixed by #2460
Closed

JUnit XML should contain more information in the failure text #2452

philmtd opened this issue Jan 3, 2022 · 1 comment · Fixed by #2460
Labels
enhancement New feature or improvement

Comments

@philmtd
Copy link

philmtd commented Jan 3, 2022

Your feature request related to a problem? Please describe.

The JUnit XML Format specifies that the failure text should contain more context than just the wrong expression. golangci-lint only shows the wrong code expression with no context.

I'm using GitLab CI and the GitLab Build UI only shows the text of a failure, ignoring the "message" attribute. Running into linting errors results in a message like this:

Name: gosimple
Execution time: 0.00ms
System output:
	r, err := regexp.Compile("\\d+$")

The corresponding XML entry is:

<failure message="S1007: should use raw string (`...`) with regexp.Compile to avoid having to escape twice"><![CDATA[	r, err := regexp.Compile("\\d+$")]]></failure>

Without the additional information the output in the CI system is not useful on its own. As a developer I have to check the build output or run the linter locally on my machine to see the error message or suggested fix.

Describe the solution you'd like.

I'd be happy if the JUnit XML reports could be more verbose to also include the message in the text of the <failure> element. As far as I can see this is also intended in the JUnit XML specification: https://www.ibm.com/docs/en/developer-for-zos/14.1.0?topic=formats-junit-xml-format (see the example at the end)

Describe alternatives you've considered.

Scrolling through build outputs or running golangci-lint locally.

Additional context.

No response

@philmtd philmtd added the enhancement New feature or improvement label Jan 3, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 3, 2022

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant