Class Logger

  • All Implemented Interfaces:
    org.junit.platform.launcher.TestExecutionListener

    public class Logger
    extends Object
    implements org.junit.platform.launcher.TestExecutionListener

    Logs the runtime of tests into a project folder and commits these logs. It is assumed, that the folder of the project is under version control.

    The entries are stored at "./src/main/csv/**". The relative path of each entry represents the package, the test case and the executor of the test: "./src/main/csv///.csv". The executors hardware and software should not change between each run, in order to make it easily possible to find regressions.

    Each CSV file contains the 2 columns "Date" and "Execution Time". The first one has the executions date of the test case. The second one contains the execution time for the corresponding test case.

    BUILDER_RUNTIME_LOG"/.csv" contains the start times of all runs for a given host.

    • Method Detail

      • logger

        public static Logger logger()
      • logExecutionResults

        public void logExecutionResults​(String subject,
                                        String executor,
                                        LocalDate localDate,
                                        String resultType,
                                        double result)
      • readExecutionResults

        public String readExecutionResults​(String subject,
                                           String executor)
      • executionStarted

        public void executionStarted​(org.junit.platform.launcher.TestIdentifier testIdentifier)
        Specified by:
        executionStarted in interface org.junit.platform.launcher.TestExecutionListener
      • executionFinished

        public void executionFinished​(org.junit.platform.launcher.TestIdentifier testIdentifier,
                                      org.junit.platform.engine.TestExecutionResult testExecutionResult)
        Specified by:
        executionFinished in interface org.junit.platform.launcher.TestExecutionListener
      • commit

        @Deprecated
        public void commit()
        Deprecated.
        TODO TOFIX This does not work, because PATH and things like the git config are not available during the execution in the shell. The reason for this is unknown. In order to fix this, the executing shell script calling this logger executes the committing shell command by itself instead. Some systems may not have added an OS state interface installation to the PATH environmental variable of non-interactive shells. Therefore, the standard `~/bin/net.splitcells.os.state.interface.commands.managed/command.managed.export.bin` command is used, in order to extend the PATH variable accordingly only inside the current shell session.
      • testPlanExecutionFinished

        public void testPlanExecutionFinished​(org.junit.platform.launcher.TestPlan testPlan)
        Specified by:
        testPlanExecutionFinished in interface org.junit.platform.launcher.TestExecutionListener