use of de.dagere.peass.vcs.VersionControlSystem 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.vcs.VersionControlSystem in project peass by DaGeRe.
the class TestDependencyTester method testFiles.
@Test
public void testFiles() throws Exception {
try (MockedStatic<VersionControlSystem> mockedVCS = Mockito.mockStatic(VersionControlSystem.class);
MockedStatic<ExecutorCreator> mockedExecutor = Mockito.mockStatic(ExecutorCreator.class);
MockedStatic<GitUtils> utils = Mockito.mockStatic(GitUtils.class)) {
VCSTestUtils.mockGetVCS(mockedVCS);
final PeassFolders folders = new PeassFolders(folder.getRoot());
final MeasurementConfig configuration = new MeasurementConfig(4, "2", "1");
VCSTestUtils.mockExecutor(mockedExecutor, folders, configuration);
final DependencyTester tester = new DependencyTester(folders, configuration, new EnvironmentVariables());
tester.evaluate(EXAMPLE_TESTCASE);
checkResult(folders);
}
}
use of de.dagere.peass.vcs.VersionControlSystem in project peass by DaGeRe.
the class AdaptiveTesterTest method testIterationUpdate.
@Test
public void testIterationUpdate() throws IOException, InterruptedException, JAXBException, XmlPullParserException {
try (MockedStatic<VersionControlSystem> mockedVCS = Mockito.mockStatic(VersionControlSystem.class);
MockedStatic<ExecutorCreator> mockedExecutor = Mockito.mockStatic(ExecutorCreator.class)) {
VCSTestUtils.mockGetVCS(mockedVCS);
VCSTestUtils.mockExecutor(mockedExecutor);
final int vms = 10;
final MeasurementConfig config = new MeasurementConfig(vms, "A", "B");
config.setIterations(1000);
MeasurementConfig config2 = Mockito.spy(config);
Mockito.when(testGenerator.getConfig()).thenReturn(config2);
AdaptiveTester tester2 = prepareTester();
Mockito.doReturn(false).when(tester2).checkIsDecidable(Mockito.eq(testcase), Mockito.anyInt());
for (int i = 0; i < vms; i++) {
final Result result1 = new Result();
result1.setValue(15);
result1.setIterations(40);
Mockito.doReturn(result1).when(tester2).getLastResult("A", testcase, i);
final Result result2 = new Result();
result2.setValue(17);
result2.setIterations(40);
Mockito.doReturn(result2).when(tester2).getLastResult("B", testcase, i);
}
tester2.evaluate(testcase);
Assert.assertEquals(vms, tester2.getFinishedVMs());
Mockito.verify(config2).setIterations(38);
}
}
use of de.dagere.peass.vcs.VersionControlSystem in project peass by DaGeRe.
the class CauseSearcherIT method testSlowerState.
@Test
public void testSlowerState() throws InterruptedException, IOException, IllegalStateException, XmlPullParserException, AnalysisConfigurationException, ViewNotFoundException, JAXBException {
try (MockedStatic<VersionControlSystem> mockedVCS = Mockito.mockStatic(VersionControlSystem.class);
MockedStatic<GitUtils> mockedGitUtils = Mockito.mockStatic(GitUtils.class)) {
mockEnvironment(mockedVCS, mockedGitUtils);
final MeasurementConfig measurementConfiguration = new MeasurementConfig(5, VERSION, "000001~1");
measurementConfiguration.setUseKieker(true);
final CauseSearcherConfig causeSearcherConfig = CAUSE_CONFIG_TESTME_COMPLETE;
final CauseSearchFolders folders = new CauseSearchFolders(DependencyTestConstants.CURRENT);
final BothTreeReader reader = new BothTreeReader(causeSearcherConfig, measurementConfiguration, folders, new EnvironmentVariables());
EnvironmentVariables emptyEnv = new EnvironmentVariables();
final CauseTester measurer = new CauseTester(folders, measurementConfiguration, causeSearcherConfig, emptyEnv);
final CauseSearcher searcher = new CauseSearcherComplete(reader, causeSearcherConfig, measurer, measurementConfiguration, folders, emptyEnv);
final Set<ChangedEntity> changedEntities = searcher.search();
checkChangelistContainsChild12(changedEntities);
File expectedResultLogFolder = folders.getExistingRCALogFolder(VERSION, TESTCASE, 0);
File expectedResultLogFile = new File(expectedResultLogFolder, "vm_0_" + VERSION);
Assert.assertTrue("File " + expectedResultLogFolder.getAbsolutePath() + " does not exist ", expectedResultLogFolder.exists());
Assert.assertTrue("File " + expectedResultLogFile.getAbsolutePath() + " does not exist ", expectedResultLogFile.exists());
}
}
Aggregations