From 35e21f85f3bb6f74a75919b9a0fe866f54629bf5 Mon Sep 17 00:00:00 2001 From: Rory Hunter Date: Mon, 11 Nov 2019 11:43:32 +0000 Subject: [PATCH] Reenable Docker tests again (#48936) Backport of #48898. We no longer configure distributions for prior versions for Docker. This is because doing so prompts Gradle to try and resolve the Docker dependencies, which doesn't work as they can't be downloaded via Ivy (configured in DistributionDownloadPlugin). Since we need these for the BATS upgrade tests, and those tests only cover .rpm and .deb, it's OK to omit creating such distributions in the first place. We may need to revisit this in the future, to allow upgrade testing using Docker containers. --- .../gradle/test/DistroTestPlugin.java | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/DistroTestPlugin.java b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/DistroTestPlugin.java index 9d13898d9ac..13782da64c2 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/DistroTestPlugin.java +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/DistroTestPlugin.java @@ -353,8 +353,7 @@ public class DistroTestPlugin implements Plugin { List currentDistros = new ArrayList<>(); List upgradeDistros = new ArrayList<>(); - // Disable DOCKER due to https://github.com/elastic/infra/issues/15864 - for (Type type : Arrays.asList(Type.DEB, Type.RPM /*, Type.DOCKER */)) { + for (Type type : Arrays.asList(Type.DEB, Type.RPM, Type.DOCKER)) { for (Flavor flavor : Flavor.values()) { for (boolean bundledJdk : Arrays.asList(true, false)) { // All our Docker images include a bundled JDK so it doesn't make sense to test without one @@ -365,12 +364,21 @@ public class DistroTestPlugin implements Plugin { } } } - // upgrade version is always bundled jdk - // NOTE: this is mimicking the old VagrantTestPlugin upgrade behavior. It will eventually be replaced - // witha dedicated upgrade test from every bwc version like other bwc tests - addDistro(distributions, type, null, Flavor.DEFAULT, true, upgradeVersion.toString(), upgradeDistros); - if (upgradeVersion.onOrAfter("6.3.0")) { - addDistro(distributions, type, null, Flavor.OSS, true, upgradeVersion.toString(), upgradeDistros); + + // We don't configure distributions for prior versions for Docker. This is because doing + // so prompts Gradle to try and resolve the Docker dependencies, which doesn't work as + // they can't be downloaded via Ivy (configured in DistributionDownloadPlugin). Since we + // need these for the BATS upgrade tests, and those tests only cover .rpm and .deb, it's + // OK to omit creating such distributions in the first place. We may need to revisit + // this in the future, so allow upgrade testing using Docker containers. + if (type != Type.DOCKER) { + // upgrade version is always bundled jdk + // NOTE: this is mimicking the old VagrantTestPlugin upgrade behavior. It will eventually be replaced + // witha dedicated upgrade test from every bwc version like other bwc tests + addDistro(distributions, type, null, Flavor.DEFAULT, true, upgradeVersion.toString(), upgradeDistros); + if (upgradeVersion.onOrAfter("6.3.0")) { + addDistro(distributions, type, null, Flavor.OSS, true, upgradeVersion.toString(), upgradeDistros); + } } }