use of de.dagere.peass.ci.logs.rts.RTSLogData in project peass-ci-plugin by jenkinsci.
the class RTSLogFileVersionReader method addMethodLogData.
private void addMethodLogData(final boolean runWasSuccessful, final boolean isParameterizedWithoutIndex) {
File cleanFile = new File(testClazzFolder, "clean" + File.separator + methodFile.getName());
RTSLogData data = new RTSLogData(version, methodFile, cleanFile, runWasSuccessful, isParameterizedWithoutIndex);
files.put(test, data);
LOG.debug("Adding log: {}", test);
}
use of de.dagere.peass.ci.logs.rts.RTSLogData in project peass-ci-plugin by jenkinsci.
the class TestRTSLogFileReader method testReading.
@Test
public void testReading() throws JsonParseException, JsonMappingException, IOException {
RTSLogFileReader reader = util.initializeReader();
Map<String, File> testcases = reader.findProcessSuccessRuns();
Assert.assertEquals(1, testcases.size());
File testRunningFile = testcases.get("a23e385264c31def8dcda86c3cf64faa698c62d8");
Assert.assertTrue(testRunningFile.exists());
Assert.assertTrue(reader.isLogsExisting());
Map<TestCase, RTSLogData> rtsVmRuns = reader.getRtsVmRuns("a23e385264c31def8dcda86c3cf64faa698c62d8");
Assert.assertEquals(2, rtsVmRuns.size());
checkFirstTest(rtsVmRuns);
checkSecondTest(reader);
String rtsLog = reader.getRTSLog();
Assert.assertEquals("This is a rts log test", rtsLog);
}
use of de.dagere.peass.ci.logs.rts.RTSLogData in project peass-ci-plugin by jenkinsci.
the class TestRTSLogFileReader method checkFirstTest.
private void checkFirstTest(Map<TestCase, RTSLogData> rtsVmRuns) {
File dataFile1 = rtsVmRuns.get(TEST1).getMethodFile();
Assert.assertTrue(dataFile1.exists());
RTSLogData logDataTest2 = rtsVmRuns.get(TEST2);
File dataFile2 = logDataTest2.getMethodFile();
Assert.assertTrue(dataFile2.exists());
Assert.assertFalse(logDataTest2.isSuccess());
Assert.assertFalse(logDataTest2.isParameterizedWithoutIndex());
}
use of de.dagere.peass.ci.logs.rts.RTSLogData in project peass-ci-plugin by jenkinsci.
the class TestRTSLogFileReaderMultimodule method testReading.
@Test
public void testReading() throws JsonParseException, JsonMappingException, IOException {
RTSLogFileReader reader = util.initializeReader();
Map<String, File> testcases = reader.findProcessSuccessRuns();
Assert.assertEquals(1, testcases.size());
File testRunningFile = testcases.get(RTSLogFileTestUtil.VERSION);
Assert.assertTrue(testRunningFile.exists());
Assert.assertTrue(reader.isLogsExisting());
Map<TestCase, RTSLogData> rtsVmRuns = reader.getRtsVmRuns(RTSLogFileTestUtil.VERSION);
Assert.assertEquals(2, rtsVmRuns.size());
File dataFile1 = rtsVmRuns.get(TestRTSLogFileReader.TEST1).getMethodFile();
Assert.assertTrue(dataFile1.exists());
RTSLogData logDataTest2 = rtsVmRuns.get(TestRTSLogFileReader.TEST2);
File dataFile2 = logDataTest2.getMethodFile();
Assert.assertTrue(dataFile2.exists());
Assert.assertFalse(logDataTest2.isSuccess());
Map<TestCase, RTSLogData> rtsVmRunsPredecessor = reader.getRtsVmRuns(RTSLogFileTestUtil.VERSION_OLD);
Assert.assertEquals(2, rtsVmRunsPredecessor.size());
RTSLogData rtsLogData = rtsVmRunsPredecessor.get(TestRTSLogFileReader.TEST1);
Assert.assertEquals(RTSLogFileTestUtil.VERSION_OLD, rtsLogData.getVersion());
Assert.assertTrue(rtsLogData.isSuccess());
String rtsLog = reader.getRTSLog();
Assert.assertEquals("This is a rts log test", rtsLog);
}
use of de.dagere.peass.ci.logs.rts.RTSLogData in project peass-ci-plugin by jenkinsci.
the class TestRTSLogFileReaderParameterized method testParameterizedReading.
@Test
public void testParameterizedReading() {
VisualizationFolderManager visualizationFoldersMock = Mockito.mock(VisualizationFolderManager.class);
Mockito.when(visualizationFoldersMock.getResultsFolders()).thenReturn(new ResultsFolders(currentDir, "parameterized-demo"));
Mockito.when(visualizationFoldersMock.getPeassFolders()).thenReturn(new PeassFolders(new File(currentDir, "parameterized-demo_peass")));
MeasurementConfig measurementConfig = Mockito.mock(MeasurementConfig.class);
ExecutionConfig executionConfig = new ExecutionConfig();
executionConfig.setVersion(VERSION);
executionConfig.setVersionOld(VERSION_OLD);
Mockito.when(measurementConfig.getExecutionConfig()).thenReturn(executionConfig);
RTSLogFileReader reader = new RTSLogFileReader(visualizationFoldersMock, measurementConfig);
Map<TestCase, RTSLogData> rtsVmRuns = reader.getRtsVmRuns(VERSION);
RTSLogData data = rtsVmRuns.get(new TestCase("de.dagere.peass.ExampleTest", "test", "", "JUNIT_PARAMETERIZED-1"));
Assert.assertNotNull(data);
Assert.assertFalse(data.isParameterizedWithoutIndex());
Assert.assertTrue(data.isSuccess());
Map<TestCase, RTSLogData> rtsVmRunsPredecessor = reader.getRtsVmRuns(VERSION_OLD);
RTSLogData dataImplicitParameterized = rtsVmRunsPredecessor.get(new TestCase("de.dagere.peass.ExampleTest", "test", ""));
Assert.assertNotNull(dataImplicitParameterized);
Assert.assertTrue(dataImplicitParameterized.isParameterizedWithoutIndex());
Assert.assertFalse(dataImplicitParameterized.isSuccess());
}
Aggregations