-
Notifications
You must be signed in to change notification settings - Fork 17
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
Format forcing does not bypass valid file check #125
Format forcing does not bypass valid file check #125
Conversation
those specifically for the parser
if forcing python but coverage is not installed
Pull Request Test Coverage Report for Build 8931836762Details
💛 - Coveralls |
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.
Great solution, thanks for figuring out those tests too.
rescue error : ParserError | ||
raise error |
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.
👍
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.
I agree with Mike, great solution. Thanks so much. Looks good to me.
Problem
In v0.6.9, the Coverage.py
coverage
executable was not being used to parse the python-generated.coverage
file. With the release of v0.6.10, the Coverage.pycoverage
executable became required if attempting to parse a.coverage
file. If a user has a.coverage
file but does not have thecoverage
executable installed, then a debug error message is output informing them to either installcoverage
, or to convert the file tocoverage.xml
and force thecobertura
format.However, when forcing a format, the system still collects all possible coverage files across all file types, and passes them directly to the specified parser, bypassing the parser's
matches?
method that checks to make sure that the file is of a valid format. This is long standing behavior (and a long-standing bug), but did not surface until recently (coverallsapp/github-action#205), due to the fact that users ended up with both acoverage.xml
file and a.coverage
file in their directory, but were forcing thecobertura
format. The error occurred when the Cobertura parser tried to parse the.coverage
file.⚡ Solution
If a user specifies a format, then only the files that match the glob-pattern for the specified parser will be passed to the parser. In addition, the
matches?
method is no longer bypassed, which ensures that even if a file matches the correct naming pattern, there will be no attempt to parse it if the actual file format is incorrect.If a user specifies the
python
format for a.coverage
file, but does not have thecoverage
executable installed, then an error will be raised. If no format is specified, and the user has a.coverage
file but does not have thecoverage
executable installed, then a debug warning message only will be displayed.