use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.
the class ContinuousDependencyReader method doPartialRCS.
private void doPartialRCS(final StaticTestSelection dependencies, final VersionIterator newIterator) {
DependencyReader reader = new DependencyReader(dependencyConfig, folders, resultsFolders, dependencies.getUrl(), newIterator, new VersionKeeper(new File(resultsFolders.getStaticTestSelectionFile().getParentFile(), "nochanges.json")), executionConfig, kiekerConfig, env);
newIterator.goTo0thCommit();
reader.readCompletedVersions(dependencies);
try {
ExecutionData executions = Constants.OBJECTMAPPER.readValue(resultsFolders.getTraceTestSelectionFile(), ExecutionData.class);
reader.setExecutionData(executions);
if (resultsFolders.getCoverageSelectionFile().exists()) {
ExecutionData coverageExecutions = Constants.OBJECTMAPPER.readValue(resultsFolders.getCoverageSelectionFile(), ExecutionData.class);
reader.setCoverageExecutions(coverageExecutions);
if (resultsFolders.getCoverageInfoFile().exists()) {
CoverageSelectionInfo coverageInfo = Constants.OBJECTMAPPER.readValue(resultsFolders.getCoverageInfoFile(), CoverageSelectionInfo.class);
reader.setCoverageInfo(coverageInfo);
}
}
reader.readDependencies();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.
the class ContinuousDependencyReader method selectResults.
private Set<TestCase> selectResults(final String version) {
try {
final Set<TestCase> tests;
if (dependencyConfig.isGenerateCoverageSelection()) {
LOG.info("Using coverage-based test selection");
ExecutionData executionData = Constants.OBJECTMAPPER.readValue(resultsFolders.getCoverageSelectionFile(), ExecutionData.class);
tests = fetchTestset(version, executionData);
} else {
LOG.info("Using dynamic test selection results");
ExecutionData executionData = Constants.OBJECTMAPPER.readValue(resultsFolders.getTraceTestSelectionFile(), ExecutionData.class);
tests = fetchTestset(version, executionData);
}
return tests;
} catch (IOException e) {
throw new RuntimeException(e);
}
}
use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.
the class CopyFromFull method main.
public static void main(final String[] args) throws JsonParseException, JsonMappingException, IOException, InterruptedException, JAXBException {
final RepoFolders folders = new RepoFolders();
File reexecuteFolder = new File("results/reexecute-validation");
reexecuteFolder.mkdirs();
for (String project : GetValidationExecutionFile.VALIDATION_PROJECTS) {
LOG.info("Analyzing {}", project);
File executionFile = GetValidationExecutionFile.getValidationExecutionFile(project);
final ExecutionData tests = Constants.OBJECTMAPPER.readValue(executionFile, ExecutionData.class);
final File projectFolder = new File(folders.getCleanDataFolder(), project);
File goal = folders.getValidationDataFolder(project);
// mergeAllFiles(tests, projectFolder, goal);
mergeAllFiles(tests, goal, projectFolder);
}
}
use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.
the class FindMissingValidation method main.
public static void main(final String[] args) throws JsonParseException, JsonMappingException, IOException, JAXBException {
final RepoFolders folders = new RepoFolders();
File reexecuteFolder = new File("results/reexecute-validation");
reexecuteFolder.mkdirs();
for (String project : GetValidationExecutionFile.VALIDATION_PROJECTS) {
LOG.info("Analyzing {}", project);
File executionFile = GetValidationExecutionFile.getValidationExecutionFile(project);
ExecutionData tests = Constants.OBJECTMAPPER.readValue(executionFile, ExecutionData.class);
MissingExecutionFinder missingExecutionFinder = new MissingExecutionFinder(project, reexecuteFolder, tests, "commentExec");
missingExecutionFinder.findMissing(new File[] { folders.getValidationDataFolder(project) });
}
}
use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.
the class TestExecutionMerging method mergeWrittenExecutions.
@Test
public void mergeWrittenExecutions() throws JsonGenerationException, JsonMappingException, IOException {
ResultsFolders[] folders = new ResultsFolders[3];
for (int i = 0; i < 3; i++) {
ExecutionData ex1 = createExecutionData(i);
Constants.OBJECTMAPPER.writeValue(new File("target/execute-" + i + ".json"), ex1);
folders[i] = Mockito.mock(ResultsFolders.class);
Mockito.when(folders[i].getTraceTestSelectionFile()).thenReturn(new File("target/execute-" + i + ".json"));
}
ResultsFolders out = new ResultsFolders(new File("target"), "mytest");
ExecutionData merged = PartialDependenciesMerger.mergeExecutions(out, folders);
checkMergedResult(merged);
}
Aggregations