Skip to content

Commit

Permalink
Add more CPS mismatch warning false positives
Browse files Browse the repository at this point in the history
  • Loading branch information
dwnusbaum committed Jul 30, 2019
1 parent 2974e6c commit 5650e0a
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,24 @@ public class CpsVmExecutorServiceTest {
r.assertLogNotContains("methodMissing", b);
return null;
});
errors.checkSucceeds(() -> {
p.setDefinition(new CpsFlowDefinition(
"class C { def x }\n" +
"def c = new C()\n" +
"c.x = {-> echo 'test' }\n" +
"c.x()", false));
WorkflowRun b = r.buildAndAssertSuccess(p);
r.assertLogNotContains(CpsVmExecutorService.mismatchMessage("C", "x", "org.jenkinsci.plugins.workflow.cps.CpsClosure2", "call"), b);
return null;
});
errors.checkSucceeds(() -> {
p.setDefinition(new CpsFlowDefinition(
"def cs = [ action: {-> sleep(1) } ]\n" +
"cs.action()", true));
WorkflowRun b = r.buildAndAssertSuccess(p);
r.assertLogNotContains(CpsVmExecutorService.mismatchMessage("java.util.LinkedHashMap", "action", "org.jenkinsci.plugins.workflow.cps.CpsClosure2", "call"), b);
return null;
});
} finally {
CpsVmExecutorService.FAIL_ON_MISMATCH = origFailOnMismatch;
}
Expand Down

0 comments on commit 5650e0a

Please sign in to comment.