Skip to content

Commit 80aa639

Browse files
committed
Fix outdated tests
1 parent 430ec67 commit 80aa639

File tree

6 files changed

+9
-15
lines changed

6 files changed

+9
-15
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ HEALTHCHECK --start-period=1s \
1919
--interval=5s \
2020
--timeout=5s \
2121
--retries=12 \
22-
CMD nc -vz localhost 443 || exit 1
22+
CMD nc -vz 127.0.0.1 443 || exit 1

docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ x-sharedDeployConfig: &sharedDeployConfig
1414
cpus: '0.1'
1515
memory: 10M
1616

17-
version: "3.4"
18-
1917
services:
2018
remote-api:
2119
<<: *sharedConfig
20+
pull_policy: build
2221
build: .
2322
ports:
2423
- 8443:443

test/Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1+
FROM docker:27.3.1-cli as docker
12
FROM maven:3.6.3-openjdk-8-slim
23

3-
RUN curl https://download.docker.com/linux/static/stable/x86_64/docker-19.03.13.tgz | tar xvz --directory /tmp \
4-
&& mv -v /tmp/docker/docker /usr/local/bin/docker \
5-
&& chmod +x /usr/local/bin/docker \
6-
&& rm -rf /tmp/docker
7-
8-
RUN curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
9-
&& chmod +x /usr/local/bin/docker-compose
4+
COPY --from=docker --chmod=555 /usr/local/bin/docker /usr/local/bin/docker
5+
COPY --from=docker --chmod=555 /usr/local/libexec/docker/cli-plugins/ /root/.docker/cli-plugins
106

117
WORKDIR /build
128
COPY pom.xml .

test/docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.4'
2-
31
services:
42
remote-api:
53
build: ..
@@ -12,6 +10,7 @@ services:
1210
- "/var/run/docker.sock:/var/run/docker.sock:ro"
1311

1412
test:
13+
pull_policy: build
1514
build: .
1615
volumes:
1716
- "/var/run/docker.sock:/var/run/docker.sock:ro"

test/src/test/java/de/kekru/dockerremoteapitls/test/BasicConnectionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void failsOnNoTls() {
5757

5858
// Then
5959
assertThat(exception)
60-
.hasMessageContaining("error during connect: Get http://abc.127.0.0.1.nip.io:30129/v1.40/containers/json: EOF");
60+
.hasMessageContaining("error during connect: Get \"http://abc.127.0.0.1.nip.io:30129/v1.47/containers/json\"");
6161
}
6262

6363
@Test

test/src/test/java/de/kekru/dockerremoteapitls/test/utils/AbstractIntegrationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ protected static String runDockerCompose(String composeCommand) {
7070
env.put("DOCKER_BUILDKIT", "1");
7171
env.put("COMPOSE_PROJECT_NAME", "test");
7272
//shellExecutor.execute("docker-compose build --progress=plain remote-api", env);
73-
return shellExecutor.execute("docker-compose " + composeCommand, env);
73+
return shellExecutor.execute("docker compose " + composeCommand, env);
7474
}
7575

7676
protected static void waitForHealthy() {
@@ -85,7 +85,7 @@ protected static void waitForHealthy() {
8585

8686
String output = runDockerCompose("ps remote-api");
8787

88-
if (output.contains("Up (healthy)")) {
88+
if (output.contains("(healthy)")) {
8989
return;
9090
}
9191
}

0 commit comments

Comments
 (0)