From ab123483baa5e381447ddd9a4f1d65c3d8d5c4c4 Mon Sep 17 00:00:00 2001 From: James Nord Date: Mon, 14 Aug 2023 12:56:01 +0100 Subject: [PATCH 1/3] Revert "Revert "use custom DNS in the ath container to enable HAR recording" (#1323)" This reverts commit 64cd2e005b8b945b310ef11c172f49ca60a062e0. --- src/main/resources/ath-container/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/ath-container/run.sh b/src/main/resources/ath-container/run.sh index 585e2c641a..72999b34d7 100755 --- a/src/main/resources/ath-container/run.sh +++ b/src/main/resources/ath-container/run.sh @@ -80,4 +80,4 @@ fi set -x -BROWSER=$browser JENKINS_WAR=$war $MVN $extra_args "$@" +BROWSER=$browser JENKINS_LOCAL_HOSTNAME=jenkins.127.0.0.1.sslip.io JENKINS_WAR=$war $MVN $extra_args "$@" From 536066322c4353a8da3721620aa5dc6924ebe6e1 Mon Sep 17 00:00:00 2001 From: James Nord Date: Mon, 14 Aug 2023 12:59:05 +0100 Subject: [PATCH 2/3] avoid DNS lookups for jenkins.127.0.0.1.sslip.io in CI Avoid using the sslip.io DNS service in CI whilst keeping it for local debugging / test runs. the entry for JENKINS_LOCAL_HOSTNAME is added as a hosts for the docker container when running in CI so that we do not trly on DNS queries in the tests, but will still have a HAR when run locally in docker (unless the host is also added there) --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b02b92d1b2..a5f63ad3f7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -109,7 +109,7 @@ for (int i = 0; i < splits.size(); i++) { checkout scm sh 'mkdir -p target/ath-reports && chmod a+rwx target/ath-reports' def cwd = pwd() - docker.image('jenkins/ath').inside("-v /var/run/docker.sock:/var/run/docker.sock -v '${cwd}/target/ath-reports:/reports:rw' --shm-size 2g") { + docker.image('jenkins/ath').inside("-v /var/run/docker.sock:/var/run/docker.sock -v '${cwd}/target/ath-reports:/reports:rw' --shm-size 2g --add-host jenkins.127.0.0.1.sslip.io:127.0.0.1") { def exclusions = splits.get(index).join('\n') writeFile file: 'excludes.txt', text: exclusions infra.withArtifactCachingProxy { From 17137d1dc16826fa73411527b69af285e5c16e13 Mon Sep 17 00:00:00 2001 From: James Nord Date: Mon, 14 Aug 2023 13:08:40 +0100 Subject: [PATCH 3/3] Pass --add-host flag to container in ath-container.sh script --- ath-container.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ath-container.sh b/ath-container.sh index b373f0cc44..30b27caeed 100755 --- a/ath-container.sh +++ b/ath-container.sh @@ -37,5 +37,6 @@ docker run \ -v /var/run/docker.sock:/var/run/docker.sock \ -v "$(pwd):/home/ath-user/sources" \ -v "${HOME}/.m2/repository:/home/ath-user/.m2/repository" \ + --add-host jenkins.127.0.0.1.sslip.io:127.0.0.1 \ $tag \ /bin/bash -c "set-java.sh $java_version; bash"