Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump parent pom to 3.54 #345

Merged
merged 2 commits into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
slonopotamus marked this conversation as resolved.
Show resolved Hide resolved
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