Skip to content

Commit

Permalink
Upgrade test containers to Ubuntu 24.04 and Java 17
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed May 20, 2024
1 parent 19710fb commit 77dea2c
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 31 deletions.
9 changes: 0 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ updates:
directory: "src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/GitContainer"
schedule:
interval: "weekly"
ignore:
- dependency-name: "ubuntu"
versions: [">=22.04"]
- package-ecosystem: "docker"
directory: "src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/JabberContainer"
schedule:
Expand All @@ -44,9 +41,6 @@ updates:
directory: "src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/JiraContainer"
schedule:
interval: "weekly"
ignore:
- dependency-name: "ubuntu"
versions: [">=22.04"]
- package-ecosystem: "docker"
directory: "src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/LdapContainer"
schedule:
Expand Down Expand Up @@ -74,9 +68,6 @@ updates:
directory: "src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/Tomcat10Container"
schedule:
interval: "weekly"
ignore:
- dependency-name: "ubuntu"
versions: [">=22.04"]
- package-ecosystem: "docker"
directory: "src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/GitLabContainer"
schedule:
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if (needSplittingFromWorkspace) {
def axes = [
jenkinsVersions: ['lts', 'latest'],
platforms: ['linux'],
jdks: [11, 21],
jdks: [17, 21],
browsers: ['firefox'],
]

Expand Down
2 changes: 1 addition & 1 deletion ath-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
uid=$(id -u)
gid=$(id -g)
tag='jenkins/ath'
java_version="${java_version:-11}"
java_version="${java_version:-17}"

# high chance of uid / group already existing in the container
# known to happen on macOS
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
<dependency>
<groupId>org.jenkins-ci.test</groupId>
<artifactId>docker-fixtures</artifactId>
<version>190.vd6a_e600cb_775</version>
<version>200.v22a_e8766731c</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# and prepares for execution of gitplugin tests.
#

FROM ubuntu:22.04
FROM ubuntu:24.04

RUN mkdir -p /var/run/sshd

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# The initial password is 'admin:admin'
#
FROM ubuntu:22.04
FROM ubuntu:24.04

# Pin JIRA version to make the tests more predictable and less fragile
# In particular, pinned to 6.X because from 7.X the SOAP API is gone, and it's
Expand All @@ -12,11 +12,11 @@ FROM ubuntu:22.04
ENV JIRA_VERSION 6.3

# base package installation
RUN apt-get update && apt-get install -y apt-transport-https wget gnupg2 && echo "deb https://packages.atlassian.com/debian/atlassian-sdk-deb/ stable contrib" >> /etc/apt/sources.list
RUN apt-get update && apt-get install -y apt-transport-https wget gnupg2 software-properties-common && add-apt-repository -s "deb https://packages.atlassian.com/debian/atlassian-sdk-deb/ stable contrib"
RUN wget https://packages.atlassian.com/api/gpg/key/public
RUN apt-key add public

RUN apt-get update && apt-get install -y openjdk-8-jdk atlassian-plugin-sdk netcat
RUN apt-get update && apt-get install -y openjdk-8-jdk atlassian-plugin-sdk netcat-openbsd

# this will install the whole thing, launches Tomcat,
# asks the user to do Ctrl+C to quit, then it shuts down presumably because it
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# curl -s https://raw.githubusercontent.com/jenkinsci/docker-fixtures/master/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/JavaContainer/Dockerfile | sha1sum | cut -c 1-12
FROM jenkins/java:387404da3ce7
FROM jenkins/java:978f1af53461
COPY *.pub /tmp
RUN cat /tmp/*.pub >> /home/test/.ssh/authorized_keys
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
#
# Runs Tomcat7 on Ubuntu at port 8080, with the admin app
# Runs Tomcat10 on Ubuntu at port 8080, with the admin app
#
# The admin user has username 'admin' and password 'tomcat'
#

FROM ubuntu:22.04
FROM ubuntu:24.04

RUN apt-get update && apt-get install -y gnupg

# Tomcat7 is from Universe
RUN echo "deb http://archive.ubuntu.com/ubuntu lunar universe" >> /etc/apt/sources.list
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 40976EAF437D05B5
RUN apt-get update && apt-get install -y tomcat10 tomcat10-admin

# configure the admin user
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# curl -s https://raw.githubusercontent.com/jenkinsci/docker-fixtures/master/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/JavaContainer/Dockerfile | sha1sum | cut -c 1-12
FROM jenkins/java:387404da3ce7
RUN apt-get update && apt-get install -y vnc4server imagemagick
FROM jenkins/java:978f1af53461
RUN apt-get update && apt-get install -y tigervnc-standalone-server imagemagick

# So it is owned by root and has the permissions vncserver seems to require:
RUN mkdir /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix/
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/plugins/AntPluginTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void locallyInstalledAnt() {
step.targets.set("-version");
job.save();

String expectedVersion = "1.10.5"; // this is the version installed in the java container by the ubuntu bionic
String expectedVersion = "1.10.14"; // this is the version installed in the java container by the ubuntu noble
job.startBuild().shouldSucceed().shouldContainsConsoleOutput(Pattern.quote(expectedVersion));
}

Expand All @@ -118,7 +118,7 @@ public void testWithAntPipelineBlock() {
"}";
String antHome = setUpAntInstallation();

String expectedVersion = "1.10.5"; // this is the version installed in the java container by the ubuntu bionic;
String expectedVersion = "1.10.14"; // this is the version installed in the java container by the ubuntu noble;

WorkflowJob workflowJob = jenkins.jobs.create(WorkflowJob.class);
workflowJob.script.set(script_pipeline_ant);
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/plugins/SshSlavesPluginTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,15 @@ private void verifyUnexpectedValueForCredential(String message, CredentialsPage
setUp();
SshSlaveLauncher launcher = configureDefaultSSHSlaveLauncher().pwdCredentials("test", "test");

String javaPath = "/usr/lib/jvm/java-11-openjdk-amd64/bin/java";
String javaPath = "/usr/lib/jvm/java-17-openjdk-amd64/bin/java";
if (System.getProperty("os.arch").equals("aarch64")) {
javaPath = "/usr/lib/jvm/java-11-openjdk-arm64/bin/java";
javaPath = "/usr/lib/jvm/java-17-openjdk-arm64/bin/java";
}
launcher.setJavaPath(javaPath);
slave.save();

verify();
verifyLog("java-11-openjdk");
verifyLog("java-17-openjdk");
}

@Test public void jvmOptions() {
Expand Down

0 comments on commit 77dea2c

Please sign in to comment.