Skip to content
Permalink
Browse files

Test polling of parent of HEAD commit with and without workspace

More testing of JENKINS-29066
  • Loading branch information...
MarkEWaite authored and ndeloof committed Jun 26, 2015
1 parent e5c75f1 commit 06dc97fb8264d85aa45b9c2f880e6bfe74f03c20
Showing with 19 additions and 2 deletions.
  1. +19 −2 src/test/java/hudson/plugins/git/GitSCMTest.java
@@ -1429,28 +1429,45 @@ public void testPolling_environmentValueInBranchSpec() throws Exception {
}

@Issue("JENKINS-29066")
public void testPolling_parentHead() throws Exception {
public void baseTestPolling_parentHead(List<GitSCMExtension> extensions) throws Exception {
// create parameterized project with environment value in branch specification
FreeStyleProject project = createFreeStyleProject();
GitSCM scm = new GitSCM(
createRemoteRepositories(),
Collections.singletonList(new BranchSpec("**")),
false, Collections.<SubmoduleConfig>emptyList(),
null, null,
Collections.<GitSCMExtension>emptyList());
extensions);
project.setScm(scm);

// commit something in order to create an initial base version in git
commit("toto/commitFile1", johnDoe, "Commit number 1");
git.branch("someBranch");
commit("toto/commitFile2", johnDoe, "Commit number 2");

assertTrue("polling should detect changes",project.poll(listener).hasChanges());

// build the project
build(project, Result.SUCCESS);

/* Expects 1 build because the build of someBranch incorporates all
* the changes from the master branch as well as the changes from someBranch.
*/
assertEquals("Wrong number of builds", 1, project.getBuilds().size());

assertFalse("polling should not detect changes",project.poll(listener).hasChanges());
}

@Issue("JENKINS-29066")
public void testPolling_parentHead() throws Exception {
baseTestPolling_parentHead(Collections.<GitSCMExtension>emptyList());
}

@Issue("JENKINS-29066")
public void testPolling_parentHead_DisableRemotePoll() throws Exception {
baseTestPolling_parentHead(Collections.<GitSCMExtension>singletonList(new DisableRemotePoll()));
}

public void testPollingAfterManualBuildWithParametrizedBranchSpec() throws Exception {
// create parameterized project with environment value in branch specification
FreeStyleProject project = createFreeStyleProject();

0 comments on commit 06dc97f

Please sign in to comment.
You can’t perform that action at this time.