Class ZeebeConsoleOutputFileReporter

java.lang.Object
io.camunda.zeebe.ZeebeConsoleOutputFileReporter
All Implemented Interfaces:
org.apache.maven.surefire.extensions.ConsoleOutputReportEventListener

public final class ZeebeConsoleOutputFileReporter extends Object implements org.apache.maven.surefire.extensions.ConsoleOutputReportEventListener
A ConsoleOutputReportEventListener which will save a test's previous run's output instead of overwriting it. This is somewhat hacky, as the canonical implementation ConsoleOutputFileReporter is not really extensible. So instead we "predict" the output path that it will use, and if it was present, we copy it in order to preserve it. If we see that the canonical implementation changes too much, then we could simply make our own to stabilize things, but for now I think this is acceptable.

By using this implementation, it now works like this:

  • All calls are delegated to an instance of the canonical implementation
  • When writeTestOutput(TestOutputReportEntry) is called, we predict the path by calling FileReporter.getReportFile(File, String, String, String) via reflection just like the canonical implementation does
  • If a file exists at this path, extract the latest run count from the other existing files; we opted against keeping an in-memory cache, as on long builds this could use too much memory
  • Constructor Details

    • ZeebeConsoleOutputFileReporter

      public ZeebeConsoleOutputFileReporter(File reportsDirectory, String reportNameSuffix, boolean usePhrasedFileName, Integer forkNumber, org.apache.maven.surefire.extensions.ConsoleOutputReportEventListener delegate)
  • Method Details

    • testSetStarting

      public void testSetStarting(org.apache.maven.surefire.api.report.TestSetReportEntry reportEntry)
      Specified by:
      testSetStarting in interface org.apache.maven.surefire.extensions.ConsoleOutputReportEventListener
    • testSetCompleted

      public void testSetCompleted(org.apache.maven.surefire.api.report.TestSetReportEntry report)
      Specified by:
      testSetCompleted in interface org.apache.maven.surefire.extensions.ConsoleOutputReportEventListener
    • close

      public void close()
      Specified by:
      close in interface org.apache.maven.surefire.extensions.ConsoleOutputReportEventListener
    • writeTestOutput

      public void writeTestOutput(org.apache.maven.surefire.api.report.TestOutputReportEntry reportEntry)
      Specified by:
      writeTestOutput in interface org.apache.maven.surefire.extensions.ConsoleOutputReportEventListener