Class SystemTestCoverageExtension

java.lang.Object
org.creekservice.api.system.test.gradle.plugin.coverage.SystemTestCoverageExtension

public class SystemTestCoverageExtension extends Object
Extension applied to system test tasks if the JaCoCo plugin is installed.

Handles configuration of coverage options.

  • Field Details

    • COVERAGE_EXT_NAME

      public static final String COVERAGE_EXT_NAME
      Name of coverage task extension.
      See Also:
    • CONTAINER_AGENT_MOUNT

      public static final String CONTAINER_AGENT_MOUNT
      The path within the container where a read-only directory containing the Jacoco agent will be mounted
      See Also:
    • CONTAINER_RESULT_MOUNT

      public static final String CONTAINER_RESULT_MOUNT
      The path within the container where a writable directory will be mounted to receive the coverage results.
      See Also:
  • Constructor Details

    • SystemTestCoverageExtension

      public SystemTestCoverageExtension(SystemTest task)
      Create extension, attaching it to the supplied task.
      Parameters:
      task - the test the extension is being applied to.
  • Method Details

    • getResultMountDirectory

      @OutputDirectory public org.gradle.api.file.DirectoryProperty getResultMountDirectory()
      Returns:
      The directory where results will be written, which will be mounted into the Docker container.
    • mountOptions

      public List<String> mountOptions()
      Returns:
      command line arguments to pass to the test executor to set up the coverage mounts.
    • asJavaToolOptions

      public String asJavaToolOptions()
      Returns:
      the text to place into the JAVA_TOOL_OPTIONS environment variable to have coverage captured.
    • cleanUp

      public void cleanUp()
      Remove any previous results