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

[Jacoco] Allow skipping modules that have no tests #85

Closed
tlinkowski opened this issue Mar 6, 2019 · 2 comments
Closed

[Jacoco] Allow skipping modules that have no tests #85

tlinkowski opened this issue Mar 6, 2019 · 2 comments

Comments

@tlinkowski
Copy link
Contributor

In my little project, I have a test module (unij-test) with no tests whatsoever (the module just provides shared test code for other modules).

When I run standard jacocoTestReport for unij-test, it gets SKIPPED.

However, when I apply org.kordamp.gradle.jacoco, and then run its jacocoRootReport, I get the following error:

Unable to read [path]\UniJ\subprojects\unij-test\build\jacoco\test.exec

I'm not sure if this is intentional or not, but I think that it could be useful to have some way (either implicit or explicit) of skipping a module in JaCoCo merging/reporting.

PS. Note that, after all, I haven't used this plugin, because I realized that a special codecov uploader can also do the report assembling for me.

@aalmiray
Copy link
Collaborator

aalmiray commented Mar 6, 2019

Here's one way to conditionally skip running JaCoCo on a project that does not define tests under `src/test'

jacoco {
    enabled = subproject.file('src/test').exists()
}

Take note that JaCoCo will be applied to all test tasks, including those defined by integration-test and functional-test plugins.

@tlinkowski
Copy link
Contributor Author

Yes, good point - if my library were more complex and I needed integration/functional tests, then this plugin would come in very handy

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

No branches or pull requests

2 participants