use of de.dagere.peass.config.KiekerConfig in project peass by DaGeRe.
the class DependencyDetectorMultimoduleIT method testNormalChange.
// This test is disabled since it takes too long and nearly tests the same as testTwoChanges; however, since it enables easier debugging, it is left in the code
@Disabled
@Test
public void testNormalChange() throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException {
final File secondVersion = new File(VERSIONS_FOLDER, "normal_change");
final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(secondVersion));
final Map<ChangedEntity, ClazzChangeData> changes = DependencyDetectorTestUtil.buildChanges("base-module", "de.dagere.base.BaseChangeable", "doSomething");
ChangeManager changeManager = Mockito.mock(ChangeManager.class);
Mockito.when(changeManager.getChanges(Mockito.any())).thenReturn(changes);
final DependencyReader reader = new DependencyReader(DependencyTestConstants.DEFAULT_CONFIG_NO_VIEWS, new PeassFolders(DependencyTestConstants.CURRENT), DependencyTestConstants.NULL_RESULTS_FOLDERS, null, fakeIterator, changeManager, new ExecutionConfig(5), new KiekerConfig(true), new EnvironmentVariables());
final boolean success = reader.readInitialVersion();
Assert.assertTrue(success);
StaticTestSelection dependencies = reader.getDependencies();
checkInitialVersion(dependencies);
fakeIterator.goToNextCommit();
reader.analyseVersion(changeManager);
testFirstChange(dependencies);
}
use of de.dagere.peass.config.KiekerConfig in project peass by DaGeRe.
the class DependencyDetectorOneCallWriterIT method readTwoVersions.
public static DependencyReader readTwoVersions(final ChangeManager changeManager, final VersionIterator fakeIterator, final ExecutionConfig config, final TestSelectionConfig dependencyConfig, final ResultsFolders resultsFolders) {
try {
KiekerConfig kiekerConfig = new KiekerConfig(true);
kiekerConfig.setOnlyOneCallRecording(true);
kiekerConfig.setUseSourceInstrumentation(false);
final DependencyReader reader = new DependencyReader(dependencyConfig, new PeassFolders(DependencyTestConstants.CURRENT), resultsFolders, null, fakeIterator, changeManager, config, kiekerConfig, new EnvironmentVariables());
boolean success = reader.readInitialVersion();
Assert.assertTrue(success);
fakeIterator.goToNextCommit();
reader.analyseVersion(changeManager);
return reader;
} catch (IOException | InterruptedException | XmlPullParserException | ParseException | ViewNotFoundException e) {
throw new RuntimeException(e);
}
}
use of de.dagere.peass.config.KiekerConfig in project peass by DaGeRe.
the class TraceGeneratorStarter method writeTestcase.
private void writeTestcase(final String newestVersion, final PeassFolders folders, final KiekerResultManager resultsManager, final TestCase testcase) throws FileNotFoundException, IOException, XmlPullParserException, ViewNotFoundException {
final File moduleResultFolder = KiekerFolderUtil.getModuleResultFolder(folders, testcase);
final File kiekerResultFolder = KiekerFolderUtil.getClazzMethodFolder(testcase, moduleResultFolder)[0];
final long size = FileUtils.sizeOfDirectory(kiekerResultFolder);
final long sizeInMB = size / (1024 * 1024);
if (sizeInMB < 100) {
LOG.debug("Writing " + testcase);
final List<TraceElement> shortTrace = new CalledMethodLoader(kiekerResultFolder, mapping, new KiekerConfig()).getShortTrace("");
writeTrace(newestVersion, testcase, shortTrace);
} else {
LOG.info("Not writing " + testcase + " since size is " + sizeInMB + " mb");
}
}
use of de.dagere.peass.config.KiekerConfig in project peass by DaGeRe.
the class TraceGeneratorStarter method runTests.
private KiekerResultManager runTests(final String newestVersion, final TestSet tests, final PeassFolders folders, final ExecutionConfig executionConfig) throws IOException, XmlPullParserException, InterruptedException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
KiekerResultManager resultsManager = new KiekerResultManager(folders, executionConfig, new KiekerConfig(true), new EnvironmentVariables());
resultsManager.executeKoPeMeKiekerRun(tests, newestVersion, folders.getDependencyLogFolder());
return resultsManager;
}
use of de.dagere.peass.config.KiekerConfig in project peass by DaGeRe.
the class DependencyDetectorTestUtil method readTwoVersions.
public static DependencyReader readTwoVersions(final ChangeManager changeManager, final VersionIterator fakeIterator, final ExecutionConfig config, final TestSelectionConfig dependencyConfig, final ResultsFolders resultsFolders) {
try {
final DependencyReader reader = new DependencyReader(dependencyConfig, new PeassFolders(DependencyTestConstants.CURRENT), resultsFolders, null, fakeIterator, changeManager, config, new KiekerConfig(true), new EnvironmentVariables());
boolean success = reader.readInitialVersion();
Assert.assertTrue(success);
fakeIterator.goToNextCommit();
reader.analyseVersion(changeManager);
return reader;
} catch (IOException | InterruptedException | XmlPullParserException | ParseException | ViewNotFoundException e) {
throw new RuntimeException(e);
}
}
Aggregations