Search in sources :

Example 26 with IgnoredFiles

use of com.thoughtworks.go.config.materials.IgnoredFiles in project gocd by gocd.

the class AutoTriggerDependencyResolutionTest method shouldNotTriggerPipelineWhenOnlyValidChangesAreIgnoredFiles_WhenFaninOff.

@Test
public void shouldNotTriggerPipelineWhenOnlyValidChangesAreIgnoredFiles_WhenFaninOff() throws Exception {
    // p1  <- SVN
    // |    /
    // v   v
    // p2 <- git (BL)
    SystemEnvironment env = mock(SystemEnvironment.class);
    when(env.enforceRevisionCompatibilityWithUpstream()).thenReturn(false);
    SvnMaterial svn = u.wf(new SvnMaterial("url", "username", "password", false), "folder1");
    u.checkinInOrder(svn, "s1", "s2");
    GitMaterial git = u.wf(new GitMaterial("git"), "folder2");
    git.setFilter(new Filter(new IgnoredFiles("ignored.txt")));
    u.checkinInOrder(git, "g1");
    u.checkinFile(git, "g2", new File("ignored.txt"), ModifiedAction.modified);
    ScheduleTestUtil.AddedPipeline p1 = u.saveConfigWith("p1", u.m(svn));
    ScheduleTestUtil.AddedPipeline p2 = u.saveConfigWith("p2", u.m(p1), u.m(svn), u.m(git));
    String p1_1 = u.runAndPass(p1, "s1");
    String p2_1 = u.runAndPass(p2, p1_1, "s1", "g1");
    MaterialRevisions given = u.mrs(new MaterialRevision[] { u.mr(p1, false, p1_1), u.mr(svn, true, "s2"), u.mr(git, true, "g2") });
    MaterialRevisions previousRevisions = u.mrs(new MaterialRevision[] { u.mr(p1, false, p1_1), u.mr(svn, true, "s1"), u.mr(git, true, "g1") });
    AutoBuild autoBuild = new AutoBuild(goConfigService, pipelineService, p2.config.name().toString(), env, materialChecker);
    pipelineTimeline.update();
    BuildCause buildCause = autoBuild.onModifications(given, false, previousRevisions);
    assertThat(buildCause, is(nullValue()));
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) GitMaterial(com.thoughtworks.go.config.materials.git.GitMaterial) Filter(com.thoughtworks.go.config.materials.Filter) MaterialRevisions(com.thoughtworks.go.domain.MaterialRevisions) SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) IgnoredFiles(com.thoughtworks.go.config.materials.IgnoredFiles) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString) File(java.io.File) BuildCause(com.thoughtworks.go.domain.buildcause.BuildCause) Test(org.junit.Test)

Aggregations

Filter (com.thoughtworks.go.config.materials.Filter)26 IgnoredFiles (com.thoughtworks.go.config.materials.IgnoredFiles)26 Test (org.junit.Test)24 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)10 GitMaterialConfig (com.thoughtworks.go.config.materials.git.GitMaterialConfig)6 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)6 DependencyMaterialRevision (com.thoughtworks.go.domain.materials.dependency.DependencyMaterialRevision)6 PluggableSCMMaterialConfig (com.thoughtworks.go.config.materials.PluggableSCMMaterialConfig)5 DependencyMaterialConfig (com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig)5 P4MaterialConfig (com.thoughtworks.go.config.materials.perforce.P4MaterialConfig)5 SvnMaterialConfig (com.thoughtworks.go.config.materials.svn.SvnMaterialConfig)5 HashMap (java.util.HashMap)5 PackageMaterialConfig (com.thoughtworks.go.config.materials.PackageMaterialConfig)4 HgMaterialConfig (com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig)4 TfsMaterialConfig (com.thoughtworks.go.config.materials.tfs.TfsMaterialConfig)4 BuildCause (com.thoughtworks.go.domain.buildcause.BuildCause)4 MaterialConfig (com.thoughtworks.go.domain.materials.MaterialConfig)4 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)4 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)3 GitMaterial (com.thoughtworks.go.config.materials.git.GitMaterial)3