use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.
the class JmhDependencyReaderMultiParamTest method checkChangedVersion.
private void checkChangedVersion(final ResultsFolders resultsFolders) throws IOException, JsonParseException, JsonMappingException {
ExecutionData data = Constants.OBJECTMAPPER.readValue(resultsFolders.getTraceTestSelectionFile(), ExecutionData.class);
TestCase changedBenchmark = new TestCase("de.dagere.peass.ExampleBenchmark#testMethod");
TestSet versionTestSet = data.getVersions().get("000002");
MatcherAssert.assertThat(versionTestSet.getTests(), Matchers.contains(changedBenchmark));
}
use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.
the class DependencyStatisticAnalyzer method call.
@Override
public Void call() throws Exception {
// final File dependenciesFile = new File(args[0]);
if (!dependencyFile.exists()) {
LOG.info("Dependencies-file " + dependencyFile.getAbsolutePath() + " should exist.");
System.exit(1);
}
ExecutionData changedTests;
if (executionFile != null) {
changedTests = Constants.OBJECTMAPPER.readValue(executionFile, ExecutionData.class);
} else {
changedTests = null;
}
final DependencyStatistics statistics = getChangeStatistics(dependencyFile, changedTests);
LOG.info("Versions: {} Bei Pruning ausgeführte Tests: {} Trace-Changed Tests: {}", statistics.size, statistics.pruningRunTests, statistics.changedTraceTests);
LOG.info("Gesamt-Tests: {} Bei Pruning (ggf. mehrmals) genutzte Tests: {} Nur einmal ausgeführte Tests (d.h. keine Veränderung möglich): {}", statistics.overallRunTests, statistics.multipleChangedTest.size(), statistics.onceChangedTests.size());
return null;
}
use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.
the class RegressionTestSelectionSummarizer method getExtendedTable.
private void getExtendedTable(final File folder) throws IOException, JsonParseException, JsonMappingException, JAXBException {
System.out.println("Project;Versions;Normal-Tests;SIC;TIC; Tests once changed; Tests multiple times changed");
for (final File xmlFile : FileUtils.listFiles(folder, new WildcardFileFilter(ResultsFolders.STATIC_SELECTION_PREFIX + "*.json"), TrueFileFilter.INSTANCE)) {
final String projektName = xmlFile.getName().replace(ResultsFolders.STATIC_SELECTION_PREFIX, "").replace(".xml", "");
final File executeFile = new File(xmlFile.getParentFile(), "views_" + projektName + "/execute" + projektName + ".json");
if (xmlFile.exists() && executeFile.exists()) {
final ExecutionData changedTests = Constants.OBJECTMAPPER.readValue(executeFile, ExecutionData.class);
final DependencyStatistics statistics = DependencyStatisticAnalyzer.getChangeStatistics(xmlFile, changedTests);
System.out.println(projektName + ";" + statistics.getSize() + ";" + statistics.getOverallRunTests() + ";" + statistics.getPruningRunTests() + ";" + statistics.getChangedTraceTests() + ";" + statistics.getOnceChangedTests().size() + ";" + statistics.getMultipleChangedTest().size());
}
}
}
use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.
the class PartialDependenciesMerger method mergeExecutionFiles.
private static ExecutionData mergeExecutionFiles(final List<File> executionOutFiles) throws IOException, JsonParseException, JsonMappingException {
List<ExecutionData> executionData = new LinkedList<>();
for (File file : executionOutFiles) {
ExecutionData currentData = Constants.OBJECTMAPPER.readValue(file, ExecutionData.class);
executionData.add(currentData);
}
ExecutionData merged = mergeExecutiondata(executionData);
return merged;
}
use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.
the class VersionProcessor method initVersionProcessor.
protected void initVersionProcessor() throws IOException, JsonParseException, JsonMappingException {
if (executionMixin != null) {
startversion = executionMixin.getStartversion();
endversion = executionMixin.getEndversion();
version = executionMixin.getVersion();
}
if (staticSelectionFile != null) {
staticTestSelection = Constants.OBJECTMAPPER.readValue(staticSelectionFile, StaticTestSelection.class);
VersionComparator.setDependencies(staticTestSelection);
executionData = new ExecutionData(staticTestSelection);
}
if (executionfile != null) {
executionData = Constants.OBJECTMAPPER.readValue(executionfile, ExecutionData.class);
staticTestSelection = new StaticTestSelection(executionData);
}
if (executionData == null && staticTestSelection == null) {
throw new RuntimeException("Dependencyfile and executionfile not readable - one needs to be defined!");
}
if (!projectFolder.exists()) {
GitUtils.downloadProject(staticTestSelection.getUrl(), projectFolder);
}
folders = new PeassFolders(projectFolder);
if (startversion != null || endversion != null) {
LOG.info("Version: " + startversion + " - " + endversion);
}
if (executionMixin.getVersionOld() != null && startversion == null) {
throw new RuntimeException("If versionOld is specified, always specify version!");
}
if (version != null) {
if (startversion != null || endversion != null) {
throw new RuntimeException("Both, version and (startversion or endversion), are defined - define version, or startversion/endversion!");
}
startversion = version;
endversion = version;
LOG.info("Version: " + startversion + " - " + endversion);
}
VersionComparator.setDependencies(staticTestSelection);
vcs = VersionControlSystem.getVersionControlSystem(folders.getProjectFolder());
}
Aggregations