Skip to content

Latest commit

 

History

History
110 lines (89 loc) · 4.15 KB

README.md

File metadata and controls

110 lines (89 loc) · 4.15 KB

Build Status Maven Central

donut-maven-plugin

This is a maven plugin for donut. More about donut here.

usage

in your pom.xml add the plugin with the following configuration:

<plugin>
    <groupId>report.donut</groupId>
    <artifactId>donut-maven-plugin</artifactId>
    <version>1.2.2</version>
    <executions>
        <execution>
            <id>execution</id>
            <phase>post-integration-test</phase>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
                <resultSources>
                    <resultSource>
                        <!-- optional format, defaults to cucumber -->
                        <format>cucumber</format>
                        <directory>${project.build.directory}/cucumber-reports</directory>
                    </resultSource>
                </resultSources>
                <outputPath>${project.build.directory}/donut</outputPath>
                <timestamp>${maven.build.timestamp}</timestamp>
                <template>default</template>
                <projectName>${project.name}</projectName>
                <!-- optional customAttributes -->
                <customAttributes>
                   <customAttribute>
                      <name>My Custom 1</name>
                      <value>custom123</value>
                   </customAttribute>
                   <customAttribute>
                      <name>App Name</name>
                      <value>${app.name}</value>
                   </customAttribute>
                </customAttributes>
            </configuration>
        </execution>
    </executions>
</plugin>

For older versions, use groupId as io.magentys and an appropriate version.

all configuration parameters

<resultSources>
<outputPath>
<prefix>
<timestamp>
<template>
<countSkippedAsFailure>
<countPendingAsFailure>
<countUndefinedAsFailure>
<countMissingAsFailure>
<projectName>
<projectVersion>
<customAttributes>

default values:

  • resultSources : is mandatory and it should be specify multiple result sources that detail the result format and location.
  • outputPath : by default a donut folder will be generated
  • prefix : the generated file is donut-report.html, however you can specify prefix i.e. myproject-
  • timestamp : refers to the start time of your execution. If not specified by the user reports will use now
  • template : donut supports 2 themes, default and light. default is the default value.
  • countSkippedAsFailure, countPendingAsFailure, countUndefinedAsFailure, countMissingAsFailure: are boolean values, and by default they are set to false.
  • projectName : is a string value
  • projectVersion : is a string value
  • customAttributes : is a map of name/value pairs

report timestamp

As it may take a while to execute your tests, Donut expects that you pass the start timestamp, otherwise will default it to now at the time of the report execution. The format should be yyyy-MM-dd-HHmm

Example:

<properties>
   <maven.build.timestamp.format>yyyy-MM-dd-HHmm</maven.build.timestamp.format>
</properties>

Contributing

To contribute:

  • Create an integration test to demonstrate the behaviour under src/it/. For example, to add support to default the report prefix to an empty string:
    • Create src/it/default-empty-prefix
    • Copy the contents of the src/it/default-empty-prefix directory and update the pom as appropriate to demonstrate the configuration. Update the verify.groovy to implement the test for your feature.
    • Run mvn clean install -Prun-its to run the integration tests.

License

This project is under an MIT license

Powered by: MagenTys & Mechanical Rock