This Gradle plugin supports automatically gathering and publishingthe XML test results to the Projektor server. It listens to theend of the build, gathers up all the XML results generated byTest
tasks in the build, then sends those to the Projektor server.
Example Projektor report from the plugin’s build: https://projektorlive.herokuapp.com/tests/8VQSLOBCSCWA
Use plugin
To apply this plugin to your project:
See https://plugins.gradle.org/plugin/dev.projektor.publish for the latest version.
By default the plugin publishes results from all Test
tasks in the projectwhen the build finishes.
BenQ true 4K home theater projectors for movies, sports, streaming content, games, and much more! True 4K UHD with 8.3 million pixels, HDR and CinematicColors. Projector reviews - home theater projectors, projector lamps, portable and classroom projectors, and projector screens. Reviews and consumer info for all LCD, DLP and LCOS digital projectors. Best home theater projector for 2021. From portable projectors to affordable 1080p models to light cannons built for gaming or 4K HDR, these are the best projectors for the money.
The plugin also adds a publishResults
task that lets you publish testresults from a build after it has executed (for example, if you didn’t have auto-publish on)This can be a good way to easily share a specific test failure with colleagues.
./gradlew publishResults
Note: If you have a multi-project build, please apply the plugin to the root project.
Configuration
All the configuration of the plugin is inside the projektor
block.To use the plugin, first set the URL of the Projektor server:
You can also include results from arbitrary directories in your build with the additionalResultsDirs
configuration option:
Resiliency
The plugin includes configurable retry and timeout settings to help make publishing resultsto the Projektor server more resilient against network hiccups:
Slack message
It can be helpful to proactively notify folks when a CI build fails via Slack.To help make that easier, the Projektor Gradle plugin has the option to write a formatted Slackmessage in a JSON file. This Slack message includes a direct link to the Projektor test reportso users can quickly investigate test failures.
To use it, set the writeSlackMessageFile
parameter to true
.
By default, the Slack message is written to a file named projektor_failure_message.json
,but you can specify your own file name by setting slackMessageFileName
Code coverage
Starting with plugin version 5.5.4
and server 3.5.1
, Projektor has the ability to publish andvisualize code coverage data as part of the Projektor report.
To include code coverage stats in your Projektor reports, first ensure you are using plugin version 5.5.4
or higher,enable Jacoco in your build,and include the jacocoTestReport
task with your build. That’s it.The Projektor Gradle plugin will automatically configure, collect and upload the XML coverage reports fromeach project in the build that uses Jacoco.
For an example Projektor report with coverage, check out https://projektorlive.herokuapp.com/tests/SUWSHGIRS6JP/coverage
Projektor Cz
Ironically, this example build shows that the code coverage of the coverage parsing module in Projektor is low. Need to work on that.
Update: Coverage for the parsing module looking better now: https://projektorlive.herokuapp.com/tests/0M7BEOCS9VJA/coverage
Combining code coverage from multiple test tasks
Some projects have separate test tasks, such as test
and integrationTest
.Projektor will automatically collect coverage stats for all projects in a multi-project build,but if your project has multiple test tasks in the same project you’ll need a bit of extra configurationin your build.gradle
file to have Jacoco combine the coverage data from the different test tasksbefore the coverage data is sent to the Projektor server:
Platno Za Projektor
All configuration options
Parameter | Type | Default | Description |
---|---|---|---|
serverUrl** | String | null | Projektor server URL to publish results to |
alwaysPublishInCI | boolean | true | Whether results are automatically published at the end of the build when running in CI |
publishOnLocalFailure | boolean | true | Whether results are automatically published at the end of the build if it fails when running locally |
alwaysPublish | boolean | false | Whether to always publish the results regardless of environment or outcome |
publishToken | String | null | Token to include in publish request to server (only needed when server has publish token set) |
additionalResultsDirs | List<String> | [] | Additional directories to include results from. Useful when you want to include results from a task that isn’t Test type |
attachments | List<FileTree> | [] | FileTrees to include as attachments to the test report and make available in the UI |
compressionEnabled | boolean | true | Whether to compress the test results with GZIP when sending them to the server |
publishRetryMaxAttempts | int | 3 | Max number of attempts when retrying publish of results to server |
publishRetryInterval | long | 100 | Amount to wait (in milliseconds) between retry attempts |
publishTimeout | long | 10_000 | Timeout (in milliseconds) to send results to the server |
writeSlackMessageFile | boolean | false | Whether to write a Slack message file with a link to the Projektor test report |
slackMessageFileName | String | projektor_failure_message.json | Name of the Slack message file (if enabled) |
codeCoveragePublish | boolean | true | Whether to include code coverage data in the Projektor report (if the build has coverage enabled with the Jacoco plugin) |
** Required
Compatibility
Plugin version | Server version | Java version |
---|---|---|
1.0.0 - 1.0.2 | 1.0.0+ | 8+ |
1.0.3 | 1.0.6+ | 8+ |
2.0.0 | 2.0.0+ | 8+ |
3.0.0 | 2.0.0+ | 8+ |
4.0.0 | 2.0.0+ | 11+ |
5.0.0+ | 3.3.0+ | 11+ |
5.1.0+ | 3.5.0+ | 11+ |
Configure and apply via another plugin
In larger organizations it can be common to have base plugins that apply and configure a common setof plugins used by each project. To apply the ProjektorPublishPlugin
this way from another plugin: