-
Notifications
You must be signed in to change notification settings - Fork 402
Expand file tree
/
Copy pathTestFailingJobs.groovy
More file actions
41 lines (35 loc) · 1.21 KB
/
TestFailingJobs.groovy
File metadata and controls
41 lines (35 loc) · 1.21 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
/*
* Copyright (C) by Courtanet, All Rights Reserved.
*/
package com.lesfurets.jenkins
import org.codehaus.groovy.runtime.typehandling.GroovyCastException
import org.junit.Before
import org.junit.Ignore
import org.junit.Test
import com.lesfurets.jenkins.unit.cps.BasePipelineTestCPS;
class TestFailingJobs extends BasePipelineTestCPS {
@Override
@Before
void setUp() throws Exception {
scriptRoots += 'src/test/jenkins'
super.setUp()
}
@Test(expected = GroovyCastException)
@Ignore
void should_fail_nonCpsCallingCps() throws Exception {
def script = runScript("job/shouldFail/nonCpsCallingCps.jenkins")
printCallStack()
}
/**
* java.lang.UnsupportedOperationException: Calling public static java.util.List
* org.codehaus.groovy.runtime.DefaultGroovyMethods.each(java.util.List,groovy.lang.Closure)
* on a CPS-transformed closure is not yet supported (JENKINS-26481);
* encapsulate in a @NonCPS method, or use Java-style loops
*/
@Test(expected = UnsupportedOperationException)
@Ignore
void should_fail_forEach() throws Exception {
def script = runScript("job/shouldFail/forEach.jenkins")
printCallStack()
}
}