use of de.dagere.peass.dependency.reader.DependencyReader in project peass by DaGeRe.
the class RegressionTestSelectionContinueStarter method call.
@Override
public Void call() throws Exception {
final File projectFolder = config.getProjectFolder();
if (!projectFolder.exists()) {
throw new RuntimeException("Folder " + projectFolder.getAbsolutePath() + " does not exist.");
}
final File dependencyFileIn = getDependencyInFile();
final StaticTestSelection dependencies = Constants.OBJECTMAPPER.readValue(dependencyFileIn, StaticTestSelection.class);
VersionComparator.setVersions(GitUtils.getCommits(projectFolder, false));
String previousVersion = getPreviousVersion(executionConfigMixin.getStartversion(), projectFolder, dependencies);
final int timeout = executionConfigMixin.getTimeout();
LOG.debug("Lese {}", projectFolder.getAbsolutePath());
final VersionControlSystem vcs = VersionControlSystem.getVersionControlSystem(projectFolder);
ResultsFolders resultsFolders = new ResultsFolders(config.getResultBaseFolder(), config.getProjectFolder().getName() + "_out");
final DependencyReader reader = createReader(config, resultsFolders, dependencies, previousVersion, timeout, vcs);
reader.readCompletedVersions(dependencies);
reader.readDependencies();
return null;
}
use of de.dagere.peass.dependency.reader.DependencyReader in project peass by DaGeRe.
the class RegressionTestSelectionContinueStarter method createReader.
DependencyReader createReader(final TestSelectionConfigMixin config, final ResultsFolders resultsFolders, final StaticTestSelection dependencies, final String previousVersion, final int timeout, final VersionControlSystem vcs) {
final DependencyReader reader;
if (vcs.equals(VersionControlSystem.GIT)) {
final VersionIterator iterator = createIterator(config, previousVersion);
ExecutionConfig executionConfig = executionConfigMixin.getExecutionConfig();
reader = new DependencyReader(config.getDependencyConfig(), new PeassFolders(config.getProjectFolder()), resultsFolders, dependencies.getUrl(), iterator, new VersionKeeper(new File(resultsFolders.getStaticTestSelectionFile().getParentFile(), "nochanges.json")), executionConfig, kiekerConfigMixin.getKiekerConfig(), new EnvironmentVariables());
iterator.goTo0thCommit();
} else if (vcs.equals(VersionControlSystem.SVN)) {
throw new RuntimeException("SVN not supported currently.");
} else {
throw new RuntimeException("Unknown version control system");
}
return reader;
}
use of de.dagere.peass.dependency.reader.DependencyReader in project peass by DaGeRe.
the class DependencyDetectorIT method testTestChange.
@Test
public void testTestChange() throws Exception {
final File secondVersion = new File(DependencyTestConstants.VERSIONS_FOLDER, "changed_test");
final Map<ChangedEntity, ClazzChangeData> changes = new TreeMap<>();
DependencyDetectorTestUtil.addChange(changes, "", "defaultpackage.TestMe", "testMe");
final ChangeManager changeManager = Mockito.mock(ChangeManager.class);
Mockito.when(changeManager.getChanges(Mockito.any())).thenReturn(changes);
final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(secondVersion));
final DependencyReader reader = DependencyDetectorTestUtil.readTwoVersions(changeManager, fakeIterator);
System.out.println(reader.getDependencies().getVersions().get(DependencyTestConstants.VERSION_1));
DependencyDetectorTestUtil.checkTestMeAlsoTestChange(reader, "defaultpackage.TestMe#testMe", "defaultpackage.TestMe", DependencyTestConstants.VERSION_1);
}
use of de.dagere.peass.dependency.reader.DependencyReader in project peass by DaGeRe.
the class DependencyDetectorIT method testNoChange.
@Test
public void testNoChange() throws Exception {
final Map<ChangedEntity, ClazzChangeData> changes = new HashMap<>();
final ChangeManager changeManager = Mockito.mock(ChangeManager.class);
Mockito.when(changeManager.getChanges(Mockito.any())).thenReturn(changes);
final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(DependencyTestConstants.BASIC_STATE));
final DependencyReader reader = DependencyDetectorTestUtil.readTwoVersions(changeManager, fakeIterator);
StaticTestSelection dependencies = reader.getDependencies();
System.out.println(dependencies.getVersions());
Assert.assertTrue(dependencies.getVersions().get(dependencies.getNewestVersion()).isRunning());
// DependencyDetectorTestUtil.checkTestMeAlsoTestChange(reader, "defaultpackage.NormalDependency#executeThing", "defaultpackage.TestMe", DependencyTestConstants.VERSION_1);
}
use of de.dagere.peass.dependency.reader.DependencyReader in project peass by DaGeRe.
the class DependencyDetectorIT method testNormalChange.
@Test
public void testNormalChange() throws Exception {
final ChangeManager changeManager = DependencyDetectorTestUtil.defaultChangeManager();
final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(DependencyTestConstants.NORMAL_CHANGE));
final DependencyReader reader = DependencyDetectorTestUtil.readTwoVersions(changeManager, fakeIterator);
System.out.println(reader.getDependencies());
DependencyDetectorTestUtil.checkTestMeAlsoTestChange(reader, "defaultpackage.NormalDependency#executeThing", "defaultpackage.TestMe", DependencyTestConstants.VERSION_1);
}
Aggregations