Configuration

We use convention over configuration to configure the behavior of recheck. Thus unless your setup does not fit to the default mechanism, you should not have to configure anything.

Tools we use for code development, and thus are configured as the default:

Tools we do not (actively) use, but support:

Tip

If you feel that the tools you are using are not supported or lack support, you are welcome to implement or improve the support for the respective tool and create a pull request or create an issue.

RecheckOptions

The RecheckOptions are used to configure the behavior of Recheck. They use the builder pattern and cannot be changed, once they are created (i.e. they are immutable).

RecheckOptions options = RecheckOptions.builder()
    // Do your configuration here
    .build()

Usage

The options can be easily passed to the RecheckImpl.

Recheckoptions opts = RecheckOptions.builder()
    // Do your configuration here
    .build();
Recheck re = new RecheckImpl( opts );

Note

All available Recheck instances should honor all available options from RecheckOptions.

Options

Below is a list of the available options you may configure with corresponding methods on RecheckOptionsBuilder. Please refer to the detailed sections below.

Option Default Description
namingStrategy ClassAndMethodBasedNamingStrategy Defines the name for the phase of the lifecycle.
projectLayout MavenProjectLayout Defines where the Golden Masters and reports are located.
suiteName null Overwrite the name for the suite.
If null, NamingStrategy#getSuiteName() is used.
reportUploadEnabled false Upload reports to rehub.
ignore recheck.ignore Set the filter used for reporting the differences after a test phase.
See examples below.

Example

RecheckOptions.builder()
        .namingStrategy( new ClassAndMethodBasedShortNamingStrategy() )
        .projectLayout( new GradleProjectLayout() )
        .suiteName( "my-custom-suite-name" )
        .enableReportUpload()
        .addIgnore( "MyCustomIgnore.filter" )
        .build();

Locating Files

Per default, we assume a Maven project with JUnit. The files are located under the following folders:

  1. Golden Masters: src/test/resources/retest/recheck/
  2. Reports: target/test-classes/retest/recheck/

You may change the location of files using a custom ProjectLayout or define the name using a custom NamingStrategy as described in the lifecycle.

Upload Reports to rehub

When executing your tests on a CI, it may not be straightforward to access the created reports. For this we offer a way to upload your reports to rehub so that you can easily update your Golden Masters.

Using Filters

If you want to use your own created filter, you may specify the full name (e.g. "MyCustomIgnore.filter") of the file which can be located as described in the filter documentation.

Per default, we load the recheck.ignore file. Note that there are several methods to add/update filters:

  1. RecheckOptionsBuilder#addIgnore( String ): Will append a filter.
  2. RecheckOptionsBuilder#setIgnore( String ): Will overwrite the filter.
  3. RecheckOptions#ignoreNothing(): Will remove all filters.

Properties

Some properties can be set via system properties.

####################################################################################################
# FORMAT                                                                                           #
####################################################################################################

# Description.
# Possible values.
key=${DEFAULT_VALUE}

####################################################################################################
# PROJECT                                                                                          #
####################################################################################################

# If set, recheck will use this path as the project root (containing e.g. the .retest folder).
# Any valid absolute path.
de.retest.recheck.project.root=null

  1. Note that JUnit and TestNG is supported by default through ClassAndMethodBasedNamingStrategy