{"id":22615623,"url":"https://github.com/marcellodesales/gradle-coverage-console-reporter","last_synced_at":"2025-03-29T00:42:39.659Z","repository":{"id":142072614,"uuid":"395343375","full_name":"marcellodesales/gradle-coverage-console-reporter","owner":"marcellodesales","description":"FIxed version of the gradle report","archived":false,"fork":false,"pushed_at":"2021-08-12T14:20:05.000Z","size":296,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-03T10:46:22.932Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcellodesales.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-12T14:19:00.000Z","updated_at":"2021-08-12T14:20:15.000Z","dependencies_parsed_at":"2023-07-09T05:31:51.735Z","dependency_job_id":null,"html_url":"https://github.com/marcellodesales/gradle-coverage-console-reporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcellodesales%2Fgradle-coverage-console-reporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcellodesales%2Fgradle-coverage-console-reporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcellodesales%2Fgradle-coverage-console-reporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcellodesales%2Fgradle-coverage-console-reporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcellodesales","download_url":"https://codeload.github.com/marcellodesales/gradle-coverage-console-reporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246122247,"owners_count":20726822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-08T19:08:37.307Z","updated_at":"2025-03-29T00:42:39.650Z","avatar_url":"https://github.com/marcellodesales.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gradle-console-reporter\n\n[![Build Status](https://img.shields.io/travis/ksoichiro/gradle-console-reporter/master.svg?style=flat-square)](https://travis-ci.org/ksoichiro/gradle-console-reporter)\n[![Build status](https://img.shields.io/appveyor/ci/ksoichiro/gradle-console-reporter/master.svg?style=flat-square)](https://ci.appveyor.com/project/ksoichiro/gradle-console-reporter)\n[![Coverage Stagus](https://img.shields.io/coveralls/ksoichiro/gradle-console-reporter/master.svg?style=flat-square)](https://coveralls.io/github/ksoichiro/gradle-console-reporter?branch=master)\n\n\u003e Gradle plugin to report various kinds of summaries to console.  \n\nThis plugin will aggregate test reports and show them to console.  \nIt's useful when you use CI services that don't save artifacts.\n\n\u003cimg src=\"samples/images/demo1.png\" width=\"400\"\u003e\n\n## Available reports\n\n* JUnit test report\n* JaCoCo coverage report\n* Cobertura coverage report\n\n## Usage\n\n### Getting started\n\nJust apply the plugin in your build.gradle.\n\n```gradle\nplugins {\n    id 'com.github.ksoichiro.console.reporter' version '0.6.2'\n}\n```\n\nOr\n\n```gradle\nbuildscript {\n    repositories {\n        mavenCentral()\n    }\n    dependencies {\n        classpath 'com.github.ksoichiro:gradle-console-reporter:0.6.2'\n    }\n}\n\napply plugin: 'com.github.ksoichiro.console.reporter'\n```\n\n### Test report\n\nWhen your tests fail, the plugin would print test failure details to the console.\n\n```console\n$ ./gradlew test\n:compileJava UP-TO-DATE\n:processResources UP-TO-DATE\n:classes UP-TO-DATE\n:compileTestJava UP-TO-DATE\n:processTestResources UP-TO-DATE\n:testClasses UP-TO-DATE\n:test\n\ncom.example.ATest \u003e greet3 FAILED\n    org.junit.ComparisonFailure at ATest.java:31\n\ncom.example.ATest \u003e greet FAILED\n    org.junit.ComparisonFailure at ATest.java:19\n\ncom.example.BTest \u003e greet FAILED\n    org.junit.ComparisonFailure at BTest.java:18\n\n5 tests completed, 3 failed\n:test FAILED\ntestsuite com.example.ATest:\n  stdout:\n    debug log in test2\n    debug log\n    debug log\n    debug log in test\n    debug log\n  stderr:\n    debug error log in test3\n  testcase com.example.ATest \u003e greet3: org.junit.ComparisonFailure: expected:\u003cHello[.]\u003e but was:\u003cHello[]\u003e\n\tat org.junit.Assert.assertEquals(Assert.java:115)\n\tat org.junit.Assert.assertEquals(Assert.java:144)\n\tat com.example.ATest.greet3(ATest.java:31)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n    ...\n\tat java.lang.Thread.run(Thread.java:745)\n\n  testcase com.example.ATest \u003e greet: org.junit.ComparisonFailure: expected:\u003cHello[!]\u003e but was:\u003cHello[]\u003e\n\tat org.junit.Assert.assertEquals(Assert.java:115)\n\tat org.junit.Assert.assertEquals(Assert.java:144)\n\tat com.example.ATest.greet(ATest.java:19)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n    ...\n\tat java.lang.Thread.run(Thread.java:745)\n\ntestsuite com.example.BTest:\n  testcase com.example.BTest \u003e greet: org.junit.ComparisonFailure: expected:\u003cBye[!]\u003e but was:\u003cBye[]\u003e\n\tat org.junit.Assert.assertEquals(Assert.java:115)\n\tat org.junit.Assert.assertEquals(Assert.java:144)\n\tat com.example.BTest.greet(BTest.java:18)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n    ...\n\tat java.lang.Thread.run(Thread.java:745)\n...\n```\n\nYou can suppress stacktrace by configuring the plugin.  \nSee [configurations](#configurations) section for details.\n\n### JaCoCo coverage report\n\nIf you're using JaCoCo gradle plugin,\nyou can see the coverage at the end of builds:\n\n```console\n$ ./gradlew check\n\nCoverage summary:\nproject1:                 72.2%\nproject2-with-long-name:   4.0%\n\nBUILD SUCCESSFUL in 0s\n9 actionable tasks: 1 executed, 8 up-to-date\n```\n\n### Cobertura coverage report\n\nIf you're using [stevesaliman/gradle-cobertura-plugin](https://github.com/stevesaliman/gradle-cobertura-plugin),\nyou can see the coverage at the end of builds:\n\n```console\n$ ./gradlew cobertura check\n\n\u003e Task :instrument\nCobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file\n\n\u003e Task :test\nlog4j:WARN No appenders could be found for logger (net.sourceforge.cobertura.coveragedata.TouchCollector).\nlog4j:WARN Please initialize the log4j system properly.\nlog4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.\n\n\u003e Task :generateCoberturaReport\nCobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file\nReport time: 198ms\nCobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file\nReport time: 71ms\n\nCoverage summary:\ncobertura:  71.4%\n\nBUILD SUCCESSFUL in 3s\n7 actionable tasks: 7 executed\n```\n\n## Tasks\n\n### reportTest\n\nPrint JUnit test report.  \nThis task will be executed automatically after `test` task's failure by default, so you don't need to call it.\n\n### reportJacoco\n\nPrint JaCoCo coverage report.  \nThis task will be executed automatically after `jacocoTestReport` task by default, so you don't need to call it.\n\n### reportCobertura\n\nPrint Cobertura coverage report.  \nThis task will be executed automatically after `cobertura` task by default, so you don't need to call it.\n\n## Configurations\n\n```gradle\nconsoleReporter {\n    junit {\n        // Set this property to false if you don't need JUnit report.\n        // Default is true.\n        enabled true\n\n        // Set this property to false if you want to see console report always.\n        // Default is true.\n        reportOnFailure true\n\n        // Set this property to true if you want to see test summary.\n        // Default is false.\n        summaryEnabled true\n\n        // Set this property to true if you want to see standard output.\n        // Default is false.\n        stdoutEnabled true\n\n        // Set this property to true if you want to see standard error.\n        // Default is false.\n        stderrEnabled true\n\n        // Set this property to false if you don't need stacktrace.\n        // Default is true.\n        stacktraceEnabled true\n\n        // Set this property to false if you don't need colorized output.\n        // Default is true.\n        colorEnabled true\n\n        // Set this property to false if you don't need source code between stacktrace.\n        // Default is true.\n        partialSourceInsertionEnabled true\n    }\n\n    jacoco {\n        // Set this property to false if you don't need JaCoCo report.\n        // Default is true.\n        // Even if this is true, reporting will not work\n        // without applying jacoco plugin.\n        enabled true\n\n        // Set this property to false if you want to see console report always.\n        onlyWhenCoverageTaskExecuted true\n\n        // Set this property to false if you want to see console report\n        // just after each project's jacocoTestReport task.\n        // If set to true, all reports will be shown at the end of builds.\n        // Default is true.\n        reportAfterBuildFinished true\n\n        // Set this property to true if you want to treat a lack of the minimum coverage as an build error.\n        // This property sees thresholdError property, and if the coverage has fallen below this value\n        // the plugin will throw an exception to cause a build error.\n        // Default is false.\n        // If you set this to true, you should also set thresholdError property.\n        failIfLessThanThresholdError false\n\n        // Set this property to false if you don't like this plugin automatically changing some\n        // property of jacoco plugin.\n        // If this is set to true, the plugin will set some properties of jacoco plugin\n        // to calculate coverage.\n        // Default is true.\n        autoconfigureCoverageConfig true\n\n        // Set this property to your custom JacocoReport type task name, if you need.\n        // Default is 'jacocoTestReport'.\n        coverageTaskName 'jacocoTestReport'\n\n        // Set this property to your JaCoCo report XML file.\n        // Default is null, which means\n        // ${project.buildDir}/reports/jacoco/test/jacocoTestReport.xml\n        // will be parsed.\n        reportFile\n\n        // Set this property to a certain C0 coverage percentage.\n        // When the coverage is greater than or equals to this value,\n        // the coverage will be shown with green color.\n        // Default is 90.\n        thresholdFine 90\n\n        // Set this property to a certain C0 coverage percentage.\n        // When the coverage is greater than or equals to this value,\n        // the coverage will be shown with yellow color.\n        // (When the coverage is less than this value, result will be red.)\n        // Default is 70.\n        thresholdWarning 70\n\n        // Set this property to a certain C0 coverage percentage.\n        // When the coverage is less than this value and\n        // failIfLessThanThresholdError property is set to true,\n        // the build will fail.\n        // Default is 0.\n        thresholdError 0\n\n        // Set this property if you want to customize build error message\n        // when you use 'failIfLessThanThresholdError' feature.\n        brokenCoverageErrorMessage \"Coverage has fallen below the threshold in some projects.\"\n\n        // Set this property to false if you don't need colorized output.\n        // Default is true.\n        colorEnabled true\n    }\n\n    cobertura {\n        // Set this property to false if you don't need Cobertura report.\n        // Default is true.\n        // Even if this is true, reporting will not work\n        // without applying stevesaliman/gradle-cobertura-plugin plugin.\n        enabled true\n\n        // Set this property to false if you want to see console report always.\n        onlyWhenCoverageTaskExecuted true\n\n        // Set this property to false if you want to see console report\n        // just after each project's cobertura task.\n        // If set to true, all reports will be shown at the end of builds.\n        // Default is true.\n        reportAfterBuildFinished true\n\n        // Set this property to true if you want to treat a lack of the minimum coverage as an build error.\n        // This property sees thresholdError property, and if the coverage has fallen below this value\n        // the plugin will throw an exception to cause a build error.\n        // Default is false.\n        // If you set this to true, you should also set thresholdError property.\n        failIfLessThanThresholdError false\n\n        // Set this property to false if you don't like this plugin automatically changing some\n        // property of cobertura plugin.\n        // If this is set to true, the plugin will set some properties of cobertura plugin\n        // to calculate coverage.\n        // Default is true.\n        autoconfigureCoverageConfig true\n\n        // Set this property to your custom cobertura task name, if you need.\n        // Default is 'generateCoberturaReport'.\n        coverageTaskName 'generateCoberturaReport'\n\n        // Set this property to your Cobertura report XML file.\n        // Default is null, which means\n        // ${project.buildDir}/reports/cobertura/coverage.xml\n        // will be parsed.\n        reportFile\n\n        // Set this property to a certain C0 coverage percentage.\n        // When the coverage is greater than or equals to this value,\n        // the coverage will be shown with green color.\n        // Default is 90.\n        thresholdFine 90\n\n        // Set this property to a certain C0 coverage percentage.\n        // When the coverage is greater than or equals to this value,\n        // the coverage will be shown with yellow color.\n        // (When the coverage is less than this value, result will be red.)\n        // Default is 70.\n        thresholdWarning 70\n\n        // Set this property to a certain C0 coverage percentage.\n        // When the coverage is less than this value and\n        // failIfLessThanThresholdError property is set to true,\n        // the build will fail.\n        // Default is 0.\n        thresholdError 0\n\n        // Set this property if you want to customize build error message\n        // when you use 'failIfLessThanThresholdError' feature.\n        brokenCoverageErrorMessage \"Coverage has fallen below the threshold in some projects.\"\n\n        // Set this property to false if you don't need colorized output.\n        // Default is true.\n        colorEnabled true\n    }\n}\n```\n\n## License\n\n    Copyright 2015 Soichiro Kashima\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n        http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcellodesales%2Fgradle-coverage-console-reporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcellodesales%2Fgradle-coverage-console-reporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcellodesales%2Fgradle-coverage-console-reporter/lists"}