-
Notifications
You must be signed in to change notification settings - Fork 402
Expand file tree
/
Copy pathTestDockerAgentInStep.groovy
More file actions
48 lines (40 loc) · 1.48 KB
/
TestDockerAgentInStep.groovy
File metadata and controls
48 lines (40 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.lesfurets.jenkins.unit.declarative
import org.junit.Before
import org.junit.Test
class TestDockerAgentInStep extends DeclarativePipelineTest {
@Before
@Override
void setUp() throws Exception {
scriptRoots += 'src/test/jenkins/jenkinsfiles'
scriptExtension = ''
super.setUp()
}
@Test
void test_example() {
runScript("Docker_agentInStep_JenkinsFile")
assertJobStatusSuccess()
}
@Test
void test_dockerfile_agent() {
runScript("Dockerfile_agent_JenkinsFile")
assertJobStatusSuccess()
}
@Test
void test_dockerfile_agent_only_filename_specified() {
runScript("Dockerfile_Agent_Only_Filename_JenkinsFile")
assertCallStackContains('Executing on agent [dockerfile')
assertJobStatusSuccess()
}
@Test void test_dockerfile_default_agent() throws Exception {
runScript('Dockerfile_Agent_Default_Jenkinsfile')
assertCallStackContains('Executing on agent [dockerfile')
assertJobStatusSuccess()
}
@Test
void test_docker_agent_callstack_does_not_contain_binding() {
runScript("Docker_agentInStep_JenkinsFile")
assertJobStatusSuccess()
assertCallStack().doesNotContain('binding:groovy.lang.Binding@')
assertCallStackContains('Docker_agentInStep_JenkinsFile.echo(Executing on agent [docker:[label:latest, args:, reuseNode:false, containerPerStageRoot:false, alwaysPull:true, image:maven, stages:[:]]])')
}
}