use of de.dagere.peass.folders.ResultsFolders in project peass-ci-plugin by jenkinsci.
the class CleanRTSCallable method invoke.
@Override
public Boolean invoke(final File potentialSlaveWorkspace, final VirtualChannel channel) throws IOException, InterruptedException {
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);
deleteResultFiles(resultsFolders);
deleteLogFolders(resultsFolders);
CleanUtil.cleanProjectFolder(folder, projectName);
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 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());
}
use of de.dagere.peass.folders.ResultsFolders in project peass-ci-plugin by jenkinsci.
the class TestRTSVisualizationCreator method testEmptyCreation.
@Test
public void testEmptyCreation() throws JsonGenerationException, JsonMappingException, IOException {
PeassProcessConfiguration peassConfig = new PeassProcessConfiguration(true, new MeasurementConfig(15), new TestSelectionConfig(1, false), null, false, false, false, null);
ResultsFolders localWorkspace = new ResultsFolders(new File("target/current"), "empty-test");
writeEmptyDependencies(localWorkspace);
writeEmptyExecutionData(localWorkspace);
RTSVisualizationCreator creator = new RTSVisualizationCreator(localWorkspace, peassConfig);
creator.visualize(Mockito.mock(Run.class), new RTSLogSummary(false, false, true, true, false, false));
}
use of de.dagere.peass.folders.ResultsFolders in project peass by DaGeRe.
the class GetChanges method call.
@Override
public Void call() throws Exception {
SelectedTests selectedTests = VersionSorter.getSelectedTests(staticSelectionFile, executionFile);
if (!out.exists()) {
out.mkdirs();
}
LOG.info("Errors: 1: {} 2: {}", statisticConfigMixin.getType1error(), statisticConfigMixin.getType2error());
ResultsFolders folders = new ResultsFolders(out, "out");
final ChangeReader reader = createReader(folders, selectedTests);
if (staticSelectionFile != null) {
StaticTestSelection dependencies = Constants.OBJECTMAPPER.readValue(staticSelectionFile, StaticTestSelection.class);
reader.setTests(dependencies.toExecutionData().getVersions());
}
if (executionFile != null) {
ExecutionData executions = Constants.OBJECTMAPPER.readValue(executionFile, ExecutionData.class);
reader.setTests(executions.getVersions());
}
for (final File dataFile : data) {
reader.readFile(dataFile);
}
return null;
}
use of de.dagere.peass.folders.ResultsFolders in project peass by DaGeRe.
the class GetAllChanges method getChangesForMeasurementfolder.
public static void getChangesForMeasurementfolder(final RepoFolders folders, final String project, final File cleanFolder, final StaticTestSelection dependencies) throws JAXBException, FileNotFoundException {
ResultsFolders resultsFolders = new ResultsFolders(folders.getProjectStatisticsFolder(project), project);
final ChangeReader reader = new ChangeReader(resultsFolders, project, dependencies);
final ProjectChanges changes = reader.readFile(cleanFolder);
if (changes != null) {
final File allPropertyFile = new File(folders.getPropertiesFolder(), project + File.separator + "properties_alltests.json");
if (allPropertyFile.exists()) {
final VersionChangeProperties properties = ReadProperties.readVersionProperties(changes, allPropertyFile);
try {
// final ProjectChanges oldKnowledge = ProjectChanges.getOldChanges();
// ProjectChanges.mergeKnowledge(oldKnowledge, knowledge);
// ReadProperties.writeOnlySource(properties, oldKnowledge);
Constants.OBJECTMAPPER.writeValue(folders.getProjectPropertyFile(project), properties);
} catch (final IOException e) {
e.printStackTrace();
}
}
}
}
Aggregations