Skip to content

Commit

Permalink
Merge pull request #313 from Romain-Geissler-1A/bugfix/use-recent-htt…
Browse files Browse the repository at this point in the history
…pd-test-image

Migrate tests to the very latest httpd docker image to unbreak tests.
  • Loading branch information
jglick authored May 22, 2024
2 parents dc3cf13 + 7d5f6a0 commit c0c3406
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private static void grep(File dir, String text, String prefix, Set<String> match
assumeDocker();
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj");
p.setDefinition(new CpsFlowDefinition(
"def r = docker.image('httpd:2.4.12').inside {\n" +
"def r = docker.image('httpd:2.4.59').inside {\n" +
" semaphore 'wait'\n" +
" sh 'cat /usr/local/apache2/conf/extra/httpd-userdir.conf'\n" +
" 42\n" +
Expand Down Expand Up @@ -185,7 +185,7 @@ private static void grep(File dir, String text, String prefix, Set<String> match
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj");
p.setDefinition(new CpsFlowDefinition(
"node {\n" +
" def img = docker.image('httpd:2.4.12')\n" +
" def img = docker.image('httpd:2.4.59')\n" +
" img.run().stop()\n" +
" img.run('--memory-swap=-1').stop()\n" +
" img.withRun {}\n" +
Expand All @@ -204,7 +204,7 @@ private static void grep(File dir, String text, String prefix, Set<String> match
assumeDocker();
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj");
p.setDefinition(new CpsFlowDefinition(
"def r = docker.image('httpd:2.4.12').withRun {c ->\n" +
"def r = docker.image('httpd:2.4.59').withRun {c ->\n" +
" semaphore 'wait'\n" +
" sh \"docker exec ${c.id} cat /usr/local/apache2/conf/extra/httpd-userdir.conf\"\n" +
" 42\n" +
Expand Down Expand Up @@ -346,7 +346,7 @@ private static void grep(File dir, String text, String prefix, Set<String> match
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj");
p.setDefinition(new CpsFlowDefinition(
"docker.withTool('default') {\n" +
" docker.image('httpd:2.4.12').withRun {}\n" +
" docker.image('httpd:2.4.59').withRun {}\n" +
" sh 'echo PATH=$PATH'\n" +
"}", true));
story.j.assertLogContains("PATH=/usr/bin:", story.j.assertBuildStatusSuccess(p.scheduleBuild2(0)));
Expand Down Expand Up @@ -437,7 +437,7 @@ private static void grep(File dir, String text, String prefix, Set<String> match
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj");
p.setDefinition(new CpsFlowDefinition(
"node {\n" +
" def img = docker.image('httpd:2.4.12')\n" +
" def img = docker.image('httpd:2.4.59')\n" +
" def port = img.withRun('-p 12345:80') { c -> c.port(80) }\n" +
" echo \"container running on ${port}\"" +
"}", true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public class WithContainerStepTest {
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj");
p.setDefinition(new CpsFlowDefinition(
"node {\n" +
" withDockerContainer('httpd:2.4.12') {\n" +
" withDockerContainer('httpd:2.4.59') {\n" +
" sh 'cp /usr/local/apache2/conf/extra/httpd-userdir.conf .; ls -la'\n" +
" }\n" +
" sh 'ls -la; cat *.conf'\n" +
Expand All @@ -135,7 +135,7 @@ public class WithContainerStepTest {
p.setDefinition(new CpsFlowDefinition(
"node {\n" +
" timeout(time: 20, unit: 'SECONDS') {\n" +
" withDockerContainer('httpd:2.4.12') {\n" +
" withDockerContainer('httpd:2.4.59') {\n" +
" sh 'sleep infinity'\n" +
" }\n" +
" }\n" +
Expand Down Expand Up @@ -215,7 +215,7 @@ public class WithContainerStepTest {
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj");
p.setDefinition(new CpsFlowDefinition(
"node {\n" +
" withDockerContainer('httpd:2.4.12') {\n" +
" withDockerContainer('httpd:2.4.59') {\n" +
" semaphore 'wait'\n" +
" sh 'cat /usr/local/apache2/conf/extra/httpd-userdir.conf'\n" +
" }\n" +
Expand Down Expand Up @@ -481,7 +481,7 @@ private static final class Execution extends SynchronousNonBlockingStepExecution
p.setDefinition(new CpsFlowDefinition(
"node('dockerized') {\n" +
" sh 'which docker && docker version'\n" +
" withDockerContainer('httpd:2.4.12') {\n" +
" withDockerContainer('httpd:2.4.59') {\n" +
" sh 'cp /usr/local/apache2/conf/extra/httpd-userdir.conf .; ls -la'\n" +
" }\n" +
" sh 'ls -la; cat *.conf'\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void test_run() throws IOException, InterruptedException {
EnvVars launchEnv = DockerTestUtil.newDockerLaunchEnv();
String containerId = dockerClient.run(
launchEnv,
"learn/tutorial",
"busybox",
null,
null,
Collections.emptyMap(),
Expand All @@ -43,7 +43,7 @@ public void test_run() throws IOException, InterruptedException {

Assert.assertEquals(64, containerId.length());
ContainerRecord containerRecord = dockerClient.getContainerRecord(launchEnv, containerId);
Assert.assertEquals(dockerClient.inspect(launchEnv, "learn/tutorial", ".Id"), containerRecord.getImageId());
Assert.assertEquals(dockerClient.inspect(launchEnv, "busybox", ".Id"), containerRecord.getImageId());
Assert.assertTrue(containerRecord.getContainerName().length() > 0);
Assert.assertTrue(containerRecord.getHost().length() > 0);
Assert.assertTrue(containerRecord.getCreated() > 1000000000000L);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
pipeline {
agent {
docker {
image "httpd:2.4.12"
image "httpd:2.4.59"
args "-v /tmp:/tmp"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"key": "image",
"value": {
"isLiteral": true,
"value": "httpd:2.4.12"
"value": "httpd:2.4.59"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
pipeline {
agent {
docker {
image "httpd:2.4.12"
image "httpd:2.4.59"
label "docker"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pipeline {
agent {
docker {
label "other-docker"
image "httpd:2.4.12"
image "httpd:2.4.59"
reuseNode true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pipeline {
agent {
docker {
label "thisspec"
image "httpd:2.4.12"
image "httpd:2.4.59"
args "-v /tmp:/tmp"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
pipeline {
agent {
docker {
image "httpd:2.4.12"
image "httpd:2.4.59"
args "-v /tmp:/tmp"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pipeline {
stage("bar") {
agent {
docker {
image "httpd:2.4.12"
image "httpd:2.4.59"
reuseNode true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pipeline {
docker {
alwaysPull true
registryCredentialsId "dockerhub"
image "jtaboada/httpd:2.4.12"
image "jtaboada/httpd:2.4.59"
args "-v /tmp:/tmp"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
pipeline {
agent {
docker {
image "httpd:2.4.12"
image "httpd:2.4.59"
args ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
pipeline {
agent {
docker {
image "httpd:2.4.12"
image "httpd:2.4.59"
args null
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pipeline {
agent {
docker {
alwaysPull true
image "httpd:2.4.12"
image "httpd:2.4.59"
registryUrl "https://index.docker.io/v2/"
args "-v /tmp:/tmp"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
pipeline {
agent {
docker {
image "httpd:2.4.12"
image "httpd:2.4.59"
label "docker"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pipeline {
stage("bar") {
agent {
docker {
image "httpd:2.4.12"
image "httpd:2.4.59"
reuseNode true
}
}
Expand All @@ -50,7 +50,7 @@ pipeline {
stage("new node - docker") {
agent {
docker {
image "httpd:2.4.12"
image "httpd:2.4.59"
}
}
steps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
pipeline {
agent {
docker {
image "httpdIDontExist:2.4.12"
image "httpdIDontExist:2.4.59"
args "-v /tmp:/tmp"
}
}
Expand Down

0 comments on commit c0c3406

Please sign in to comment.