GithubHelp home page GithubHelp logo

kt3k / coveralls-gradle-plugin Goto Github PK

View Code? Open in Web Editor NEW
253.0 11.0 54.0 376 KB

๐Ÿ‘จโ€๐Ÿ”ง gradle plugin for coveralls

Home Page: https://plugins.gradle.org/plugin/com.github.kt3k.coveralls

License: MIT License

Makefile 0.08% Groovy 98.01% Java 1.91%
gradle-plugin coveralls maintainer-wanted

coveralls-gradle-plugin's Introduction

coveralls-gradle-plugin v2.12.2

Java CI Coverage Status

Send coverage data to coveralls.io.

Usage

Use with cobertura reporter

Add the following lines to build.gradle:

plugins {
    id 'net.saliman.cobertura' version '4.0.0'
    id 'com.github.kt3k.coveralls' version '2.12.2'
}

cobertura.coverageFormats = ['html', 'xml'] // coveralls plugin depends on xml format report

And run coveralls task after cobertura task.

An example .travis.yml looks like following:

language: java

jdk:
- oraclejdk11

after_success:
- ./gradlew cobertura coveralls

For groovy projects, add the following line to build.gradle:

cobertura.coverageSourceDirs = sourceSets.main.groovy.srcDirs

Use with JaCoCo plugin

Add the following lines to build.gradle:

plugins {
    id 'jacoco'
    id 'com.github.kt3k.coveralls' version '2.12.2'
}

jacocoTestReport {
    reports {
        xml.enabled = true // coveralls plugin depends on xml format report
        html.enabled = true
    }
}

An example .travis.yml looks like following:

language: java

jdk:
- oraclejdk11

after_success:
- ./gradlew jacocoTestReport coveralls

Configuration Options

coveralls {
    jacocoReportPath 'build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml'
}

Use with pitest plugin

Add the following lines to build.gradle:

plugins {
    id "info.solidsoft.pitest" version '1.6.0'
    id 'com.github.kt3k.coveralls' version '2.12.2'
}

pitest {
    timestampedReports = false
    outputFormats = ['XML']
}

An example .travis.yml looks like following:

language: java

jdk:
- oraclejdk11

after_success:
- ./gradlew pitest coveralls

Use with Travis-CI Pro & Coveralls Pro

When using Travis-CI Pro, you must provide your Coveralls Pro repo token in the COVERALLS_REPO_TOKEN environment variable in .travis.yml.

env:
  global:
    - COVERALLS_REPO_TOKEN=mySecRetRepoToken

You may also use a secure environment variable to hold COVERALLS_REPO_TOKEN by following the instructions on docs.travis-ci.com.

env:
  global:
    - secure: <encrypted string here>

Use with multi-project build

This plugin only handles one project per build. You need to merge coverage report before coveralls plugin take it.

See example: https://github.com/ben-manes/caffeine/blob/v2.6.2/build.gradle#L133

Configuring coveralls "task"

If you configure coveralls "task" (not the extension object), you need to write as the following:

tasks.coveralls {
  dependsOn 'check'
}

CI Services

The following CI services should automatically work:

If you need to customize something or support a different CI service, you can configure environment variables:

  • CI_NAME
  • CI_BUILD_NUMBER
  • CI_BUILD_URL
  • CI_BRANCH
  • CI_PULL_REQUEST
  • COVERALLS_REPO_TOKEN

Supported CI names

  • Travis-CI: travis-ci
  • Travis-Pro: travis-pro
  • CircleCI: circleci
  • Jenkins: jenkins
  • Snap CI: snapci
  • Bitrise CI: bitrise

If you have COVERALLS_REPO_TOKEN set and you're using Travis-CI not Travis-Pro, you need to set CI_NAME=travis-ci.

HTTPS proxy settings

You can set https proxy if needed. Environment variables to configure:

  • https.proxyHost
  • https.proxyPort (default value is 443)

Examples

License

MIT License ( Yoshiya Hinosawa )

Note

  • The ID of the plugin has been changed from coveralls to com.github.kt3k.coveralls according to the guidelines of gradle plugin. Please see the examples below for details. (2014/07/21)

See also

  • https://codecov.io/
    • An alternative web service to coveralls.
      • Better API design, which accepts any of major formats.
      • Nice browser extensions - You can see coverage information in GitHub UI.

Release History

  • 2023-03-07 v2.12.2 Better error message. (#114)
  • 2021-04-07 v2.12.0 Added Drone support. (#111)
  • 2020-08-07 v2.10.2 Fix path handling of JaCoCo report. (#108)
  • 2020-02-28 v2.10.1 Upgrade httpmime dependency. (#104)
  • 2020-02-16 v2.10.0 Add branch detection. (#102)
  • 2019-12-11 v2.9.0 Add GitHub Actions support. (#99)
  • 2019-05-25 v2.8.4 Maintainance update (refactored).
  • 2017-10-17 v2.8.2 Fixed PR ID in Jenkins. (#79)
  • 2017-02-08 v2.8.1 Fixed PIT report. (#73)
  • 2017-02-06 v2.8.0 Added PIT support. (#71)
  • 2016-11-14 v2.7.1 Recover Java 7 support. (v2.7.0 doesn't work with Java 8)
  • 2016-11-11 v2.7.0 Added HTTPS proxy settings. (#67)
  • 2016-01-29 v2.6.3 Recover Java 7 support. (v2.6.0 and v2.6.1 don't work with Java 8)
  • 2016-01-29 v2.6.3 Recover Java 7 support. (v2.6.0 and v2.6.1 don't work with Java 8)
  • 2016-01-29 v2.6.1 Improved CircleCI support. (#52)
  • 2016-01-22 v2.6.0 Improved CircleCI support. (#51)
  • 2016-01-18 v2.5.0 Added Bitrise CI support. (#50)
  • 2015-05-10 v2.4.0 Improved Travis CI support. (#40)
  • 2015-02-10 v2.3.1 Improved Snap CI support. (#36)
  • 2015-02-10 v2.3.0 Snap CI support. (#35)
  • 2015-02-08 v2.2.0 JenkinsCI support. (#33)
  • 2015-01-05 v2.1.0 CircleCI support. (#31)
  • 2014-10-05 v2.0.1 Compatibility with gradle-android-plugin 0.13.x. ([#25](https://github.com/kt3k/coveralls-gra dle-plugin/pull/25))
  • 2014-08-01 v2.0.0 More CI services support. Improvements. (#21)
  • 2014-07-21 v1.0.2 Plugin ID changed. coveralls -> com.github.kt3k.coveralls (#19)
  • 2014-07-06 v0.6.1 XML parser behaviours fixed. (#18)
  • 2014-07-02 v0.6.0 Multiple project support for JaCoCo. (#13)
  • 2014-06-26 v0.5.0 Android plugin support. (#17)
  • 2014-06-21 v0.4.1 XML parser settings fixed. (#16)
  • 2014-03-15 v0.3.1 HttpBuilder upgraded to v0.7.1. (#8)
  • 2014-03-11 v0.3.0 Coverage report path became configurable. (#7)
  • 2014-02-19 v0.2.5 Travis Pro support. (#4)
  • 2014-01-21 v0.2.4 Ignore absent source files. (#3)
  • 2013-12-09 v0.2.1 JaCoCo support. (#2)
  • 2013-11-02 v0.1.6 Available at Maven Central.
  • 2013-10-27 v0.1.5 Multiple <source> tag support. (#1)
  • 2013-10-08 v0.1.3 First usable version.

coveralls-gradle-plugin's People

Contributors

aalmiray avatar andreldm avatar barryrowe avatar bric3 avatar chrisjenx avatar d-rickyy-b avatar dallasgutauckis avatar dhalperi avatar fernando-alves avatar flowdalic avatar gesellix avatar githengi avatar gitu avatar ihiroky avatar jettbow avatar jvia avatar kevin-lee avatar ksoichiro avatar kt3k avatar ldaley avatar melix avatar musketyr avatar objectivetruth avatar pomkine avatar raindev avatar sschuberth avatar szpak avatar thejohnfreeman avatar theosotr avatar vgaidarji avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coveralls-gradle-plugin's Issues

Consider using different names for task and extension.

This is a great plugin, thank you for writing it!

One thing I came across when trying to configure some task dependencies a recent project (https://github.com/ReadyTalk/gradle-readytalk-js), was that you have the extension object and the task for the plugin both using the same name: 'coveralls'. This makes it a bit tricky to configure the task without doing something like this:

tasks.coveralls {
  dependsOn 'check'
  onlyIf { isCI }
}

If I do:

coveralls {
  dependsOn 'check'
  onlyIf { isCI }
}

Gradle thinks I am trying to configure the extension object and barfs out:

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/douglas.borg/ReadyTalk/gradle-readytalk-js/build.gradle' line: 73

* What went wrong:
A problem occurred evaluating root project 'gradle-readytalk-js'.
> Could not find method dependsOn() for arguments [check] on root project 'gradle-readytalk-js'.

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'gradle-readytalk-js'.
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)
...
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56)
Caused by: org.gradle.api.internal.MissingMethodException: Could not find method dependsOn() for arguments [check] on root project 'gradle-readytalk-js'.
    at org.gradle.api.internal.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:68)
    at org.gradle.api.internal.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:56)
    at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:172)
    at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java:79)
    at build_5ou26fne255k0p8hhiq9gu6014$_run_closure9.doCall(/Users/douglas.borg/ReadyTalk/gradle-readytalk-js/build.gradle:73)
    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:59)
    at org.gradle.api.internal.plugins.ExtensionsStorage$ExtensionHolder.configure(ExtensionsStorage.java:145)
    at org.gradle.api.internal.plugins.ExtensionsStorage.configureExtension(ExtensionsStorage.java:69)
    at org.gradle.api.internal.plugins.DefaultConvention$ExtensionsDynamicObject.invokeMethod(DefaultConvention.java:207)
    at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
    at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java:79)
    at build_5ou26fne255k0p8hhiq9gu6014.run(/Users/douglas.borg/ReadyTalk/gradle-readytalk-js/build.gradle:72)
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
    ... 34 more


BUILD FAILED

Ideally, I'd like to do something like this:

uploadCoveralls {
  dependsOn 'check'
  onlyIf { isCI }
}

java.lang.NoSuchMethodError: org.apache.http.entity.mime.content.ByteArrayBody.<init>([BLorg/apache/http/entity/ContentType;Ljava/lang/String;)V

Similar issue to #27 and #45. It only successfully works with 2.0.1x, but not 2.4.0 (latest). Is this intentional?

Full stack trace:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':coveralls'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:310)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: java.lang.NoSuchMethodError: org.apache.http.entity.mime.content.ByteArrayBody.<init>([BLorg/apache/http/entity/ContentType;Ljava/lang/String;)V
    at org.apache.http.entity.mime.MultipartEntityBuilder.addBinaryBody(MultipartEntityBuilder.java:131)
    at org.apache.http.entity.mime.MultipartEntityBuilder$addBinaryBody$0.call(Unknown Source)
    at org.kt3k.gradle.plugin.coveralls.CoverallsTask$_postJsonToUrl_closure1.doCall(CoverallsTask.groovy:43)
    at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:432)
    at groovyx.net.http.HTTPBuilder.request(HTTPBuilder.java:366)
    at groovyx.net.http.HTTPBuilder$request.call(Unknown Source)
    at org.kt3k.gradle.plugin.coveralls.CoverallsTask.postJsonToUrl(CoverallsTask.groovy:41)
    at org.kt3k.gradle.plugin.coveralls.CoverallsTask$postJsonToUrl.callCurrent(Unknown Source)
    at org.kt3k.gradle.plugin.coveralls.CoverallsTask.coverallsAction(CoverallsTask.groovy:132)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:226)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:219)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:208)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:589)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:572)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 14 more

Multi-module project and no source file found

Hi there, I have multi-module project. Each modules test is covered by JaCoCo, but I am still using an ant task, since gradle plugin is not doing all for me. Anyway, each module creates a 'exec' binary file (with stored coverage data); and no report is generated for modules. Instead, single, aggregated report is generated for whole project, based on all input modules execution result. This way single jacoco XML file is generated.

However, when I start your plugins task, it does not find the sources. I think it is because of this (from JacocoSourceReportFactory)

    project.plugins.withType(JavaPlugin) {
        targetSrcDirs += project.sourceSets.main.java.srcDirs
    }

Here we do collect projets source dirs, and I need source dirs of all modules.

Since I already have a collection of source dirs of my modules, the simples fix would be to add an optional flag, so I can override default behavior and simply provide my source sets.

Would this make sense?

Make the plugin work with both httpmime-4.1 and httpmime-4.3

The plugin depends on httpmime-4.3 feature which httpmime-4.1 doesn't have. In some situation this plugin runs with httpmime-4.1 (maybe in the case other gradle plugins depends on it) and that cause errors when uploading.

For now I created alternative versions for making this plugin work with httpmime-4.1 (which has suffix x after version number) but that seems causing a lot of confusion. It's better to make the only version which works both with httpmime 4.1 and 4.3.

Exclude files for testing?

Is there a possibility to exclude files from testing?
Since external libraries or dependencies should not be tested though,
just the own code.

Best regards,
Stephan

Plugin assumes report XML in wrong location

Hi,

first of all, thank you for the nice plugin :).

I am using jacoco, but have some problems with the report xml.
Executing

./gradlew jacocoTestReport coveralls

ends with:

No report file available: [app/build/reports/cobertura/coverage.xml, /home/travis/build/knub/bookly/app/build/reports/jacoco/test/jacocoTestReport.xml]

For some reason, my jacocoTestReport.xml is in

app/build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml

Is there some way to configure the path to the report XML?

Multi-project example

Your plugin was working great until I moved to a multi-project layout. It seemed to not aggregate the jacoco reports and send each individually, so only one module was shown. I fixed this by having the reports appended and stored at the root project's build directory. The html report from jacoco comes out great.

Coveralls unfortunately can't find the source, so nothing appears on the dashboard. The plugin gives the following output:

:coveralls
service name: travis-ci
service job id: 46289337
repo token: null
No source file found on the project: "caffeine"
With coverage file: /home/travis/build/ben-manes/caffeine/build/reports/jacoco/test/jacocoTestReport.xml

The closed multi-project issues lead to a non-existent repository or oblac/jodd's manual invocation. An example of how to setup this plugin for multi-project would be really useful.

Error:Unable to load class 'org.codehaus.groovy.runtime.typehandling.ShortTypeHandling'

Hello everyone. I'm using Android Studio 0.8.4 and want to use coveralls-gradle-plugin but I can't. Strange bug appears. There is my buildscript

apply plugin: 'cobertura'
apply plugin: 'com.github.kt3k.coveralls'

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.+'
        classpath 'net.saliman:gradle-cobertura-plugin:2.0.0'
        classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

cobertura.coverageFormats = ['html', 'xml']

allprojects {
    repositories {
        mavenCentral()
    }
}

task wrapper(type: Wrapper) {
    gradleVersion = '2.0'
}

It seems, that Android is unsupported yet ?

coveralls-gradle-plugin can't find source

Hi @kt3k ,

Thanks for the awesome coveralls-gradle-plugin, but I am facing a small issue using it. Please see build.gradle and CI output, for some reason, coveralls task can't find the source file for the root project, do you have any hint on how I can fix this?

Thank you very much.

Best Regards,
GaoXiang (Eric)

Support proxy settings

Hey, I'm trying to use this plugin on a private Jenkins server. This server can access outer world only through proxy server. It seems that now the plugin doesn't support https proxy settings (host and port).
It would be really greate to have such feature.

javax.net.ssl.SSLException: hostname in certificate didn't match: <coveralls.io> != ...

After coveralls moved to new servers, the build fails due to an SSL exception:
https://travis-ci.org/binwiederhier/syncany/builds/20791909

javax.net.ssl.SSLException: hostname in certificate didn't match: <coveralls.io> != 
<ssl6459.cloudflare.com> OR <ssl6459.cloudflare.com> OR <x-spine.com> OR 
<funect.me> OR <crank.bz> OR <gurufocus.com> OR <*.funect.me> OR 
<socialsavanna.com> OR <*.profitwins.com> OR <*.crank.bz> OR 
<*.arccoachworksltd.co.uk> OR <gadgetsboy.co.uk> OR <profitwins.com> OR 
<arccoachworksltd.co.uk> OR <*.gadgetsboy.co.uk> OR <*.x-spine.com> OR 
<vietexpfamily.info> OR <*.vietexpfamily.info> OR <*.socialsavanna.com> OR 
<*.gurufocus.com>

Plugin always fails

sample of the build: https://travis-ci.org/OleksandrKucherenko/meter/builds/38691808

:library:coveralls
:samples:sample-01:coveralls
service name: travis-pro
service job id: 38691809
service name: travis-pro
repo token: present (not shown for security)
service job id: 38691809
repo token: present (not shown for security)
:samples:sample-01:coveralls FAILED
:library:coveralls FAILED
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':samples:sample-01:coveralls'.
> org.apache.http.entity.mime.content.ByteArrayBody.<init>([BLorg/apache/http/entity/ContentType;Ljava/lang/String;)V

Any ideas how to fix that? I'm using JaCoCo, it works and on local PC generates coverage reports without problems.

Is it possible to run plugin on local PC, not on Travis? (I\m on windows 8.1 x64 environment)

How to get badge to display

Hey, I used your coveralls wrapper on my java project and it worked seamlessly. Thank you so much! My question (and it's likely an extremely naive one...) is how to get the coverage badge? It seems like it didn't execute on coveralls.

Here is my repo. Here's what my .travis.yml file looks like:

language: java
jdk:
  - oraclejdk7

branches:
  only:
    - master

before_script:
 - "echo $JAVA_OPTS"
 - "export JAVA_OPTS=-Xmx512m"

after_failure:
  - cat target/surefire-reports/*.txt

before_cache:
  - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock

cache:
  directories:
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/

after_success:
- ./gradlew cobertura coveralls

And I have the following line at the head of my build.gradle:

plugins {
    // ... other plugins
    // coverage tools
    id 'net.saliman.cobertura' version '2.3.1'
    id 'com.github.kt3k.coveralls' version '2.6.3'
}
cobertura.coverageFormats = ['html', 'xml'] // coveralls plugin depends on xml format report

And yet, I'm still getting the coverage | unknown badge in my README. Any thoughts?

Extension has unused properties

Right now the extension has saveAsFile and saveFilePath, neither of which seem to appear anywhere else in the code base. These should probably be removed, or implemented (I'd be happy to do it myself, but I'm not sure which of the above is the approach you'd like to take).

Thanks!

exclude stuff

It looks like jacoco excludes are not taken into account by coveralls and it has its own python based exclude mechanism. It would be great to be able to configure excludes. My coverage is dropping by 10 percent for a class that I had to copy into my own project, and this class is already tested in the original project it belongs to.

And no, I can 't copy the tests, they use different testing lib..

java.lang.NoSuchMethodError: org.apache.http.entity.mime.content.ByteArrayBody.<init>([BLorg/apache/http/entity/ContentType;Ljava/lang/String;)V

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':domain:coveralls'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:310)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: java.lang.NoSuchMethodError: org.apache.http.entity.mime.content.ByteArrayBody.<init>([BLorg/apache/http/entity/ContentType;Ljava/lang/String;)V
    at org.apache.http.entity.mime.MultipartEntityBuilder.addBinaryBody(MultipartEntityBuilder.java:131)
    at org.apache.http.entity.mime.MultipartEntityBuilder$addBinaryBody$0.call(Unknown Source)
    at org.kt3k.gradle.plugin.coveralls.CoverallsTask$_postJsonToUrl_closure1.doCall(CoverallsTask.groovy:43)
    at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:432)
    at groovyx.net.http.HTTPBuilder.request(HTTPBuilder.java:366)
    at groovyx.net.http.HTTPBuilder$request.call(Unknown Source)
    at org.kt3k.gradle.plugin.coveralls.CoverallsTask.postJsonToUrl(CoverallsTask.groovy:41)
    at org.kt3k.gradle.plugin.coveralls.CoverallsTask$postJsonToUrl.callCurrent(Unknown Source)
    at org.kt3k.gradle.plugin.coveralls.CoverallsTask.coverallsAction(CoverallsTask.groovy:132)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:226)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:219)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:208)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:589)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:572)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 14 more

I'm using Gradle 2.4

Change coberturaReportPath

Hi, thanks for the plugin!

Unfortunately I haven't got it to work yet, because I changed my coverageReportDir to build/reports/coverage (I don't want to change it back, because the reports dir is uploaded to a web space, and I don't want the folder name to change). So right now, your plugin doesn't find the report dir:

No report file available: [(...)/build/reports/cobertura/coverage.xml, 
      (...)/build/reports/jacoco/test/jacocoTestReport.xml]

I saw that it might be possible to change coberturaReportPath in this class. But I haven't been able to figure out how.

You can find my project's build file at build.gradle

Can you help?

No source file found on the project

First of all, thanks for the plugin!

Secondly, can anyone suggest how to troubleshoot this? It's an Android project written in Java. https://travis-ci.org/jshvarts/CleanArchitecture/builds/311086312

Thanks in advance!

:coveralls
service name: travis-ci
service job id: 311086313
repo token: null
No source file found on the project: "CleanArchitecture"
With coverage file: /home/travis/build/jshvarts/CleanArchitecture/build/reports/jacoco/test/jacocoTestReport.xml
BUILD SUCCESSFUL

Does it support Shippable?

I checked README.md but it seems doesn't support Shippable yet. Is it possible to use coveralls on Shippable?

Support Kotlin source folder

Right now the kotlin source folder isn't supported right away, it would be nice to have it without a specific configuration. I already looked into it but couldn't get the check for a applied kotlin plugin to work.

Right now its possible with the additional source directories configuration like that

coveralls {
    sourceDirs += ['src/main/kotlin']
}

The right place to add the check for the plugin and additional source folder would be here: JacocoSourceReportFactory.groovy#L51 I could be done like the scala plugin logic which above line 50 I guess.

path prefix issue with jaCoCo

Hi,

So I'm running into the following issue: Coveralls claims it can't find the source files.

screen shot 2014-03-19 at 11 20 16 pm

the src in the screenshot was a test, and has no effect on the coveralls behavior

The reason is that the source code is not rooted in /, but rather in /src. jaCoCo seems to use only the Java path to the file, not the full path. I can't figure out how to make jaCoCo prepend the /src to the reported filename.

Any advice? How does the jaCoCo stuff work on your end?

javax.net.ssl.SSLProtocolException with openjdk11 on Travis

I receive a javax.net.ssl.SSLProtocolException: Connection reset by peer (Write failed) with Java 11 and also with Java 12-ea. It look like that Java 11 and newer can not communicate with your server. Here is the output from Gradle

> Task :coveralls FAILED
service name: travis-ci
service job id: 435042066
repo token: null
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':coveralls'.
> javax.net.ssl.SSLProtocolException: Connection reset by peer (Write failed)

see at https://travis-ci.org/i-net-software/jlessc/jobs/435042066

Any Idea how can solve this?

Add support for Android

It would be great to add support for Android projects. The Android gradle plugin can generate Jacoco coverage xml reports. Unfortunately they seem to be in a different location than expected.

CicrleCI not working

I have a project which is build by Gradle.
In circle.yml I have:

test:
  post:
    - ./gradlew jacocoTestReport coveralls`

The coverage data is not send to Coveralls after successful build.
Instead the no available CI service message is displayed.

add kotlin support

I'm failed to send the report to Coveralls
got following log:

:coveralls
service name: travis-ci
service job id: 246121223
repo token: present (not shown for security)
No source file found on the project: "ForeverNight"
With coverage file: /home/travis/build/gogo81745/ForeverNightEngine/build/reports/jacoco/test/jacocoTestReport.xml

Finally, I know the reason is that my project use kotlin only
refer to this

project.plugins.withType(GroovyPlugin) {
	targetSrcDirs += project.sourceSets.main.groovy.srcDirs
}

project.plugins.withType(ScalaPlugin) {
	targetSrcDirs += project.sourceSets.main.scala.srcDirs
}

But there is no kotlin here. That's why the plugin find no source file
So I add an additional configuration

coveralls {
    project.extensions.coveralls.sourceDirs += project.sourceSets.main.kotlin.srcDirs
}

It's like this

coveralls {
    sourceDirs += ['src/main/kotlin']
}

It is working now.
I hope to add support for Kotlin.

Reports only the last subproject if project with multiple subprojects is used

I've added the coveralls-gradle-plugin to Smack with igniterealtime/Smack@03206fc?diff=unified, but it appears that only the last reported subproject is used for the analysis at https://coveralls.io/r/igniterealtime/Smack. That is, only the test coverage for smack-tcp appears to be shown there, which is also the last project the coveralls-gradle-plugin reported as per https://travis-ci.org/igniterealtime/Smack#L1478.

I'm not sure if this is an issue with

Any help is appreciated. Thank you.

Add a SourceReportFactory for PIT reports

I'd like to use mutation coverage with PIT for my coverage report. It can report in XML. Any assistance would be appreciated, from doing all the work (thank you!) to offering advice for implementing a SourceReportFactory. As a note to myself, I can probably best deduce the requirements by reading the comments in CoberturaSourceReportFactory).

Could not evaluate onlyIf predicate for task ':coveralls'. > Could not find property 'isCI' on task ':coveralls'.

I applied configuration as explained in README. Unfortunately, when I run my gradle project with coveralls task from Jenkins, I get the following error:

* Where:
Build file 'C:\Users\Administrator\jenkins\workspace\workflow-catalog\jdk\JDK8\label\Windows\build.gradle' line: 130

* What went wrong:
Could not evaluate onlyIf predicate for task ':coveralls'.
> Could not find property 'isCI' on task ':coveralls'.

The gradle.build file I use is available below:

https://github.com/ow2-proactive/workflow-catalog/blob/master/build.gradle

Is there some configuration to apply on Jenkins related to this plugin? or environnent variables to define?

javax.net.ssl.SSLHandshakeException with oraclejdk7 on Travis

I receive the follow error:

:coveralls
service name: travis-ci
service job id: 258176910
repo token: null
:coveralls FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':coveralls'.
> javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

With oraclejdk8 its work. I think the cause is that there are some root certificates are missing in Java 7. Any workaround?

https://travis-ci.org/i-net-software/jlessc/jobs/258176910

repo token: null No source file found on the project

Hi I have the following error;

https://travis-ci.com/lemikistu/Android-Alternative-Animations/builds/111947545

build.gradle

https://github.com/lemikistu/Android-Alternative-Animations/blob/master/build.gradle

I am new to using this kind of tools.Therefore sorry for easy mistakes.As you can see from commits I have tried almost all combinations.I managed to get Travis working fine and it builds fine with this plugin.Issue is plugin never find source or reports and always skips coverage check for some reason. That's why my coveralls is not updated with any of Travis builds.

Thanks.

Drone CI support

Very useful plugin.
Do you think Drone CI can be supported as well?

Please upgrade HttpBuilder

The current releae uses HttpBuilder 0.5-RC2 which defines its groovy dependency with a range. This is really bad as the build always ask for the latest version and will fail when running in offline mode. The workaround is to attach an --offline flag to the gradle build everytime.

The latest stable release of HttpBuilder (0.7.1) no longer defines the groovy dependency with a range.

customize the path to find the code coverage file instead of the default location

I am using gradlew to do build/tests, which with code coverage enabled. Somehow, the code coverage file generated at different location (.../libs/SalesforceAnalytics/build/reports/debug/report.xml) than the plug trying to find it (.../libs/SalesforceAnalytics/build/reports/jacoco/test/jacocoTestReport.xml). So, hit this error:

No report file available: [/home/jenkins/workspace/coveralls/libs/SalesforceAnalytics/build/reports/cobertura/coverage.xml, /home/jenkins/workspace/coveralls/libs/SalesforceAnalytics/build/reports/jacoco/test/jacocoTestReport.xml]

How does plugin to figure out the path to find the report, and Is there a way to configure it to other location?

Avoid dependency on Android plugin

Hi,

The dependency on the android plugin adds a lot of weight for people who aren't using the plugin. Do you need the compile time dependency? Where / how are you referencing the classes?

Support for Snap

Hi!

I'm currently using Snap CI and I'd like to contribute a patch to make the detection and setup a little easier. The environment variables that Snap sets seem enough to populate the ServiceInfo object and get things going, but as I'm unfamiliar with the plugin code, I might be overlooking something. Is there anything else to it, or should I go ahead and submit a PR?

Cheers!

Better detection of travis-ci vs pro

Currently if there is an env variable for repo token, plugin assumes it is travis-pro. This is not entirely correct. Since I have some integration tests, I am sending jacoco reports from my computer, not from travis. For this I need the env variable to be set, and yet I am using travis-ci not pro.

javax.net.ssl.SSLException: hostname in certificate didn't match:

This is the web client class
StringBuilder responseStr = new StringBuilder();

    try {
        HttpResponse response = null;

        if (method == "GET") {
            HttpGet httpGet = new HttpGet(urlStr);

            response = HttpConnectionManager.getClient().execute(httpGet);
        } else if (method == "POST") {
            HttpPost httpPost = new HttpPost(urlStr);

            response = HttpConnectionManager.getClient().execute(httpPost);
        }

        InputStream responseInputStream = response.getEntity().getContent();
        BufferedReader bufferedReader = new BufferedReader(
                new InputStreamReader(responseInputStream));

        String responseLineStr = null;

        while ((responseLineStr = bufferedReader.readLine()) != null) {
            responseStr.append(responseLineStr);
        }

        bufferedReader.close();
        responseInputStream.close();
    } catch (Exception e) {
        e.printStackTrace();
    }

    return responseStr.toString();
}

this is the doInBackground process

@Override
    protected String doInBackground(Void... params) {
        try {

            // String urlString = RequestMethods.callHTTPMethod("GET",
            // getResources().getString(R.string.url_main_products));

            String urlString = RequestMethods
                    .callHTTPMethod(
                            "GET",
                            getResources().getString(R.string.url_main_products));
            return urlString;

        } catch (IOException e) {
            e.printStackTrace();
        } catch (NotFoundException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

When I am trying to get the details from the service I got the issue like attached image
screen shot 2014-09-29 at 2 23 56 pm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.