use of de.dagere.peass.vcs.GitCommit in project peass by DaGeRe.
the class PropertyReadHelper method getChanges.
private Map<ChangedEntity, ClazzChangeData> getChanges(final PeassFolders folders) {
GitCommit firstCommit = new GitCommit(versionOld, null, null, null);
List<GitCommit> commits = Arrays.asList(new GitCommit[] { new GitCommit(version, null, null, null), firstCommit });
final VersionIteratorGit iterator = new VersionIteratorGit(projectFolder, commits, firstCommit);
final ChangeManager changeManager = new ChangeManager(folders, iterator, config, testExecutor);
final Map<ChangedEntity, ClazzChangeData> changes = changeManager.getChanges(versionOld, version);
return changes;
}
use of de.dagere.peass.vcs.GitCommit in project peass by DaGeRe.
the class TestCleaner method testParameterizedDataCleaner.
@Test
public void testParameterizedDataCleaner() throws IOException, JAXBException {
VersionComparator.setVersions(Arrays.asList(new GitCommit[] { new GitCommit("49f75e8877c2e9b7cf6b56087121a35fdd73ff8b", null, null, null), new GitCommit("a12a0b7f4c162794fca0e7e3fcc6ea3b3a2cbc2b", null, null, null) }));
File measurementsFolder = new File("src/test/resources/cleaning/measurementsFull");
File goalFolder = new File("target/test/cleaned");
if (goalFolder.exists()) {
FileUtils.deleteDirectory(goalFolder);
}
goalFolder.mkdirs();
Cleaner cleaner = new Cleaner(goalFolder);
cleaner.processDataFolder(measurementsFolder);
File expectedCleanedFolder_1 = new File(goalFolder, "ExampleTest_test(JUNIT_PARAMETERIZED-0).xml");
MatcherAssert.assertThat(expectedCleanedFolder_1, FileMatchers.anExistingFile());
Kopemedata data = XMLDataLoader.loadData(expectedCleanedFolder_1);
TestcaseType testcase1 = data.getTestcases().getTestcase().get(0);
Assert.assertEquals("test", testcase1.getName());
Assert.assertEquals(testcase1.getDatacollector().get(0).getChunk().get(0).getResult().size(), 10);
File expectedCleanedFolder_2 = new File(goalFolder, "ExampleTest_test(JUNIT_PARAMETERIZED-1).xml");
MatcherAssert.assertThat(expectedCleanedFolder_2, FileMatchers.anExistingFile());
}
use of de.dagere.peass.vcs.GitCommit in project peass by DaGeRe.
the class DependencyIteratorBuilder method getOldVersionCommit.
private static GitCommit getOldVersionCommit(final ExecutionConfig executionConfig, final String newestRunningVersionName, final PeassFolders folders) {
String oldVersion;
if (executionConfig.getVersionOld() != null) {
oldVersion = executionConfig.getVersionOld();
} else if (newestRunningVersionName != null) {
oldVersion = newestRunningVersionName;
} else {
oldVersion = GitUtils.getName("HEAD~1", folders.getProjectFolder());
}
GitCommit oldVersionCommit = new GitCommit(oldVersion, "", "", "");
return oldVersionCommit;
}
use of de.dagere.peass.vcs.GitCommit in project peass by DaGeRe.
the class GetValidationExecutionFile method getProjectValidationExecution.
public static void getProjectValidationExecution(final RepoFolders folders, final File projectsFolder, final String project, final Map<String, Map<String, String>> projectsCommits) throws JsonParseException, JsonMappingException, IOException, JsonGenerationException {
final ExecutionData changedTests = folders.getExecutionData(project);
final ExecutionData selected = new ExecutionData();
selected.setAndroid(changedTests.isAndroid());
selected.setUrl(changedTests.getUrl());
File projectFolder = new File(projectsFolder, project);
List<GitCommit> commits = GitUtils.getCommits(projectFolder, false);
VersionComparator.setVersions(commits);
Map<String, String> projectCommits = new LinkedHashMap<>();
projectsCommits.put(project, projectCommits);
checkVersions(changedTests, selected, commits, projectCommits);
File dest = getValidationExecutionFile(project);
Constants.OBJECTMAPPER.writeValue(dest, selected);
}
use of de.dagere.peass.vcs.GitCommit in project peass by DaGeRe.
the class OnlyMerge method call.
@Override
public Void call() throws Exception {
final File projectFolder = config.getProjectFolder();
final List<GitCommit> commits = CommitUtil.getGitCommits(executionConfigMixin.getStartversion(), executionConfigMixin.getEndversion(), projectFolder);
VersionComparator.setVersions(commits);
final File[] files = config.getResultBaseFolder().listFiles((FilenameFilter) new WildcardFileFilter("deps*.json"));
PartialDependenciesMerger.mergeVersions(new File(config.getResultBaseFolder(), "merged.json"), files);
return null;
}
Aggregations