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

feat: Clover PHP parser #99

Merged
merged 14 commits into from Sep 1, 2023
Merged

feat: Clover PHP parser #99

merged 14 commits into from Sep 1, 2023

Conversation

iurev
Copy link
Contributor

@iurev iurev commented Aug 29, 2023

Closes:
https://github.com/coverallsapp/coveralls/issues/1889
lemurheavy/coveralls-public#1721 (comment)

Closes #53

⚡ Summary

Add Clover PHP parser

☑️ Checklist

@iurev iurev changed the title Feature/clover feat: Clover PHP parser (WIP) Aug 29, 2023
@coveralls-official
Copy link

coveralls-official bot commented Aug 30, 2023

Pull Request Test Coverage Report for Build 6048904071

  • 38 of 39 (97.44%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 93.719%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/coverage_reporter/parsers/clover_parser.cr 38 39 97.44%
Totals Coverage Status
Change from base Build 6035012401: 0.2%
Covered Lines: 940
Relevant Lines: 1003

💛 - Coveralls

@afinetooth
Copy link
Member

Looking good. Thanks, @iurev!

@iurev iurev marked this pull request as ready for review August 30, 2023 14:50
Copy link
Contributor

@mrexox mrexox left a comment

Choose a reason for hiding this comment

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

Looks pretty good. Have you tested the binary locally?

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need such bug file (2k lines). Could you keep about 100 lines?

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's have smaller files for tests.

Comment on lines 10 to 13
# NOTE: Provide the base path for the sources. You can check "filename" in
# coverage report and see what part is missing to get a valid source path.
def initialize(@base_path : String?)
end
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need this initializer here since we don't use @base_path

end

def matches?(filename) : Bool
return true if /clover.xml/.matches?(filename)
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't check by name here because people can rename the Jacoco file to clover.xml and call the coverage-reporter as coveralls report clover.xml. In this case we should check its content instead of name. Name is only important when selecting files via globs (calling as coveralls report).


if line_type == "cond"
branch_hits = line_node.attributes["truecount"].content.to_u64
branches[line_number] = [branch_hits]
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure that there won't be more than one branch hit on a line? What do you think of using branches[line_number] << branch_hits?

@iurev iurev changed the title feat: Clover PHP parser (WIP) feat: Clover PHP parser Sep 1, 2023
Copy link
Contributor

@mrexox mrexox left a comment

Choose a reason for hiding this comment

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

:shipit:

@iurev iurev merged commit 8f0592d into master Sep 1, 2023
10 checks passed
@szepeviktor
Copy link
Contributor

Thank you.

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.

PHPUnit's clover format
4 participants