Skip to content

Commit

Permalink
Merge pull request #345 from slonopotamus/parent-pom-3.54
Browse files Browse the repository at this point in the history
Bump parent pom to 3.54
  • Loading branch information
dwnusbaum authored Dec 17, 2019
2 parents 23956c1 + d8e95ce commit 5db478a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>3.43</version>
<version>3.54</version>
<relativePath />
</parent>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
package org.jenkinsci.plugins.workflow.cps;

import static org.hamcrest.Matchers.*;

import hudson.model.queue.QueueTaskFuture;
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
import org.jenkinsci.plugins.workflow.job.WorkflowRun;
import org.jenkinsci.plugins.workflow.test.steps.SemaphoreStep;
Expand All @@ -40,11 +42,13 @@ public class CpsThreadDumpActionTest {
@Test public void doProgramDotXml() throws Exception {
WorkflowJob p = r.createProject(WorkflowJob.class);
p.setDefinition(new CpsFlowDefinition("node {semaphore 'wait'}", true));
WorkflowRun b = p.scheduleBuild2(0).waitForStart();
final QueueTaskFuture<WorkflowRun> f = p.scheduleBuild2(0);
WorkflowRun b = f.waitForStart();
SemaphoreStep.waitForStart("wait/1", b);
String xml = r.createWebClient().goTo(b.getUrl() + b.getAction(CpsThreadDumpAction.class).getUrlName() + "/program.xml", "text/xml").getWebResponse().getContentAsString();
System.out.println(xml);
assertThat(xml, containsString("SemaphoreStep"));
SemaphoreStep.success("wait/1", null);
r.assertBuildStatusSuccess(f);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import java.util.ArrayList;
import static java.util.Arrays.asList;
import java.util.List;

import hudson.model.queue.QueueTaskFuture;
import org.apache.commons.lang.StringUtils;
import org.jenkinsci.plugins.workflow.cps.CpsThreadDump.ThreadInfo;
import org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner;
Expand Down Expand Up @@ -81,7 +83,8 @@ public void parallel() throws Exception {
"}",
"zot()" // 10
), "\n"), false));
WorkflowRun b = p.scheduleBuild2(0).waitForStart();
final QueueTaskFuture<WorkflowRun> f = p.scheduleBuild2(0);
WorkflowRun b = f.waitForStart();
SemaphoreStep.waitForStart("x/1", b);
SemaphoreStep.waitForStart("y/1", b);

Expand All @@ -101,19 +104,26 @@ public void parallel() throws Exception {
"DSL.semaphore(waiting on y/1)",
"WorkflowScript.bar(WorkflowScript:3)",
"WorkflowScript.zot(WorkflowScript:8)");

SemaphoreStep.success("x/1", null);
SemaphoreStep.success("y/1", null);
j.assertBuildStatusSuccess(f);
}

@Test public void load() throws Exception {
j.jenkins.getWorkspaceFor(p).child("lib.groovy").write("def m() {semaphore 'here'}; this", null);
p.setDefinition(new CpsFlowDefinition("def lib; node {lib = load 'lib.groovy'}; lib.m()", true));
WorkflowRun b = p.scheduleBuild2(0).waitForStart();
final QueueTaskFuture<WorkflowRun> f = p.scheduleBuild2(0);
WorkflowRun b = f.waitForStart();
SemaphoreStep.waitForStart("here/1", b);
CpsThreadDump td = b.getAction(CpsThreadDumpAction.class).threadDumpSynchronous();
td.print(System.out);
assertStackTrace(td.getThreads().get(0),
"DSL.semaphore(waiting on here/1)",
"Script1.m(Script1.groovy:1)",
"WorkflowScript.run(WorkflowScript:1)");
SemaphoreStep.success("here/1", null);
j.assertBuildStatusSuccess(f);
}

@Test public void nativeMethods() throws Exception {
Expand Down

0 comments on commit 5db478a

Please sign in to comment.