Skip to content

checkScoverage is checking line coverage, not statement coverage #38

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

Closed
Kwestor opened this issue Feb 9, 2015 · 2 comments · Fixed by #41
Closed

checkScoverage is checking line coverage, not statement coverage #38

Kwestor opened this issue Feb 9, 2015 · 2 comments · Fixed by #41

Comments

@Kwestor
Copy link
Contributor

Kwestor commented Feb 9, 2015

As in summary. Main idea of scoverage is to calculate statement coverage, as line coverage in Scala is not a reliable statistics.

I understand existing clients depends on current behavior, but I think gradle plugin should at least provide ability to change this behavior.

We can either read statement-rate="0.00" branch-rate="0.00" from scoverage.xml file, or run testCoverage task and read it from there (like sbt plugin).

@maiflai
Copy link
Contributor

maiflai commented Feb 9, 2015

Yes, this is based on the old SCCT output which was in the cobertura format.

I think I prefer reading from the scoverage xml file, rather than using the Scala API?

@Kwestor
Copy link
Contributor Author

Kwestor commented Feb 10, 2015

It's ok. I'll implement this one and create a PR.

Kwestor added a commit to Kwestor/gradle-scoverage that referenced this issue Feb 10, 2015
`checkScoverage` task now can check statement, branch or line coverage.

Default behavior is to check if statement coverage is >= 75%.

To change it, add:

```
checkScoverage {
    coverageType = <type>
}
```

where `<type>` can be `'Line'`, `'Branch'` or `'Statment'`.

Fixes scoverage#38
Kwestor added a commit to Kwestor/gradle-scoverage that referenced this issue Feb 10, 2015
`checkScoverage` task now can check statement, branch or line coverage.

Default behavior is to check if statement coverage is >= 75%.

To change it, add:

```
checkScoverage {
    coverageType = <type>
}
```

where `<type>` can be `'Line'`, `'Branch'` or `'Statment'`.

New feature comes with bunch of tests for all scenarios.

Fixes scoverage#38
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 a pull request may close this issue.

2 participants