use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.
the class ContinuousDependencyReaderIT method testEmptyVersion.
@Order(3)
@Test
public void testEmptyVersion() throws Exception {
final String prevTag = builder.getTags().get(builder.getTags().size() - 1);
GitUtils.goToTag(prevTag, TestConstants.CURRENT_FOLDER);
String newVersion = builder.addVersion(new File("../dependency/src/test/resources/dependencyIT/only_comment_change"), "test 2");
VersionIteratorGit iterator = new VersionIteratorGit(TestConstants.CURRENT_FOLDER);
ExecutionConfig executionConfig = new ExecutionConfig();
executionConfig.setVersion(newVersion);
executionConfig.setVersionOld(iterator.getPrevious().getTag());
ContinuousDependencyReader reader = new ContinuousDependencyReader(DependencyTestConstants.DEFAULT_CONFIG_WITH_VIEWS, executionConfig, new KiekerConfig(true), new PeassFolders(TestConstants.CURRENT_FOLDER), resultsFolders, new EnvironmentVariables());
RTSResult result = reader.getTests(iterator, "", newVersion, new MeasurementConfig(1));
Set<TestCase> tests = result.getTests();
Assert.assertEquals(tests.size(), 0);
}
use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.
the class ContinuousDependencyReaderIT method testAnotherVersion.
@Order(2)
@Test
public void testAnotherVersion() throws Exception {
final String prevTag = builder.getTags().get(builder.getTags().size() - 1);
GitUtils.goToTag(prevTag, TestConstants.CURRENT_FOLDER);
String newVersion = builder.addVersion(new File("../dependency/src/test/resources/dependencyIT/basic_state"), "test 2");
VersionIteratorGit iterator = new VersionIteratorGit(TestConstants.CURRENT_FOLDER);
ExecutionConfig executionConfig = new ExecutionConfig();
executionConfig.setVersion(newVersion);
executionConfig.setVersionOld(iterator.getPrevious().getTag());
final ContinuousDependencyReader spiedReader = new ContinuousDependencyReader(DependencyTestConstants.DEFAULT_CONFIG_WITH_VIEWS, executionConfig, new KiekerConfig(true), new PeassFolders(TestConstants.CURRENT_FOLDER), resultsFolders, new EnvironmentVariables());
StaticTestSelection dependencies = spiedReader.getDependencies(iterator, "");
final String lastTag = builder.getTags().get(builder.getTags().size() - 1);
checkVersion(dependencies, lastTag, 2);
ExecutionData executions = Constants.OBJECTMAPPER.readValue(resultsFolders.getTraceTestSelectionFile(), ExecutionData.class);
Assert.assertEquals(3, executions.getVersions().size());
}
use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.
the class DependenciesOnlyStartversionIT method testBasicVersionReading.
@Order(1)
@Test
public void testBasicVersionReading() throws Exception {
builder.addVersion(new File("../dependency/src/test/resources/dependencyIT/changed_class"), "test 1");
VersionIteratorGit iterator = new VersionIteratorGit(TestConstants.CURRENT_FOLDER);
iterator.goToFirstCommit();
iterator.goToNextCommit();
ExecutionConfig executionConfig = new ExecutionConfig();
executionConfig.setVersion(iterator.getTag());
executionConfig.setVersionOld(iterator.getPrevious().getTag());
ContinuousDependencyReader reader = new ContinuousDependencyReader(DependencyTestConstants.DEFAULT_CONFIG_NO_VIEWS, executionConfig, new KiekerConfig(true), new PeassFolders(TestConstants.CURRENT_FOLDER), ContinuousDependencyReaderIT.resultsFolders, new EnvironmentVariables());
dependencies = reader.getDependencies(iterator, "");
final String lastTag = builder.getTags().get(builder.getTags().size() - 1);
checkVersion(dependencies, lastTag, 1);
}
use of de.dagere.peass.config.ExecutionConfig 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.ExecutionConfig in project peass by DaGeRe.
the class TraceGeneratorStarter method call.
@Override
public Void call() throws Exception {
StaticTestSelection staticTestSelection = Constants.OBJECTMAPPER.readValue(staticSelectionFile, StaticTestSelection.class);
String newestVersion = staticTestSelection.getNewestVersion();
VersionStaticSelection version = staticTestSelection.getVersions().get(newestVersion);
TestSet tests = version.getTests();
ExecutionConfig executionConfig = executionMixin.getExecutionConfig();
NonIncludedTestRemover.removeNotIncluded(tests, executionConfig);
GitUtils.reset(projectFolder);
PeassFolders folders = new PeassFolders(projectFolder);
KiekerResultManager resultsManager = runTests(newestVersion, tests, folders, executionConfig);
LOG.info("Analyzing tests: {}", tests.getTests());
mapping = new ModuleClassMapping(folders.getProjectFolder(), resultsManager.getExecutor().getModules(), executionConfig);
for (TestCase testcase : tests.getTests()) {
writeTestcase(newestVersion, folders, resultsManager, testcase);
}
return null;
}
Aggregations