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

Verified

This commit was signed with the committer’s verified signature.
bluk Bryant Luk
2 parents dc3cf13 + 7d5f6a0 commit c0c3406
Showing 17 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -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" +
@@ -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" +
@@ -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" +
@@ -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)));
@@ -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));
Original file line number Diff line number Diff line change
@@ -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" +
@@ -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" +
@@ -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" +
@@ -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" +
Original file line number Diff line number Diff line change
@@ -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(),
@@ -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);
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
pipeline {
agent {
docker {
image "httpd:2.4.12"
image "httpd:2.4.59"
args "-v /tmp:/tmp"
}
}
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@
"key": "image",
"value": {
"isLiteral": true,
"value": "httpd:2.4.12"
"value": "httpd:2.4.59"
}
},
{
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
pipeline {
agent {
docker {
image "httpd:2.4.12"
image "httpd:2.4.59"
label "docker"
}
}
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ pipeline {
agent {
docker {
label "other-docker"
image "httpd:2.4.12"
image "httpd:2.4.59"
reuseNode true
}
}
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ pipeline {
agent {
docker {
label "thisspec"
image "httpd:2.4.12"
image "httpd:2.4.59"
args "-v /tmp:/tmp"
}
}
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
pipeline {
agent {
docker {
image "httpd:2.4.12"
image "httpd:2.4.59"
args "-v /tmp:/tmp"
}
}
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ pipeline {
stage("bar") {
agent {
docker {
image "httpd:2.4.12"
image "httpd:2.4.59"
reuseNode true
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
pipeline {
agent {
docker {
image "httpd:2.4.12"
image "httpd:2.4.59"
args ""
}
}
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
pipeline {
agent {
docker {
image "httpd:2.4.12"
image "httpd:2.4.59"
args null
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
pipeline {
agent {
docker {
image "httpd:2.4.12"
image "httpd:2.4.59"
label "docker"
}
}
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ pipeline {
stage("bar") {
agent {
docker {
image "httpd:2.4.12"
image "httpd:2.4.59"
reuseNode true
}
}
@@ -50,7 +50,7 @@ pipeline {
stage("new node - docker") {
agent {
docker {
image "httpd:2.4.12"
image "httpd:2.4.59"
}
}
steps {
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
pipeline {
agent {
docker {
image "httpdIDontExist:2.4.12"
image "httpdIDontExist:2.4.59"
args "-v /tmp:/tmp"
}
}

0 comments on commit c0c3406

Please sign in to comment.