Search in sources :

Example 6 with VisualizationFolderManager

use of de.dagere.peass.ci.helper.VisualizationFolderManager in project peass-ci-plugin by jenkinsci.

the class TestLogFileReader method testReading.

@Test
public void testReading() throws JsonParseException, JsonMappingException, IOException {
    MeasurementConfig peassDemoConfig = new MeasurementConfig(2, VERSION, VERSION_OLD);
    VisualizationFolderManager visualizationFolders = Mockito.mock(VisualizationFolderManager.class);
    Mockito.when(visualizationFolders.getPeassFolders()).thenReturn(new PeassFolders(testFolder));
    Mockito.when(visualizationFolders.getResultsFolders()).thenReturn(new ResultsFolders(localFolder, "demo-vis2"));
    LogFileReader reader = new LogFileReader(visualizationFolders, peassDemoConfig);
    ProjectStatistics statistics = Constants.OBJECTMAPPER.readValue(new File("src/test/resources/demo-results-logs/statistics.json"), ProjectStatistics.class);
    Map<TestCase, List<LogFiles>> testcases = reader.readAllTestcases(statistics.getStatistics().get(VERSION).keySet());
    Assert.assertEquals(1, testcases.size());
    TestCase test = new TestCase("de.test.CalleeTest#onlyCallMethod2");
    List<LogFiles> logFiles = testcases.get(test);
    Assert.assertEquals(2, logFiles.size());
    String measureLog = reader.getMeasureLog();
    Assert.assertEquals("This is a measurement log test", measureLog);
}
Also used : MeasurementConfig(de.dagere.peass.config.MeasurementConfig) LogFiles(de.dagere.peass.ci.logs.LogFiles) ProjectStatistics(de.dagere.peass.analysis.measurement.ProjectStatistics) PeassFolders(de.dagere.peass.folders.PeassFolders) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) LogFileReader(de.dagere.peass.ci.logs.LogFileReader) List(java.util.List) VisualizationFolderManager(de.dagere.peass.ci.helper.VisualizationFolderManager) ResultsFolders(de.dagere.peass.folders.ResultsFolders) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 7 with VisualizationFolderManager

use of de.dagere.peass.ci.helper.VisualizationFolderManager in project peass-ci-plugin by jenkinsci.

the class TestLogFileReader method testReadingIterationChanged.

@Test
public void testReadingIterationChanged() throws JsonParseException, JsonMappingException, IOException {
    MeasurementConfig peassDemoConfig = new MeasurementConfig(2, VERSION, VERSION_OLD);
    VisualizationFolderManager visualizationFolders = Mockito.mock(VisualizationFolderManager.class);
    Mockito.when(visualizationFolders.getPeassFolders()).thenReturn(new PeassFolders(testFolder));
    Mockito.when(visualizationFolders.getResultsFolders()).thenReturn(new ResultsFolders(localFolder, "demo-vis2"));
    LogFileReader reader = new LogFileReader(visualizationFolders, peassDemoConfig);
    ProjectStatistics statistics = Constants.OBJECTMAPPER.readValue(new File("src/test/resources/demo-results-logs/statistics.json"), ProjectStatistics.class);
    Map<TestCase, List<LogFiles>> testcases = reader.readAllTestcases(statistics.getStatistics().get(VERSION).keySet());
    Assert.assertEquals(1, testcases.size());
    TestCase test = new TestCase("de.test.CalleeTest#onlyCallMethod2");
    List<LogFiles> logFiles = testcases.get(test);
    Assert.assertEquals(2, logFiles.size());
    Assert.assertFalse(logFiles.get(0).isCurrentSuccess());
    Assert.assertTrue(logFiles.get(0).isPredecessorSuccess());
    Assert.assertTrue(logFiles.get(1).isCurrentSuccess());
    Assert.assertTrue(logFiles.get(1).isPredecessorSuccess());
}
Also used : MeasurementConfig(de.dagere.peass.config.MeasurementConfig) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) LogFileReader(de.dagere.peass.ci.logs.LogFileReader) LogFiles(de.dagere.peass.ci.logs.LogFiles) ProjectStatistics(de.dagere.peass.analysis.measurement.ProjectStatistics) List(java.util.List) VisualizationFolderManager(de.dagere.peass.ci.helper.VisualizationFolderManager) ResultsFolders(de.dagere.peass.folders.ResultsFolders) File(java.io.File) PeassFolders(de.dagere.peass.folders.PeassFolders) Test(org.junit.jupiter.api.Test)

Example 8 with VisualizationFolderManager

use of de.dagere.peass.ci.helper.VisualizationFolderManager in project peass-ci-plugin by jenkinsci.

the class TestRCALogFileReader method testReading.

@Test
public void testReading() throws JsonParseException, JsonMappingException, IOException {
    MeasurementConfig peassDemoConfig = new MeasurementConfig(2, RTSLogFileTestUtil.VERSION, RTSLogFileTestUtil.VERSION_OLD);
    VisualizationFolderManager visualizationFolders = Mockito.mock(VisualizationFolderManager.class);
    Mockito.when(visualizationFolders.getPeassFolders()).thenReturn(new PeassFolders(testFolder));
    Mockito.when(visualizationFolders.getPeassRCAFolders()).thenReturn(new CauseSearchFolders(testFolder));
    Mockito.when(visualizationFolders.getResultsFolders()).thenReturn(new ResultsFolders(localFolder, "demo-vis2"));
    LogFileReader reader = new LogFileReader(visualizationFolders, peassDemoConfig);
    TestCase test = new TestCase("de.test.CalleeTest#onlyCallMethod2");
    Map<TestCase, List<RCALevel>> rcaTestcases = reader.getRCATestcases();
    List<RCALevel> levels = rcaTestcases.get(test);
    Assert.assertEquals(1, levels.size());
    MatcherAssert.assertThat(levels.get(0).getLogFiles(), Matchers.hasSize(3));
    String rtsLog = reader.getRCALog();
    Assert.assertEquals("This is a rca log test", rtsLog);
}
Also used : MeasurementConfig(de.dagere.peass.config.MeasurementConfig) CauseSearchFolders(de.dagere.peass.folders.CauseSearchFolders) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) LogFileReader(de.dagere.peass.ci.logs.LogFileReader) List(java.util.List) VisualizationFolderManager(de.dagere.peass.ci.helper.VisualizationFolderManager) ResultsFolders(de.dagere.peass.folders.ResultsFolders) PeassFolders(de.dagere.peass.folders.PeassFolders) RCALevel(de.dagere.peass.ci.logs.rca.RCALevel) Test(org.junit.jupiter.api.Test)

Aggregations

VisualizationFolderManager (de.dagere.peass.ci.helper.VisualizationFolderManager)8 MeasurementConfig (de.dagere.peass.config.MeasurementConfig)7 PeassFolders (de.dagere.peass.folders.PeassFolders)6 ResultsFolders (de.dagere.peass.folders.ResultsFolders)6 Test (org.junit.jupiter.api.Test)6 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)5 File (java.io.File)5 LogFileReader (de.dagere.peass.ci.logs.LogFileReader)4 List (java.util.List)4 ProjectStatistics (de.dagere.peass.analysis.measurement.ProjectStatistics)2 LogFiles (de.dagere.peass.ci.logs.LogFiles)2 RTSLogFileReader (de.dagere.peass.ci.logs.RTSLogFileReader)2 RCALevel (de.dagere.peass.ci.logs.rca.RCALevel)2 CauseSearchFolders (de.dagere.peass.folders.CauseSearchFolders)2 Run (hudson.model.Run)2 ProjectChanges (de.dagere.peass.analysis.changes.ProjectChanges)1 MeasurementVisualizationAction (de.dagere.peass.ci.MeasurementVisualizationAction)1 DefaultMeasurementVisualizer (de.dagere.peass.ci.helper.DefaultMeasurementVisualizer)1 RCAVisualizer (de.dagere.peass.ci.helper.RCAVisualizer)1 RTSLogData (de.dagere.peass.ci.logs.rts.RTSLogData)1