Skip to content

Commit

Permalink
Merge pull request #41 from raul-arabaolaza/JENKINS-45110
Browse files Browse the repository at this point in the history
[JENKINS-45110] Adapt ConfigFileBuildWrapperWorkflowTest due to JENKINS-43073
  • Loading branch information
imod committed Jul 4, 2017
2 parents 26bbe60 + 146348f commit a756b94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -97,7 +97,7 @@
<dependency> <!-- FilePathUtils -->
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-api</artifactId>
<version>2.1</version>
<version>2.15</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -115,7 +115,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-cps</artifactId>
<version>2.10</version>
<version>2.14</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Expand Up @@ -96,32 +96,14 @@ public class ConfigFileBuildWrapperWorkflowTest {
});
}

@Test public void symbolWithTargetLocation_Pipeline_short() throws Exception {
story.addStep(new Statement() {
@Override public void evaluate() throws Throwable {
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p");
p.setDefinition(new CpsFlowDefinition(""
+ "def xsh(file) { if (isUnix()) {sh \"cat $file\"} else {bat \"type $file\"} }\n"
+ "node {\n"
+ " configFileProvider([configFile(fileId: '" + createConfig().id + "', targetLocation: 'myfile.txt')]) {\n"
+ " xsh 'myfile.txt'\n"
+ " }\n"
+ "}", true));
WorkflowRun b = story.j.assertBuildStatusSuccess(p.scheduleBuild2(0));
story.j.assertLogContains("some content", b);
story.j.assertLogNotContains("temporary files", b);
}
});
}

@Test public void symbolWithTargetLocation() throws Exception {
story.addStep(new Statement() {
@Override public void evaluate() throws Throwable {
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p");
p.setDefinition(new CpsFlowDefinition(""
+ "def xsh(file) { if (isUnix()) {sh \"cat $file\"} else {bat \"type $file\"} }\n"
+ "node {\n"
+ " configFileProvider(managedFiles: [configFile(fileId: '" + createConfig().id + "', targetLocation: 'myfile.txt')]) {\n"
+ " configFileProvider([configFile(fileId: '" + createConfig().id + "', targetLocation: 'myfile.txt')]) {\n"
+ " xsh 'myfile.txt'\n"
+ " }\n"
+ "}", true));
Expand Down

0 comments on commit a756b94

Please sign in to comment.