From 8e4a7512f824b62a197d9fbae94e57dbb984a251 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Wed, 6 Jul 2022 13:33:50 -0700 Subject: [PATCH 1/3] Upgrade `docker-fixtures` from 1.11 to 1.12 --- pom.xml | 6 +++--- .../docker/fixtures/DockerAgentContainer/Dockerfile | 3 ++- .../acceptance/docker/fixtures/SshAgentContainer/Dockerfile | 3 ++- .../docker/fixtures/XvncSlaveContainer/Dockerfile | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 78cc0835a4..b06c2aaaec 100644 --- a/pom.xml +++ b/pom.xml @@ -267,7 +267,7 @@ junit junit - 4.13.1 + 4.13.2 org.hamcrest @@ -400,7 +400,7 @@ org.jenkins-ci.test docker-fixtures - 1.11 + 1.12 com.github.olivergondza.dumpling @@ -462,7 +462,7 @@ commons-io commons-io - 2.7 + 2.11.0 diff --git a/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/DockerAgentContainer/Dockerfile b/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/DockerAgentContainer/Dockerfile index d623bc41e2..31760989e6 100644 --- a/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/DockerAgentContainer/Dockerfile +++ b/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/DockerAgentContainer/Dockerfile @@ -1,4 +1,5 @@ -FROM jenkins/java:d93654cc6239 +# 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 cd /tmp && \ wget -nv -O - https://get.docker.com/builds/Linux/x86_64/docker-1.13.1.tgz | tar xvfz - docker/docker && \ diff --git a/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/SshAgentContainer/Dockerfile b/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/SshAgentContainer/Dockerfile index 067be38c36..c563a7f1da 100644 --- a/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/SshAgentContainer/Dockerfile +++ b/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/SshAgentContainer/Dockerfile @@ -1,3 +1,4 @@ -FROM jenkins/java:d93654cc6239 +# 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 COPY *.pub /tmp RUN cat /tmp/*.pub >> /home/test/.ssh/authorized_keys diff --git a/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/XvncSlaveContainer/Dockerfile b/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/XvncSlaveContainer/Dockerfile index deeafc63bb..ecedf2397c 100644 --- a/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/XvncSlaveContainer/Dockerfile +++ b/src/main/resources/org/jenkinsci/test/acceptance/docker/fixtures/XvncSlaveContainer/Dockerfile @@ -1,4 +1,5 @@ -FROM jenkins/java:d93654cc6239 +# 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 # So it is owned by root and has the permissions vncserver seems to require: From e6d2b947ec7d592f1e518c3660c08f3f5d75be00 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Wed, 6 Jul 2022 14:49:24 -0700 Subject: [PATCH 2/3] Update path to Java --- src/test/java/plugins/SshSlavesPluginTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/plugins/SshSlavesPluginTest.java b/src/test/java/plugins/SshSlavesPluginTest.java index 87ffaf1005..ae83d47194 100644 --- a/src/test/java/plugins/SshSlavesPluginTest.java +++ b/src/test/java/plugins/SshSlavesPluginTest.java @@ -211,15 +211,15 @@ private void verifyUnexpectedValueForCredential(String message, CredentialsPage setUp(); SshSlaveLauncher launcher = configureDefaultSSHSlaveLauncher().pwdCredentials("test", "test"); - String javaPath = "/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java"; + String javaPath = "/usr/lib/jvm/java-11-openjdk-amd64/bin/java"; if (System.getProperty("os.arch").equals("aarch64")) { - javaPath = "/usr/lib/jvm/java-8-openjdk-arm64/jre/bin/java"; + javaPath = "/usr/lib/jvm/java-11-openjdk-arm64/bin/java"; } launcher.javaPath.set(javaPath); slave.save(); verify(); - verifyLog("java-8-openjdk"); + verifyLog("java-11-openjdk"); } @Test public void jvmOptions() { From 650531a4ca12343252c07c7a539263e4801c392d Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Wed, 6 Jul 2022 23:11:34 +0100 Subject: [PATCH 3/3] Stabilize FormValidationTest Current API is flawed for asserting form validation. Matchers should be able to retrieve state from selenium, without knowing what you are looking for you don't know what should be on the page. Added a hacky sleep to stabilize test suite rather than adjusting the API --- src/test/java/core/FormValidationTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/java/core/FormValidationTest.java b/src/test/java/core/FormValidationTest.java index 876a10cacb..a22e537b78 100644 --- a/src/test/java/core/FormValidationTest.java +++ b/src/test/java/core/FormValidationTest.java @@ -23,13 +23,12 @@ */ package core; -import hudson.util.VersionNumber; import org.jenkinsci.test.acceptance.junit.AbstractJUnitTest; import org.jenkinsci.test.acceptance.po.FormValidation; import org.jenkinsci.test.acceptance.po.JenkinsConfig; import org.jenkinsci.test.acceptance.po.ListView; import org.junit.Test; -import org.openqa.selenium.Alert; +import org.openqa.selenium.Keys; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; @@ -64,6 +63,8 @@ private void jsValidation() { assertThat(formValidation, silent()); c.numExecutors.set(-16); + c.numExecutors.resolve().sendKeys(Keys.TAB); + c.numExecutors.sleep(100L); formValidation = c.numExecutors.getFormValidation(); String errorMessage = "Not a non-negative integer";