use of de.dagere.peass.dependency.traces.coverage.CoverageSelectionInfo 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.traces.coverage.CoverageSelectionInfo in project peass-ci-plugin by jenkinsci.
the class RTSVisualizationCreator method readCoverageSelection.
private CoverageSelectionVersion readCoverageSelection(final Run<?, ?> run) throws IOException, JsonParseException, JsonMappingException {
File coverageInfoFile = localWorkspace.getCoverageInfoFile();
if (coverageInfoFile.exists()) {
LOG.info("Reading {}", coverageInfoFile);
CoverageSelectionInfo executions = Constants.OBJECTMAPPER.readValue(coverageInfoFile, CoverageSelectionInfo.class);
CoverageSelectionVersion currentVersion = executions.getVersions().get(peassConfig.getMeasurementConfig().getExecutionConfig().getVersion());
return currentVersion;
} else {
LOG.info("File {} was not found, RTS coverage based selection info might be incomplete", coverageInfoFile.getAbsoluteFile());
}
return null;
}
use of de.dagere.peass.dependency.traces.coverage.CoverageSelectionInfo in project peass by DaGeRe.
the class TestTestcaseSerialization method testNoParamSerialization.
@Test
public void testNoParamSerialization() throws JsonProcessingException {
CoverageSelectionInfo info = new CoverageSelectionInfo();
CoverageSelectionVersion version = new CoverageSelectionVersion();
TestCase test = new TestCase("ClazzA", "methodA2", "moduleA");
TraceCallSummary traceCallSummary = new TraceCallSummary();
traceCallSummary.addCall("app" + ChangedEntity.MODULE_SEPARATOR + "ClazzB" + ChangedEntity.METHOD_SEPARATOR + "methodB");
traceCallSummary.setTestcase(test);
version.getTestcases().put(test, traceCallSummary);
info.getVersions().put("000001", version);
String serialized = Constants.OBJECTMAPPER.writeValueAsString(info);
System.out.println(serialized);
CoverageSelectionInfo deserialized = Constants.OBJECTMAPPER.readValue(serialized, CoverageSelectionInfo.class);
TestCase deserializedTest = deserialized.getVersions().get("000001").getTestcases().keySet().iterator().next();
Assert.assertEquals("ClazzA", deserializedTest.getClazz());
Assert.assertEquals("methodA2", deserializedTest.getMethod());
Assert.assertEquals("moduleA", deserializedTest.getModule());
Assert.assertNull(deserializedTest.getParams());
}
use of de.dagere.peass.dependency.traces.coverage.CoverageSelectionInfo in project peass by DaGeRe.
the class TestTestcaseSerialization method testSerialization.
@Test
public void testSerialization() throws JsonProcessingException {
CoverageSelectionInfo info = new CoverageSelectionInfo();
CoverageSelectionVersion version = new CoverageSelectionVersion();
TestCase test = new TestCase("ClazzA", "methodA2", "moduleA", "int,String");
TraceCallSummary traceCallSummary = new TraceCallSummary();
traceCallSummary.addCall("app" + ChangedEntity.MODULE_SEPARATOR + "ClazzB" + ChangedEntity.METHOD_SEPARATOR + "methodB(double)");
traceCallSummary.setTestcase(test);
version.getTestcases().put(test, traceCallSummary);
info.getVersions().put("000001", version);
String serialized = Constants.OBJECTMAPPER.writeValueAsString(info);
System.out.println(serialized);
CoverageSelectionInfo deserialized = Constants.OBJECTMAPPER.readValue(serialized, CoverageSelectionInfo.class);
TestCase deserializedTest = deserialized.getVersions().get("000001").getTestcases().keySet().iterator().next();
Assert.assertEquals("ClazzA", deserializedTest.getClazz());
Assert.assertEquals("methodA2", deserializedTest.getMethod());
Assert.assertEquals("moduleA", deserializedTest.getModule());
Assert.assertEquals("int,String", deserializedTest.getParams());
}
Aggregations