Package net.splitcells.network.worker
Class Logger
- java.lang.Object
-
- net.splitcells.network.worker.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
commit()
Deprecated.void
executionFinished(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult)
void
executionStarted(org.junit.platform.launcher.TestIdentifier testIdentifier)
void
logExecutionResults(String subject, String executor, LocalDate localDate, String resultType, double result)
static Logger
logger()
protected Optional<String>
parseTestIdentifier(String testIdentifier)
String
readExecutionResults(String subject, String executor)
void
testPlanExecutionFinished(org.junit.platform.launcher.TestPlan testPlan)
-
-
-
Method Detail
-
logger
public static Logger logger()
-
logExecutionResults
public void logExecutionResults(String subject, String executor, LocalDate localDate, String resultType, double result)
-
executionStarted
public void executionStarted(org.junit.platform.launcher.TestIdentifier testIdentifier)
- Specified by:
executionStarted
in interfaceorg.junit.platform.launcher.TestExecutionListener
-
executionFinished
public void executionFinished(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult)
- Specified by:
executionFinished
in interfaceorg.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 interfaceorg.junit.platform.launcher.TestExecutionListener
-
-