use of de.dagere.peass.vcs.VersionIterator in project peass by DaGeRe.
the class RegressionTestSelectionContinueStarter method createIterator.
private VersionIterator createIterator(final TestSelectionConfigMixin config, final String previousVersion) {
final List<GitCommit> commits = CommitUtil.getGitCommits(executionConfigMixin.getStartversion(), executionConfigMixin.getEndversion(), config.getProjectFolder());
commits.add(0, new GitCommit(previousVersion, "", "", ""));
final GitCommit previous = new GitCommit(previousVersion, "", "", "");
final VersionIterator iterator = new VersionIteratorGit(config.getProjectFolder(), commits, previous);
return iterator;
}
use of de.dagere.peass.vcs.VersionIterator 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.vcs.VersionIterator 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.vcs.VersionIterator 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.vcs.VersionIterator 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