Search in sources :

Example 6 with GitCommit

use of de.dagere.peass.vcs.GitCommit in project peass by DaGeRe.

the class DependencyParallelReader method startPartProcess.

public void startPartProcess(final ResultsFolders currentOutFolders, final ExecutorService service, final int outfileIndex, final PeassFolders foldersTemp) throws InterruptedException {
    final int min = outfileIndex * sizePerThread;
    final int max = Math.min((outfileIndex + 1) * sizePerThread + 1, commits.size());
    LOG.debug("Min: {} Max: {} Size: {}", min, max, commits.size());
    final List<GitCommit> currentCommits = commits.subList(min, max);
    final List<GitCommit> reserveCommits = commits.subList(max - 1, commits.size());
    final GitCommit minimumCommit = commits.get(Math.min(max, commits.size() - 1));
    if (currentCommits.size() > 0) {
        processCommits(currentOutFolders, service, foldersTemp, currentCommits, reserveCommits, minimumCommit);
    }
}
Also used : GitCommit(de.dagere.peass.vcs.GitCommit)

Example 7 with GitCommit

use of de.dagere.peass.vcs.GitCommit in project peass by DaGeRe.

the class TestChangedIterationReading method testChangedIterationReading.

@Test
public void testChangedIterationReading() throws InterruptedException {
    VersionComparator.setVersions(Arrays.asList(new GitCommit("a23e385264c31def8dcda86c3cf64faa698c62d8", null, null, null), new GitCommit("33ce17c04b5218c25c40137d4d09f40fbb3e4f0f", null, null, null)));
    ProjectStatistics statistics = new ProjectStatistics();
    AnalyseFullData afd = new AnalyseFullData(new File("target/changes.json"), statistics, null, new StatisticsConfig());
    afd.analyseFolder(new File(DATA_FOLDER, "measurement_a23e385264c31def8dcda86c3cf64faa698c62d8_33ce17c04b5218c25c40137d4d09f40fbb3e4f0f/measurements"));
    TestcaseStatistic testcaseStatistic = statistics.getStatistics().get("a23e385264c31def8dcda86c3cf64faa698c62d8").get(new TestCase("de.test.CalleeTest#onlyCallMethod2"));
    System.out.println(testcaseStatistic);
    System.out.println(testcaseStatistic.getDeviationCurrent());
    System.out.println(testcaseStatistic.getDeviationOld());
    MatcherAssert.assertThat(testcaseStatistic.getDeviationCurrent(), Matchers.lessThan(800000d));
    MatcherAssert.assertThat(testcaseStatistic.getDeviationOld(), Matchers.lessThan(800000d));
}
Also used : TestcaseStatistic(de.dagere.peass.measurement.statistics.data.TestcaseStatistic) StatisticsConfig(de.dagere.peass.config.StatisticsConfig) GitCommit(de.dagere.peass.vcs.GitCommit) AnalyseFullData(de.dagere.peass.analysis.measurement.AnalyseFullData) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) ProjectStatistics(de.dagere.peass.analysis.measurement.ProjectStatistics) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 8 with GitCommit

use of de.dagere.peass.vcs.GitCommit 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;
}
Also used : VersionIteratorGit(de.dagere.peass.vcs.VersionIteratorGit) GitCommit(de.dagere.peass.vcs.GitCommit) VersionIterator(de.dagere.peass.vcs.VersionIterator)

Example 9 with GitCommit

use of de.dagere.peass.vcs.GitCommit in project peass by DaGeRe.

the class GetValidationExecutionFile method checkVersions.

public static void checkVersions(final ExecutionData changedTests, final ExecutionData selected, final List<GitCommit> commits, final Map<String, String> projectCommits) {
    for (GitCommit commit : commits) {
        boolean contains = Arrays.stream(CHANGE_INDICATORS).anyMatch(commit.getMessage()::contains);
        if (contains && !excluded.contains(commit.getTag())) {
            TestSet versionsTests = changedTests.getVersions().get(commit.getTag());
            if (versionsTests != null) {
                selected.getVersions().put(commit.getTag(), versionsTests);
                projectCommits.put(commit.getTag(), commit.getMessage().trim());
            } else {
                selected.getVersions().put(commit.getTag(), new TestSet());
                projectCommits.put(commit.getTag(), commit.getMessage().trim());
            }
        }
    }
}
Also used : GitCommit(de.dagere.peass.vcs.GitCommit) TestSet(de.dagere.peass.dependency.analysis.data.TestSet)

Example 10 with GitCommit

use of de.dagere.peass.vcs.GitCommit in project peass by DaGeRe.

the class TestContinuousExecutor method initRepo.

private void initRepo() throws ZipException {
    ZipFile file = new ZipFile(new File("src/test/resources/simple-test-1.zip"));
    file.extractAll(DependencyTestConstants.CURRENT.getAbsolutePath());
    VersionComparator.setVersions(Arrays.asList(new GitCommit[] { new GitCommit("33ce17c04b5218c25c40137d4d09f40fbb3e4f0f", null, null, null), new GitCommit("a23e385264c31def8dcda86c3cf64faa698c62d8", null, null, null) }));
}
Also used : ZipFile(net.lingala.zip4j.ZipFile) GitCommit(de.dagere.peass.vcs.GitCommit) File(java.io.File) ZipFile(net.lingala.zip4j.ZipFile)

Aggregations

GitCommit (de.dagere.peass.vcs.GitCommit)20 Test (org.junit.jupiter.api.Test)8 File (java.io.File)7 LinkedList (java.util.LinkedList)7 StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)6 StatisticsConfig (de.dagere.peass.config.StatisticsConfig)3 InitialVersion (de.dagere.peass.dependency.persistence.InitialVersion)3 ProjectChanges (de.dagere.peass.analysis.changes.ProjectChanges)2 ModuleClassMapping (de.dagere.peass.dependency.analysis.ModuleClassMapping)2 VersionIteratorGit (de.dagere.peass.vcs.VersionIteratorGit)2 Test (org.junit.Test)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 Kopemedata (de.dagere.kopeme.generated.Kopemedata)1 TestcaseType (de.dagere.kopeme.generated.TestcaseType)1 Change (de.dagere.peass.analysis.changes.Change)1 AnalyseFullData (de.dagere.peass.analysis.measurement.AnalyseFullData)1 ProjectStatistics (de.dagere.peass.analysis.measurement.ProjectStatistics)1 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)1 ChangeManager (de.dagere.peass.dependency.ChangeManager)1 ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)1