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

JENKINS-47378# Switch to JDK8 and core 2.73.2 #1479

Merged
merged 17 commits into from
Oct 23, 2017
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 Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Should be kept in sync with jenkins.properties of pom.xml
# Patch version is not to be considered, we prefer to base the image off the latest LTS of the line
# and keep the dependency on the baseline in pom.xml
FROM jenkins:2.7.4
FROM jenkins:2.73.2

USER root

Expand Down
6 changes: 6 additions & 0 deletions Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ RUN apt-get update -qqy \
build-essential \
python \
iputils-ping \
locales \
&& rm -rf /var/lib/apt/lists/* \
&& sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security

# Set utf-8 locale
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8

#==========
# Maven
#==========
Expand Down
10 changes: 5 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ node() {
sh "node ./bin/checkshrinkwrap.js"
}

stage('ATH - Jenkins 2.46.3') {
sh "cd acceptance-tests && ./run.sh -v=2.46.3 --no-selenium --settings='-s ${env.WORKSPACE}/settings.xml'"
stage('ATH - Jenkins 2.73.2') {
sh "cd acceptance-tests && ./run.sh -v=2.73.2 --no-selenium --settings='-s ${env.WORKSPACE}/settings.xml'"
junit 'acceptance-tests/target/surefire-reports/*.xml'
archive 'acceptance-tests/target/screenshots/*'
archive 'acceptance-tests/target/screenshots/**/*'
}

if (env.JOB_NAME =~ 'blueocean-weekly-ath') {
stage('ATH - Jenkins 2.60.1') {
sh "cd acceptance-tests && ./run.sh -v=2.60.1 --no-selenium --settings='-s ${env.WORKSPACE}/settings.xml'"
stage('ATH - Jenkins 2.73.2') {
sh "cd acceptance-tests && ./run.sh -v=2.73.2 --no-selenium --settings='-s ${env.WORKSPACE}/settings.xml'"
junit 'acceptance-tests/target/surefire-reports/*.xml'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>2.11</version>
<version>2.35</version>
<relativePath/>
</parent>
<groupId>org.jenkins-ci.plugins</groupId>
Expand All @@ -16,13 +16,14 @@

<properties>
<!-- Baseline Jenkins version you use to build the plugin. Users must have this version or newer to run. -->
<jenkins.version>2.46.3</jenkins.version>
<jenkins.version>2.73.2</jenkins.version>
<!-- Other properties you may want to use:
~ java.level: set to 6 if your jenkins.version <= 1.611
~ jenkins-test-harness.version: Jenkins Test Harness version you use to test the plugin. For Jenkins version >= 1.580.1 use JTH 2.0 or higher.
~ hpi-plugin.version: The HPI Maven Plugin version used by the plugin..
~ stapler-plugin.version: The Stapler Maven plugin version required by the plugin.
-->
<java.level>8</java.level>
</properties>

<name>Fake realm plugin</name>
Expand Down Expand Up @@ -66,12 +67,12 @@
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-test-harness</artifactId>
<version>2.15</version>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-test-harness</artifactId>
<version>2.30</version>
</dependency>
</dependencies>

</project>
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>2.10</version>
<version>2.35</version>
<relativePath />
</parent>
<groupId>org.jenkins-ci.plugins.blueocean</groupId>
Expand Down Expand Up @@ -56,7 +56,9 @@
</pluginRepository>
</pluginRepositories>
<properties>
<jenkins.version>2.46.3</jenkins.version>
<jenkins.version>2.73.2</jenkins.version>
<jenkins-test-harness.version>2.30</jenkins-test-harness.version>
<java.level>8</java.level>
</properties>
<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion acceptance-tests/runner/scripts/args.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
JENKINS_VERSION=2.46.3
JENKINS_VERSION=2.73.2
SELENIUM_VERSION=2.53

MAVEN_SETTINGS=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public void deleteUserDomainCredential(String userName, String domainName, Strin
logger.info("found credential at " + path);
} catch (HttpResponseException e) {
if (e.getStatusCode() != 404) {
logger.error("error getting credential at " + path);
throw e;
}
// credential doesn't exist; nothing to do
Expand Down
12 changes: 6 additions & 6 deletions acceptance-tests/src/main/nightwatch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
"src/main/js/page_objects/classic_jenkins",
"src/main/js/page_objects/blueocean"
],
"screenshots": {
"enabled": true,
"on_failure": true,
"on_error": true,
"path": "target/screenshots"
},
"selenium": {
"start_process": false,
"server_path": "bin/selenium-server-standalone-2.53.1.jar",
Expand All @@ -33,6 +27,12 @@
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": true
},
"screenshots": {
"enabled": true,
"on_failure": true,
"on_error": false,
"path": "target/screenshots"
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions blueocean-events/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
</exclusion>
<!-- Upper dependency fix: annotation-indexer comes from core, exclude from git -->
<exclusion>
<groupId>org.jenkins-ci</groupId>
<artifactId>annotation-indexer</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down
7 changes: 7 additions & 0 deletions blueocean-git-pipeline/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
<artifactId>git</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
<exclusions>
<!-- Upper dependency fix: annotation-indexer comes from core, exclude from git -->
<exclusion>
<groupId>org.jenkins-ci</groupId>
<artifactId>annotation-indexer</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down
7 changes: 7 additions & 0 deletions blueocean-pipeline-api-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@
<artifactId>git</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
<exclusions>
<!-- Upper dependency fix: annotation-indexer comes from core, exclude from git -->
<exclusion>
<groupId>org.jenkins-ci</groupId>
<artifactId>annotation-indexer</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.common.base.Predicate;
import hudson.model.Action;
import hudson.model.Queue;
import hudson.model.queue.CauseOfBlockage;
import io.jenkins.blueocean.rest.model.BlueRun;
import org.jenkinsci.plugins.pipeline.StageStatus;
import org.jenkinsci.plugins.pipeline.SyntheticStage;
Expand Down Expand Up @@ -153,7 +154,10 @@ public static boolean isParallelBranch(@Nullable FlowNode node){
if (item != null) {
String cause = item.getCauseOfBlockage().getShortDescription();
if (cause == null) {
cause = item.task.getCauseOfBlockage().getShortDescription();
CauseOfBlockage causeOfBlockage = item.task.getCauseOfBlockage();
if(causeOfBlockage != null) {
return causeOfBlockage.getShortDescription();
}
}
return cause;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import hudson.Extension;
import hudson.model.Queue;
import hudson.model.Run;
import hudson.model.queue.CauseOfBlockage;
import hudson.scm.ChangeLogSet;
import hudson.scm.ChangeLogSet.Entry;
import io.jenkins.blueocean.commons.ServiceException;
Expand Down Expand Up @@ -39,7 +40,6 @@
import org.slf4j.LoggerFactory;

import javax.annotation.Nonnull;
import java.io.IOException;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.Map;
Expand Down Expand Up @@ -245,8 +245,9 @@ public String getCauseOfBlockage() {
Run r = task.runForDisplay();
if (r != null && r.equals(run)) {
String cause = i.getCauseOfBlockage().getShortDescription();
if (task.getCauseOfBlockage() != null) {
cause = task.getCauseOfBlockage().getShortDescription();
CauseOfBlockage causeOfBlockage = task.getCauseOfBlockage();
if ( causeOfBlockage != null) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: whitespace

return causeOfBlockage.getShortDescription();
}
return cause;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition;
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
import org.jenkinsci.plugins.workflow.job.WorkflowRun;
import org.jenkinsci.plugins.workflow.test.steps.SemaphoreStep;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
Expand All @@ -36,20 +37,20 @@ public void getPipelineRunStopTest() throws Exception {

job1.setDefinition(new CpsFlowDefinition("" +
"node {" +
" stage ('Build1'); " +
" sh('sleep 60') " +
" stage ('Test1'); " +
" stage ('Build'); " +
" semaphore 's' " +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat

" stage ('Test'); " +
" echo ('Testing'); " +
"}"));
"}", false));

WorkflowRun b1 = job1.scheduleBuild2(0).waitForStart();
Map r=null;

SemaphoreStep.waitForStart("s/1", b1);
Map r = null;
for (int i = 0; i < 10; i++) {
r = request().put("/organizations/jenkins/pipelines/pipeline1/runs/1/stop")
.build(Map.class);
if(((String) r.get("state")).equalsIgnoreCase("FINISHED"))
continue;
if(((String) r.get("state")).equals("FINISHED"))
break;
Thread.sleep(1000);
}
Assert.assertEquals(r.get("state"), "FINISHED");
Expand All @@ -63,8 +64,8 @@ public void getPipelineRunStopTest() throws Exception {

for (int i = 0; i < 10; i++) {
r = put("/organizations/jenkins/pipelines/pipeline5/runs/1/stop",null);
if(((String) r.get("state")).equalsIgnoreCase("finished"))
continue;
if(((String) r.get("state")).equals("FINISHED"))
break;
Thread.sleep(1000);
}
Assert.assertEquals(r.get("state"), "FINISHED");
Expand Down
Loading