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

Files with no failures get a "passing" testcase #9547

Merged
merged 1 commit into from Nov 1, 2017

Conversation

samlev
Copy link
Contributor

@samlev samlev commented Oct 30, 2017

This fixes JUnit parsing errors which treat no testcases as a failure (e.g. Atlassian bamboo).

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[X] Other, please explain:

On files that pass, a "passing" testcase should be added. Without any passing testcases, some JUnit parsers will fail, claiming that there are no tests.

This was unofficially reported here: #16 (comment)

This pull request ensures that a passing testcase is added to a testsuite if there are no failures.

What changes did you make? (Give an overview)
Added empty "passing" testcase to JUnit formatter when a file has no messages.

Is there anything you'd like reviewers to focus on?
No

@jsf-clabot
Copy link

jsf-clabot commented Oct 30, 2017

CLA assistant check
All committers have signed the CLA.

This fixes JUnit parsing errors which treat no testcases as a failure (e.g. Atlassian bamboo).
@aladdin-add aladdin-add added the chore This change is not user-facing label Oct 31, 2017
Copy link
Member

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the contributing!

@not-an-aardvark
Copy link
Member

I'm not very familiar with the JUnit format. What does the tests value mean in this context? Would it make sense for the value to always be 1?

@samlev
Copy link
Contributor Author

samlev commented Oct 31, 2017 via email

@not-an-aardvark
Copy link
Member

Closing and reopening this PR to restart the Appveyor build. (We had an unrelated issue where the build was failing on master today, and I think this PR was created while that was happening.)

@not-an-aardvark not-an-aardvark added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features and removed chore This change is not user-facing labels Oct 31, 2017
@ilyavolodin ilyavolodin merged commit accc490 into eslint:master Nov 1, 2017
@ilyavolodin
Copy link
Member

Thanks for PR!

@platinumazure
Copy link
Member

Totally separate issue: Is it worth having a CLI option that would allow all files to be included in input and shown in formatters, even those with no linting errors? I would hate to see that for a formatter like stylish, but it could be interesting or useful for formatters like JUnit.

@not-an-aardvark
Copy link
Member

I think formatters already have access to this information. Do you mean the command-line flag would trigger a behavior change in the formatters themselves?

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators May 1, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label May 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants