Search in sources :

Example 21 with ExecutionConfig

use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.

the class TestGetModules method testOtherPlUsing.

@Test
public void testOtherPlUsing() {
    File pomFile = new File("src/test/resources/maven-multimodule-pl-example/basic_state/pom.xml");
    ExecutionConfig config = new ExecutionConfig();
    config.setPl("using-module");
    ProjectModules modules = MavenPomUtil.getModules(pomFile, config);
    Assert.assertEquals(4, modules.getModules().size());
}
Also used : ProjectModules(de.dagere.peass.execution.utils.ProjectModules) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 22 with ExecutionConfig

use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.

the class TestGetModules method testPeassItself.

@Test
public void testPeassItself() {
    File pomFile = new File("../pom.xml");
    ProjectModules modules = MavenPomUtil.getModules(pomFile, new ExecutionConfig());
    Assert.assertEquals(3, modules.getModules().size());
}
Also used : ProjectModules(de.dagere.peass.execution.utils.ProjectModules) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 23 with ExecutionConfig

use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.

the class DependenciesOnlyStartversionIT method cleanDependencies.

@BeforeEach
public void cleanDependencies() throws Exception {
    FileUtils.deleteDirectory(ContinuousDependencyReaderIT.resultsFolders.getStaticTestSelectionFile().getParentFile());
    Assert.assertFalse(ContinuousDependencyReaderIT.resultsFolders.getStaticTestSelectionFile().exists());
    FileUtils.deleteDirectory(TestConstants.CURRENT_FOLDER);
    builder = new GitProjectBuilder(TestConstants.CURRENT_FOLDER, new File("../dependency/src/test/resources/dependencyIT/basic_state"));
    VersionIteratorGit iterator = new VersionIteratorGit(TestConstants.CURRENT_FOLDER);
    iterator.goToFirstCommit();
    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, "");
    Assert.assertEquals(0, dependencies.getVersions().size());
}
Also used : VersionIteratorGit(de.dagere.peass.vcs.VersionIteratorGit) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) GitProjectBuilder(de.dagere.peass.ci.helper.GitProjectBuilder) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) KiekerConfig(de.dagere.peass.config.KiekerConfig) PeassFolders(de.dagere.peass.folders.PeassFolders) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 24 with ExecutionConfig

use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.

the class TestContinuousDependencyReader method testNoChangeHappened.

@Test
public void testNoChangeHappened() throws JsonGenerationException, JsonMappingException, IOException {
    ResultsFolders resultsFolders = new ResultsFolders(new File("target/current_results"), "current");
    StaticTestSelection value = new StaticTestSelection();
    value.setInitialversion(new InitialVersion());
    value.getVersions().put("A", new VersionStaticSelection());
    Constants.OBJECTMAPPER.writeValue(resultsFolders.getStaticTestSelectionFile(), value);
    ContinuousDependencyReader reader = new ContinuousDependencyReader(new TestSelectionConfig(1, false), new ExecutionConfig(), new KiekerConfig(), new PeassFolders(new File("target/current")), resultsFolders, new EnvironmentVariables());
    reader.getDependencies(null, "git:dummyUrl");
}
Also used : TestSelectionConfig(de.dagere.peass.config.TestSelectionConfig) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) InitialVersion(de.dagere.peass.dependency.persistence.InitialVersion) VersionStaticSelection(de.dagere.peass.dependency.persistence.VersionStaticSelection) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) ResultsFolders(de.dagere.peass.folders.ResultsFolders) File(java.io.File) KiekerConfig(de.dagere.peass.config.KiekerConfig) StaticTestSelection(de.dagere.peass.dependency.persistence.StaticTestSelection) PeassFolders(de.dagere.peass.folders.PeassFolders) Test(org.junit.jupiter.api.Test)

Example 25 with ExecutionConfig

use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.

the class TestDependencyIteratorBuilder method testNightlyBuildIteratorCreation.

@Test
public void testNightlyBuildIteratorCreation() {
    try (MockedStatic<GitUtils> gitUtil = Mockito.mockStatic(GitUtils.class)) {
        gitUtil.when(() -> GitUtils.getName(Mockito.any(), Mockito.any())).thenReturn(VERSION_2);
        ExecutionConfig config = new ExecutionConfig();
        config.setVersionOld(null);
        config.setVersion("HEAD");
        StaticTestSelection dependencies = buildVersionDependencies(LAST_RUNNING_VERSION);
        VersionIteratorGit iterator = new DependencyIteratorBuilder(config, dependencies, new PeassFolders(TEMPORARY_FOLDER)).getIterator();
        Assert.assertEquals(2, iterator.getSize());
        Assert.assertEquals(VERSION_2, iterator.getTag());
        Assert.assertEquals(LAST_RUNNING_VERSION, iterator.getPredecessor());
    }
}
Also used : VersionIteratorGit(de.dagere.peass.vcs.VersionIteratorGit) GitUtils(de.dagere.peass.vcs.GitUtils) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) StaticTestSelection(de.dagere.peass.dependency.persistence.StaticTestSelection) PeassFolders(de.dagere.peass.folders.PeassFolders) Test(org.junit.jupiter.api.Test)

Aggregations

ExecutionConfig (de.dagere.peass.config.ExecutionConfig)74 Test (org.junit.jupiter.api.Test)49 File (java.io.File)40 PeassFolders (de.dagere.peass.folders.PeassFolders)29 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)23 KiekerConfig (de.dagere.peass.config.KiekerConfig)21 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)20 ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)14 StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)14 FakeFileIterator (de.dagere.peass.dependencytests.helper.FakeFileIterator)13 TestSet (de.dagere.peass.dependency.analysis.data.TestSet)12 ProjectModules (de.dagere.peass.execution.utils.ProjectModules)12 DependencyReader (de.dagere.peass.dependency.reader.DependencyReader)11 VersionIteratorGit (de.dagere.peass.vcs.VersionIteratorGit)11 GitUtils (de.dagere.peass.vcs.GitUtils)10 ResultsFolders (de.dagere.peass.folders.ResultsFolders)9 ModuleClassMapping (de.dagere.peass.dependency.analysis.ModuleClassMapping)7 VersionIterator (de.dagere.peass.vcs.VersionIterator)7 HashSet (java.util.HashSet)7 ChangeManager (de.dagere.peass.dependency.ChangeManager)6