Skip to content

Commit

Permalink
Merge pull request jenkinsci#296 from Willem1987/Issue-291
Browse files Browse the repository at this point in the history
Add test for docker agent with Closure param
  • Loading branch information
nre-ableton authored Oct 5, 2020
2 parents 5c300ce + af51895 commit 277fe8a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.lesfurets.jenkins.unit.declarative

import org.junit.Before
import org.junit.Test

class TestDockerAgentInStep extends DeclarativePipelineTest {

@Before
@Override
void setUp() throws Exception {
super.setUp()
}

@Test
void test_example() {
runScript("src/test/jenkins/jenkinsfiles/Docker_agentInStep_JenkinsFile")
assertJobStatusSuccess()
}
}
11 changes: 11 additions & 0 deletions src/test/jenkins/jenkinsfiles/Docker_agentInStep_JenkinsFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pipeline {

stages {
stage('Maven Build') {
agent { docker { image 'maven' } }
steps {
sh 'mvn install'
}
}
}
}

0 comments on commit 277fe8a

Please sign in to comment.