kt3k / coveralls-gradle-plugin

👨‍🔧 gradle plugin for coveralls
https://plugins.gradle.org/plugin/com.github.kt3k.coveralls
MIT License
253 stars 54 forks source link

Add tests for Android plugin detection #26

Closed ksoichiro closed 10 years ago

ksoichiro commented 10 years ago

Added test codes for detecting Android Plugins (which I wrote in #25).

Android plugin checks Gradle version in BasePlugin#apply() and if it’s not applied on supported versions, BuildException will be thrown.

gradle-android-plugin required on apply()
< v0.12 Gradle 1.10+
>= v0.13 Gradle 2.1+

So I wrote some fake plugins just for testing the target codes.

If coveralls-gradle-plugin supports Gradle 2.1 in the future, these test codes should be replaced.

Sorry for dropping the coverage eventually but I don’t know why Covertura judges that some codes are not covered. I think they are actually tested. (I mean, c.name == name || instanceofWithName(c.superclass, name) in JacocoSourceReportFactory#createTargetSrcDirs())

Thanks!

coveralls commented 10 years ago

Coverage Status

Coverage increased (+0.56%) when pulling 27e12737ea9e98d2e18108e23b47acd4dc49dca1 on ksoichiro:add_tests_for_android_plugins into 34b69a9fe72259b105576b9f7dec53831b5050c7 on kt3k:master.

kt3k commented 10 years ago

Thank you very much for this!

I don’t know why Covertura judges that some codes are not covered. I think they are actually tested.

I agree on this. Cobertura seems to have problems on these lines. It started when we started using version 2.0 of gradle, by the way (#21). There wasn't this problem with gradle 1.x...

Thanks!

ksoichiro commented 10 years ago

There wasn't this problem with gradle 1.x...

Gradle 1.x is based on groovy 1.8 and gradle 2.0 is based on groovy 2.3. http://forums.gradle.org/gradle/topics/gradle_2_0_released Maybe there are some significant changes in groovy 2.x..

Anyway, thanks for merging!