use of de.dagere.peass.dependency.reader.VersionKeeper 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.VersionKeeper in project peass by DaGeRe.
the class DependencyViewGeneratorTest method testTwoVersions.
@Test
public void testTwoVersions() throws Exception {
try (MockedStatic<GitUtils> gitUtilsMock = Mockito.mockStatic(GitUtils.class)) {
FakeGitUtil.prepareGitUtils(gitUtilsMock);
DependencyDetectorTestUtil.init(TraceGettingIT.BASIC);
ResultsFolders resultsFolders = new ResultsFolders(TraceGettingIT.VIEW_IT_PROJECTFOLDER, "test");
TestSelectionConfig dependencyConfig = new TestSelectionConfig(1, false, true, false);
FakeFileIterator iteratorspied = mockIterator();
DependencyReader reader = new DependencyReader(dependencyConfig, new PeassFolders(TestConstants.CURRENT_FOLDER), resultsFolders, "", iteratorspied, new VersionKeeper(new File("/dev/null")), new ExecutionConfig(), new KiekerConfig(true), new EnvironmentVariables());
reader.readInitialVersion();
try {
reader.readDependencies();
} catch (Throwable t) {
System.out.println();
for (StackTraceElement te : t.getStackTrace()) {
System.out.println(te);
}
System.out.println();
throw t;
}
File expectedDiff = new File(resultsFolders.getVersionDiffFolder("000002"), "TestMe#test.txt");
System.out.println(expectedDiff.getAbsolutePath());
Assert.assertTrue(expectedDiff.exists());
// TODO Test, that instrumentation sources are not added to the view
final ExecutionData tests = Constants.OBJECTMAPPER.readValue(resultsFolders.getTraceTestSelectionFile(), ExecutionData.class);
//
Assert.assertEquals(2, tests.getVersions().size());
Assert.assertEquals(1, tests.getVersions().get("000002").getTests().size());
}
}
Aggregations