Skip to content

Commit

Permalink
[JENKINS-47074] Add a test to verify SpecificBuildSelector accepts bu…
Browse files Browse the repository at this point in the history
…ild IDs
  • Loading branch information
ikedam committed Mar 25, 2018
1 parent 7537890 commit f8078da
Showing 1 changed file with 17 additions and 0 deletions.
Expand Up @@ -271,6 +271,23 @@ public void testSpecificBuildSelector() throws Exception {
jenkinsRule.assertLogContains("foobar", jenkinsRule.assertBuildStatusSuccess(copier.scheduleBuild2(0)));
}

@Issue("JENKINS-47074")
@Test
public void testSpecificBuildSelectorWithId() throws Exception {
// build number == build id since Jenkins 1.597 (JENKINS-24380).
WorkflowJob copier = jenkinsRule.createWorkflow(
"copier",
"copyArtifacts(projectName: 'copiee', selector: specific(build('copiee').id));"
+ "echo readFile('artifact.txt');"
);
jenkinsRule.createWorkflow(
"copiee",
"writeFile text: 'foobar', file: 'artifact.txt';"
+ "archive includes: 'artifact.txt';"
);
jenkinsRule.assertLogContains("foobar", jenkinsRule.assertBuildStatusSuccess(copier.scheduleBuild2(0)));
}

@Test
public void testStatusBuildSelector() throws Exception {
WorkflowJob copiee = jenkinsRule.createWorkflow(
Expand Down

0 comments on commit f8078da

Please sign in to comment.