From 5da8147e586dfb68bd538e361256002d0ae266a5 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 10 Oct 2018 19:29:20 -0400 Subject: [PATCH 1/6] Fixing waitForMessage in AbstractRunImplTest.queuedAndRunningParallel (#1830) * Updated beta versions of workflow plugins for testing * Adjusted test to changed message format of the node * Fixing waitForMessage to wait for something more reliable and pertinent. --- .../blueocean/rest/impl/pipeline/AbstractRunImplTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blueocean-pipeline-api-impl/src/test/java/io/jenkins/blueocean/rest/impl/pipeline/AbstractRunImplTest.java b/blueocean-pipeline-api-impl/src/test/java/io/jenkins/blueocean/rest/impl/pipeline/AbstractRunImplTest.java index 73971e8511b..0f8b527097a 100644 --- a/blueocean-pipeline-api-impl/src/test/java/io/jenkins/blueocean/rest/impl/pipeline/AbstractRunImplTest.java +++ b/blueocean-pipeline-api-impl/src/test/java/io/jenkins/blueocean/rest/impl/pipeline/AbstractRunImplTest.java @@ -370,7 +370,8 @@ public void queuedAndRunningParallel() throws Exception { // Run until completed WorkflowRun r = p.scheduleBuild2(0).waitForStart(); SemaphoreStep.waitForStart("wait-a/1", r); - j.waitForMessage("[Pipeline] [b] node", r); + String causeOfBlockage = "There are no nodes with the label ‘second’"; + j.waitForMessage(causeOfBlockage, r); // Get latest run for this pipeline pipeline = request().get(String.format("/organizations/jenkins/pipelines/%s/", p.getName())).build(Map.class); @@ -388,7 +389,7 @@ public void queuedAndRunningParallel() throws Exception { Assert.assertEquals("QUEUED", latestRun.get("state")); Assert.assertEquals("1", latestRun.get("id")); - Assert.assertEquals("There are no nodes with the label ‘second’", latestRun.get("causeOfBlockage")); + Assert.assertEquals(causeOfBlockage, latestRun.get("causeOfBlockage")); j.createOnlineSlave(Label.get("second")); From 9b2bd663f3c1cdfdf171e55c37c1c87dfd711b84 Mon Sep 17 00:00:00 2001 From: Vivek Pandey Date: Fri, 12 Oct 2018 11:24:18 -0700 Subject: [PATCH 2/6] Update workflow plugins with logging changes --- pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 22a58ba6da1..81052976461 100644 --- a/pom.xml +++ b/pom.xml @@ -347,12 +347,12 @@ org.jenkins-ci.plugins.workflow workflow-api - 2.29 + 2.30 org.jenkins-ci.plugins.workflow workflow-job - 2.25 + 2.26 org.jenkins-ci.plugins @@ -372,17 +372,17 @@ org.jenkins-ci.plugins.workflow workflow-durable-task-step - 2.21 + 2.22 org.jenkins-ci.plugins.workflow workflow-support - 2.20 + 2.21 org.jenkins-ci.plugins.workflow workflow-support - 2.20 + 2.21 tests From 20f7e9fb20296ccf80ae01ba400615746a91b904 Mon Sep 17 00:00:00 2001 From: Vivek Pandey Date: Fri, 12 Oct 2018 12:15:18 -0700 Subject: [PATCH 3/6] pipeline plugins upgrade --- pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 81052976461..967358e948e 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ 0.00 runtime 2.38 - 2.2.7 + 2.2.8 3.8.0 true @@ -342,7 +342,7 @@ org.jenkins-ci.plugins.workflow workflow-cps - 2.54 + 2.57 org.jenkins-ci.plugins.workflow @@ -388,12 +388,12 @@ org.jenkins-ci.plugins.workflow workflow-basic-steps - 2.10 + 2.11 org.jenkins-ci.plugins.workflow workflow-scm-step - 2.6 + 2.7 org.jenkins-ci.plugins @@ -591,7 +591,7 @@ org.jenkins-ci.plugins structs - 1.14 + 1.15 org.jenkins-ci.plugins From b060ec5e870f4500a1ae133a44502bfc85bb53bd Mon Sep 17 00:00:00 2001 From: Vivek Pandey Date: Mon, 15 Oct 2018 09:19:18 -0700 Subject: [PATCH 4/6] bumped up struts and workflow-cps version --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 967358e948e..827396c2afd 100644 --- a/pom.xml +++ b/pom.xml @@ -342,7 +342,7 @@ org.jenkins-ci.plugins.workflow workflow-cps - 2.57 + 2.58 org.jenkins-ci.plugins.workflow @@ -591,7 +591,7 @@ org.jenkins-ci.plugins structs - 1.15 + 1.17 org.jenkins-ci.plugins From f7c48db99133d8de3e0c8f971cba4e4c90643b6d Mon Sep 17 00:00:00 2001 From: Vivek Pandey Date: Mon, 15 Oct 2018 10:42:41 -0700 Subject: [PATCH 5/6] Check existence of display name vs specific name as it can change in upstream library. --- .../rest/impl/pipeline/PipelineNodeTest.java | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/blueocean-pipeline-api-impl/src/test/java/io/jenkins/blueocean/rest/impl/pipeline/PipelineNodeTest.java b/blueocean-pipeline-api-impl/src/test/java/io/jenkins/blueocean/rest/impl/pipeline/PipelineNodeTest.java index ed7bb43d67f..48d56626fff 100644 --- a/blueocean-pipeline-api-impl/src/test/java/io/jenkins/blueocean/rest/impl/pipeline/PipelineNodeTest.java +++ b/blueocean-pipeline-api-impl/src/test/java/io/jenkins/blueocean/rest/impl/pipeline/PipelineNodeTest.java @@ -16,6 +16,17 @@ import io.jenkins.blueocean.rest.hal.Link; import io.jenkins.blueocean.rest.model.BluePipelineNode; import io.jenkins.blueocean.rest.model.BlueRun; +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; import jenkins.branch.BranchSource; import jenkins.model.Jenkins; import jenkins.plugins.git.GitSCMSource; @@ -42,21 +53,6 @@ import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.Issue; - -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; - import static io.jenkins.blueocean.rest.impl.pipeline.PipelineStepImpl.PARAMETERS_ELEMENT; import static org.hamcrest.CoreMatchers.hasItem; import static org.junit.Assert.*; @@ -2846,7 +2842,7 @@ public void encodedStepDescription() throws Exception { resp = get("/organizations/jenkins/pipelines/p/pipelines/master/runs/"+b1.getId()+"/steps/", List.class); Assert.assertEquals(2, resp.size()); - assertEquals("General SCM", resp.get(0).get("displayName")); + assertNotNull(resp.get(0).get("displayName")); assertEquals("Shell Script", resp.get(1).get("displayName")); assertEquals("echo \"\u001B[32m some text \u001B[0m\"", resp.get(1).get("displayDescription")); From b05591f4348f42e123313a65e53e3c97c00d2125 Mon Sep 17 00:00:00 2001 From: Vivek Pandey Date: Mon, 15 Oct 2018 14:33:13 -0700 Subject: [PATCH 6/6] Updated structs plugin version in acceptance test --- acceptance-tests/runner/runtime-plugins/runtime-deps/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acceptance-tests/runner/runtime-plugins/runtime-deps/pom.xml b/acceptance-tests/runner/runtime-plugins/runtime-deps/pom.xml index beafec0e29a..d9f5956f2c8 100644 --- a/acceptance-tests/runner/runtime-plugins/runtime-deps/pom.xml +++ b/acceptance-tests/runner/runtime-plugins/runtime-deps/pom.xml @@ -71,7 +71,7 @@ org.jenkins-ci.plugins structs - 1.14 + 1.17