use of de.dagere.peass.folders.ResultsFolders in project peass-ci-plugin by jenkinsci.
the class RTSLogFileTestUtil method initializeReader.
RTSLogFileReader initializeReader() {
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, projectName));
RTSLogFileReader reader = new RTSLogFileReader(visualizationFolders, peassDemoConfig);
return reader;
}
use of de.dagere.peass.folders.ResultsFolders in project peass-ci-plugin by jenkinsci.
the class TestRCALogFileReaderMultimodule 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);
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);
}
use of de.dagere.peass.folders.ResultsFolders in project peass-ci-plugin by jenkinsci.
the class TestRCALogFileReaderMultimodule method init.
@BeforeEach
public void init() throws IOException {
File source = new File("src/test/resources/demo-results-logs/demo-vis2-multimodule_peass");
if (localFolder.exists()) {
FileUtils.deleteDirectory(localFolder);
}
if (!localFolder.exists()) {
localFolder.mkdirs();
}
FileUtils.copyDirectory(source, testFolder);
ResultsFolders folders = new ResultsFolders(localFolder, "demo-vis2");
File rcaLogFile = folders.getRCALogFile(RTSLogFileTestUtil.VERSION, RTSLogFileTestUtil.VERSION_OLD);
FileUtils.write(rcaLogFile, "This is a rca log test", StandardCharsets.UTF_8);
}
use of de.dagere.peass.folders.ResultsFolders in project peass-ci-plugin by jenkinsci.
the class CleanMeasurementCallable method invoke.
@Override
public Boolean invoke(final File potentialSlaveWorkspace, final VirtualChannel channel) {
try (final JenkinsLogRedirector redirector = new JenkinsLogRedirector(listener)) {
String projectName = potentialSlaveWorkspace.getName();
File folder = new File(potentialSlaveWorkspace.getParentFile(), projectName + "_fullPeass");
ResultsFolders resultsFolders = new ResultsFolders(folder, projectName);
deleteAllMeasurementData(projectName, folder, resultsFolders);
return true;
} catch (IOException e) {
listener.getLogger().println("Exception thrown");
e.printStackTrace(listener.getLogger());
e.printStackTrace();
return false;
}
}
use of de.dagere.peass.folders.ResultsFolders in project peass-ci-plugin by jenkinsci.
the class CleanRCACallable method cleanFolder.
public static void cleanFolder(final String projectName, final File folder) throws IOException {
System.out.println("Trying " + folder + " " + projectName);
ResultsFolders resultsFolders = new ResultsFolders(folder, projectName);
File visualizationFolder = new File(folder, VisualizationFolderManager.VISUALIZATION_FOLDER_NAME);
if (visualizationFolder.exists()) {
System.out.println("Deleting " + visualizationFolder);
FileUtils.deleteDirectory(visualizationFolder);
}
deleteRCALogFolder(resultsFolders);
}
Aggregations