-
Notifications
You must be signed in to change notification settings - Fork 2
/
SayHelloTest.groovy
43 lines (33 loc) · 1.17 KB
/
SayHelloTest.groovy
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
#!/usr/bin/env groovy
import org.junit.Before
import org.junit.Test
import java.util.regex.Pattern
import static com.lesfurets.jenkins.unit.global.lib.LibraryConfiguration.library
import static com.lesfurets.jenkins.unit.global.lib.LocalSource.localSource
import com.lesfurets.jenkins.unit.BasePipelineTest
class SayHelloTest extends BasePipelineTest {
@Override
@Before
void setUp() throws Exception {
String sharedLibs = this.class.getResource('./').getFile()
def library = library()
.name('nextlayerci-example')
.allowOverride(false)
.retriever(localSource(sharedLibs))
.targetPath(sharedLibs)
.defaultVersion("master")
.implicit(true)
.build()
helper.registerSharedLibrary(library)
setScriptRoots([ 'src', 'vars', 'test/groovy' ] as String[])
setScriptExtension('groovy')
super.setUp()
}
@Test
void should_execute_without_errors() throws Exception {
Script script = loadScript("HelloPipeline.groovy")
script.execute()
printCallStack()
assertJobStatusSuccess()
}
}