From cc81f1f8a42ce8bb686a182c838d70b59ec39cf6 Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Sat, 16 Jul 2022 09:35:42 +1000 Subject: [PATCH 01/11] Remove container cleanup --- .../test/BuildInformationEndToEndTest.java | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java b/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java index c0f2b592..82d11d87 100644 --- a/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java +++ b/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java @@ -113,10 +113,6 @@ public void buildInformationStepPublishesToOctopusDeploy(@TempDir Path testDirec LOG.info("Failed to execute build"); LOG.info(teamCityContainers.getAgentContainer().getLogs()); throw e; - } finally { - // Turns out, some files get written to this directory by TC (as the tcuser) - and they need - // to be destroyed. - cleanupContainers(teamCityContainers); } } @@ -136,26 +132,4 @@ private void waitForBuildToFinish(final Build build, final TeamCityInstance tcRe LOG.warn("Build {} failed to complete within expected time limit", build.getId()); throw new RuntimeException("Build Failed to complete within 30 seconds"); } - - private void cleanupContainers(final TeamCityContainers teamCityContainers) { - final List filesToDelete = - Lists.newArrayList( - "/data/teamcity_server/datadir/system/buildserver.tmp", - "/data/teamcity_server/datadir/system/artifacts", - "/data/teamcity_server/datadir/system/caches/plugins.unpacked", - "/data/teamcity_server/datadir/system/caches/pluginsDslCache/src", - "/data/teamcity_server/datadir/system/caches/buildsMetadata/metadataDB.tmp", - "/data/teamcity_server/datadir/system/caches/sources", - "/data/teamcity_server/datadir/system/caches/kotlinDslData", - "/data/teamcity_server/datadir/system/pluginData/avatars"); - - for (final String file : filesToDelete) { - try { - LOG.debug("Removing " + file); - teamCityContainers.getServerContainer().execInContainer("rm", "-rf", file); - } catch (final Exception e) { - LOG.error("Failed to delete " + file); - } - } - } } From 90def5628fe6d6cd07920d752c35cf6741bb51ce Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Sat, 16 Jul 2022 09:42:40 +1000 Subject: [PATCH 02/11] fix spotless --- .../octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java b/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java index 82d11d87..9d0598ac 100644 --- a/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java +++ b/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java @@ -29,7 +29,6 @@ import java.time.Instant; import java.util.List; -import com.google.common.collect.Lists; import com.google.common.io.Resources; import octopus.teamcity.e2e.dsl.TeamCityContainers; import octopus.teamcity.e2e.dsl.TeamCityFactory; From 5055239ba44cca0c91cfa54170568967cfb1f081 Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Sat, 16 Jul 2022 12:36:25 +1000 Subject: [PATCH 03/11] hack in a chmod to alter file permissions --- .../java/octopus/teamcity/e2e/dsl/TeamCityFactory.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java b/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java index 373059da..01355371 100644 --- a/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java +++ b/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java @@ -47,7 +47,14 @@ public TeamCityContainers createTeamCityServerAndAgent( final String serverUrl = String.format("http://host.testcontainers.internal:%d", octopusServerPort); Testcontainers.exposeHostPorts(octopusServerPort); - return createTeamCityServerAndAgent(serverUrl, octopusServerApiKey, projectZipToInstall); + final TeamCityContainers container = + createTeamCityServerAndAgent(serverUrl, octopusServerApiKey, projectZipToInstall); + try { + container.getServerContainer().execInContainer("chmod -R 777 /data/teamcity_server/datadir"); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + return container; } // When OctopusServer's URL can be fully specified @@ -95,7 +102,6 @@ private GenericContainer createAndStartServer() { .waitingFor(Wait.forLogMessage(".*Super user authentication token.*", 1)) .withNetwork(dockerNetwork) .withNetworkAliases("server") - .withCreateContainerCmdModifier(cmd -> cmd.withUser("1000")) .withEnv( "TEAMCITY_SERVER_OPTS", "-Droot.log.level=TRACE -Dteamcity.development.mode=true " From d74a4b5c99e83317952a64e057b7e1622f04c56f Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Sat, 16 Jul 2022 12:54:39 +1000 Subject: [PATCH 04/11] move chmod to end of test --- .../java/octopus/teamcity/e2e/dsl/TeamCityFactory.java | 9 +-------- .../teamcity/e2e/test/BuildInformationEndToEndTest.java | 2 ++ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java b/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java index 01355371..b9d7e0ff 100644 --- a/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java +++ b/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java @@ -47,14 +47,7 @@ public TeamCityContainers createTeamCityServerAndAgent( final String serverUrl = String.format("http://host.testcontainers.internal:%d", octopusServerPort); Testcontainers.exposeHostPorts(octopusServerPort); - final TeamCityContainers container = - createTeamCityServerAndAgent(serverUrl, octopusServerApiKey, projectZipToInstall); - try { - container.getServerContainer().execInContainer("chmod -R 777 /data/teamcity_server/datadir"); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - return container; + return createTeamCityServerAndAgent(serverUrl, octopusServerApiKey, projectZipToInstall); } // When OctopusServer's URL can be fully specified diff --git a/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java b/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java index 9d0598ac..dcf37b54 100644 --- a/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java +++ b/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java @@ -112,6 +112,8 @@ public void buildInformationStepPublishesToOctopusDeploy(@TempDir Path testDirec LOG.info("Failed to execute build"); LOG.info(teamCityContainers.getAgentContainer().getLogs()); throw e; + } finally { + teamCityContainers.getServerContainer().execInContainer("chmod -R 777 /data/teamcity_server/datadir"); } } From 010b1f9a9ac4f3d6665f393c34557ddeda7bbd10 Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Sat, 16 Jul 2022 12:59:21 +1000 Subject: [PATCH 05/11] fix spotlesS --- .../teamcity/e2e/test/BuildInformationEndToEndTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java b/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java index dcf37b54..12f8040f 100644 --- a/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java +++ b/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java @@ -113,7 +113,9 @@ public void buildInformationStepPublishesToOctopusDeploy(@TempDir Path testDirec LOG.info(teamCityContainers.getAgentContainer().getLogs()); throw e; } finally { - teamCityContainers.getServerContainer().execInContainer("chmod -R 777 /data/teamcity_server/datadir"); + teamCityContainers + .getServerContainer() + .execInContainer("chmod -R 777 /data/teamcity_server/datadir"); } } From a0e5055f5a66aabd9aadadd80f48cdc33628dc7c Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Sat, 16 Jul 2022 13:32:06 +1000 Subject: [PATCH 06/11] maybe? --- e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java | 1 + 1 file changed, 1 insertion(+) diff --git a/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java b/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java index b9d7e0ff..373059da 100644 --- a/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java +++ b/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java @@ -95,6 +95,7 @@ private GenericContainer createAndStartServer() { .waitingFor(Wait.forLogMessage(".*Super user authentication token.*", 1)) .withNetwork(dockerNetwork) .withNetworkAliases("server") + .withCreateContainerCmdModifier(cmd -> cmd.withUser("1000")) .withEnv( "TEAMCITY_SERVER_OPTS", "-Droot.log.level=TRACE -Dteamcity.development.mode=true " From 6429a8bd62d255f9323ce31d007c762986b8986d Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Sat, 16 Jul 2022 15:34:49 +1000 Subject: [PATCH 07/11] try the copy --- .../java/octopus/teamcity/e2e/dsl/TeamCityFactory.java | 8 ++++---- .../teamcity/e2e/test/BuildInformationEndToEndTest.java | 4 ---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java b/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java index 373059da..188f78d5 100644 --- a/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java +++ b/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java @@ -26,6 +26,7 @@ import org.testcontainers.containers.Network; import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.utility.DockerImageName; +import org.testcontainers.utility.MountableFile; public class TeamCityFactory { @@ -101,10 +102,9 @@ private GenericContainer createAndStartServer() { "-Droot.log.level=TRACE -Dteamcity.development.mode=true " + "-Doctopus.enable.step.vnext=true") .withStartupTimeout(Duration.ofMinutes(2)) - .withFileSystemBind( - teamCityDataDir.toAbsolutePath().toString(), - "/data/teamcity_server/datadir", - BindMode.READ_WRITE); + .withCopyFileToContainer( + MountableFile.forHostPath(teamCityDataDir.toAbsolutePath().toString()), + "/data/teamcity_server/datadir"); teamCityServer.start(); return teamCityServer; diff --git a/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java b/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java index 12f8040f..9d0598ac 100644 --- a/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java +++ b/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java @@ -112,10 +112,6 @@ public void buildInformationStepPublishesToOctopusDeploy(@TempDir Path testDirec LOG.info("Failed to execute build"); LOG.info(teamCityContainers.getAgentContainer().getLogs()); throw e; - } finally { - teamCityContainers - .getServerContainer() - .execInContainer("chmod -R 777 /data/teamcity_server/datadir"); } } From f8f0a24292666e086db19ea069759fd0b1b0c67d Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Sat, 16 Jul 2022 15:37:33 +1000 Subject: [PATCH 08/11] fix spotless --- e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java | 1 - 1 file changed, 1 deletion(-) diff --git a/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java b/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java index 188f78d5..a1960c58 100644 --- a/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java +++ b/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java @@ -21,7 +21,6 @@ import org.jetbrains.teamcity.rest.TeamCityInstance; import org.jetbrains.teamcity.rest.TeamCityInstanceFactory; import org.testcontainers.Testcontainers; -import org.testcontainers.containers.BindMode; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.Network; import org.testcontainers.containers.wait.strategy.Wait; From c11ffe72cb1e730e0dc52bf1e45315c362657bcd Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Sat, 16 Jul 2022 15:49:04 +1000 Subject: [PATCH 09/11] think we pull tc images in parallel --- .../teamcity/e2e/dsl/TeamCityFactory.java | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java b/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java index a1960c58..c146120b 100644 --- a/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java +++ b/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java @@ -11,6 +11,10 @@ import java.nio.file.StandardCopyOption; import java.time.Duration; import java.util.Iterator; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; import com.google.common.io.Resources; import net.lingala.zip4j.ZipFile; @@ -36,6 +40,11 @@ public class TeamCityFactory { private final Path teamCityDataDir; private final Network dockerNetwork; + private final String TEAMCITY_SERVER_HOST = "server"; + private final int TEAMCITY_SERVER_PORT = 8111; + private final String TEAMCITY_SERVER_URL = String.format("https://%s:%s", TEAMCITY_SERVER_HOST, TEAMCITY_SERVER_PORT); + + public TeamCityFactory(final Path teamCityDataDir, final Network dockerNetwork) { this.teamCityDataDir = teamCityDataDir; this.dockerNetwork = dockerNetwork; @@ -55,7 +64,7 @@ public TeamCityContainers createTeamCityServerAndAgent( final String octopusServerUrl, final String octopusServerApiKey, final Path projectZipToInstall) - throws IOException, URISyntaxException { + throws IOException, URISyntaxException, ExecutionException, InterruptedException { setupDataDir(teamCityDataDir, projectZipToInstall); @@ -66,15 +75,19 @@ public TeamCityContainers createTeamCityServerAndAgent( teamCityDataDir.toString(), "config", "projects", "StepVnext", "project-config.xml"); updateProjectFile(projectFile, octopusServerUrl, octopusServerApiKey); - final GenericContainer teamCityServer = createAndStartServer(); + // Ensure containers are pulled in parallel + final ExecutorService executor = Executors.newFixedThreadPool(2); + final Future> teamcityServerFuture = executor.submit(this::createAndStartServer); + final Future> teamcityAgentFuture = executor.submit(this::createAndStartAgent); + final GenericContainer teamCityServer = teamcityServerFuture.get(); final String teamCityUrl = String.format( "http://%s:%d", teamCityServer.getHost(), teamCityServer.getFirstMappedPort()); LOG.info("TeamCity server running on {}", teamCityUrl); try { - final GenericContainer teamCityAgent = createAndStartAgent(); + final GenericContainer teamCityAgent = teamcityAgentFuture.get(); final String tcServerUrlOnHost = String.format("http://localhost:%d", teamCityServer.getFirstMappedPort()); @@ -91,7 +104,7 @@ public TeamCityContainers createTeamCityServerAndAgent( private GenericContainer createAndStartServer() { final GenericContainer teamCityServer = new GenericContainer<>(DockerImageName.parse("jetbrains/teamcity-server:2021.2.3")) - .withExposedPorts(8111) + .withExposedPorts(TEAMCITY_SERVER_PORT) .waitingFor(Wait.forLogMessage(".*Super user authentication token.*", 1)) .withNetwork(dockerNetwork) .withNetworkAliases("server") @@ -113,7 +126,7 @@ private GenericContainer createAndStartAgent() { final GenericContainer teamCityAgent = new GenericContainer<>(DockerImageName.parse("jetbrains/teamcity-agent:2021.2.3")) .withNetwork(dockerNetwork) - .withEnv("SERVER_URL", "http://server:8111") + .withEnv("SERVER_URL", TEAMCITY_SERVER_URL) .waitingFor(Wait.forLogMessage(".*jetbrains.buildServer.AGENT - Agent name was.*", 1)) .withStartupTimeout(Duration.ofMinutes(5)); teamCityAgent.start(); From adb1fdccc7b1db4a5a34e2244695ba1731aed313 Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Sat, 16 Jul 2022 16:52:29 +1000 Subject: [PATCH 10/11] parallel TC --- .../teamcity/e2e/dsl/TeamCityFactory.java | 28 +++++++++++-------- .../test/BuildInformationEndToEndTest.java | 4 +-- gradle/versions.gradle | 2 +- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java b/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java index c146120b..f1dff73b 100644 --- a/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java +++ b/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java @@ -42,7 +42,7 @@ public class TeamCityFactory { private final String TEAMCITY_SERVER_HOST = "server"; private final int TEAMCITY_SERVER_PORT = 8111; - private final String TEAMCITY_SERVER_URL = String.format("https://%s:%s", TEAMCITY_SERVER_HOST, TEAMCITY_SERVER_PORT); + private final String TEAMCITY_SERVER_URL = String.format("http://%s:%s", TEAMCITY_SERVER_HOST, TEAMCITY_SERVER_PORT); public TeamCityFactory(final Path teamCityDataDir, final Network dockerNetwork) { @@ -52,7 +52,7 @@ public TeamCityFactory(final Path teamCityDataDir, final Network dockerNetwork) public TeamCityContainers createTeamCityServerAndAgent( final int octopusServerPort, final String octopusServerApiKey, final Path projectZipToInstall) - throws IOException, URISyntaxException { + throws IOException, URISyntaxException, ExecutionException, InterruptedException { final String serverUrl = String.format("http://host.testcontainers.internal:%d", octopusServerPort); Testcontainers.exposeHostPorts(octopusServerPort); @@ -75,19 +75,23 @@ public TeamCityContainers createTeamCityServerAndAgent( teamCityDataDir.toString(), "config", "projects", "StepVnext", "project-config.xml"); updateProjectFile(projectFile, octopusServerUrl, octopusServerApiKey); - // Ensure containers are pulled in parallel - final ExecutorService executor = Executors.newFixedThreadPool(2); - final Future> teamcityServerFuture = executor.submit(this::createAndStartServer); - final Future> teamcityAgentFuture = executor.submit(this::createAndStartAgent); + final GenericContainer teamCityServer = createServerContainer(); + final GenericContainer teamCityAgent = createAgentContainer(); - final GenericContainer teamCityServer = teamcityServerFuture.get(); + // Need to pull the containers in parallel + final ExecutorService executor = Executors.newFixedThreadPool(5); + final Future teamcityServerFuture = executor.submit(teamCityServer::start); + final Future teamcityAgentFuture = executor.submit(teamCityAgent::start); + + //wait for teamcityServer to start + teamcityServerFuture.get(); final String teamCityUrl = String.format( "http://%s:%d", teamCityServer.getHost(), teamCityServer.getFirstMappedPort()); LOG.info("TeamCity server running on {}", teamCityUrl); try { - final GenericContainer teamCityAgent = teamcityAgentFuture.get(); + teamcityAgentFuture.get(); final String tcServerUrlOnHost = String.format("http://localhost:%d", teamCityServer.getFirstMappedPort()); @@ -96,12 +100,13 @@ public TeamCityContainers createTeamCityServerAndAgent( authoriseAgents(tcInstance); return new TeamCityContainers(teamCityServer, teamCityAgent, tcInstance); } catch (final Exception e) { + LOG.info(teamCityAgent.getLogs()); teamCityServer.stop(); throw e; } } - private GenericContainer createAndStartServer() { + private GenericContainer createServerContainer() { final GenericContainer teamCityServer = new GenericContainer<>(DockerImageName.parse("jetbrains/teamcity-server:2021.2.3")) .withExposedPorts(TEAMCITY_SERVER_PORT) @@ -118,18 +123,17 @@ private GenericContainer createAndStartServer() { MountableFile.forHostPath(teamCityDataDir.toAbsolutePath().toString()), "/data/teamcity_server/datadir"); - teamCityServer.start(); return teamCityServer; } - private GenericContainer createAndStartAgent() { + private GenericContainer createAgentContainer() { final GenericContainer teamCityAgent = new GenericContainer<>(DockerImageName.parse("jetbrains/teamcity-agent:2021.2.3")) .withNetwork(dockerNetwork) .withEnv("SERVER_URL", TEAMCITY_SERVER_URL) .waitingFor(Wait.forLogMessage(".*jetbrains.buildServer.AGENT - Agent name was.*", 1)) .withStartupTimeout(Duration.ofMinutes(5)); - teamCityAgent.start(); + return teamCityAgent; } diff --git a/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java b/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java index 9d0598ac..3bfa63e1 100644 --- a/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java +++ b/e2e/src/test/java/octopus/teamcity/e2e/test/BuildInformationEndToEndTest.java @@ -28,6 +28,7 @@ import java.time.Duration; import java.time.Instant; import java.util.List; +import java.util.concurrent.ExecutionException; import com.google.common.io.Resources; import octopus.teamcity.e2e.dsl.TeamCityContainers; @@ -53,7 +54,7 @@ public class BuildInformationEndToEndTest { @Test public void buildInformationStepPublishesToOctopusDeploy(@TempDir Path testDirectory) - throws InterruptedException, IOException, URISyntaxException { + throws InterruptedException, IOException, URISyntaxException, ExecutionException { final URL projectsImport = Resources.getResource("TeamCity_StepVnext.zip"); @@ -110,7 +111,6 @@ public void buildInformationStepPublishesToOctopusDeploy(@TempDir Path testDirec assertThat(items.get(0).getProperties().getPackageId()).isEqualTo("mypackage"); } catch (final Exception e) { LOG.info("Failed to execute build"); - LOG.info(teamCityContainers.getAgentContainer().getLogs()); throw e; } } diff --git a/gradle/versions.gradle b/gradle/versions.gradle index e0bd3cc8..c1e61d3b 100644 --- a/gradle/versions.gradle +++ b/gradle/versions.gradle @@ -40,7 +40,7 @@ dependencyManagement { entry 'error_prone_test_helpers' } - dependencySet(group: "org.testcontainers", version: '1.15.3') { + dependencySet(group: "org.testcontainers", version: '1.17.3') { entry 'testcontainers' entry 'junit-jupiter' } From 74350c92165c08d3404bf4dfaa6f28e49194452e Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Sat, 16 Jul 2022 16:57:50 +1000 Subject: [PATCH 11/11] fix spotless --- .../test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java b/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java index f1dff73b..7f593346 100644 --- a/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java +++ b/e2e/src/test/java/octopus/teamcity/e2e/dsl/TeamCityFactory.java @@ -42,8 +42,8 @@ public class TeamCityFactory { private final String TEAMCITY_SERVER_HOST = "server"; private final int TEAMCITY_SERVER_PORT = 8111; - private final String TEAMCITY_SERVER_URL = String.format("http://%s:%s", TEAMCITY_SERVER_HOST, TEAMCITY_SERVER_PORT); - + private final String TEAMCITY_SERVER_URL = + String.format("http://%s:%s", TEAMCITY_SERVER_HOST, TEAMCITY_SERVER_PORT); public TeamCityFactory(final Path teamCityDataDir, final Network dockerNetwork) { this.teamCityDataDir = teamCityDataDir; @@ -83,7 +83,7 @@ public TeamCityContainers createTeamCityServerAndAgent( final Future teamcityServerFuture = executor.submit(teamCityServer::start); final Future teamcityAgentFuture = executor.submit(teamCityAgent::start); - //wait for teamcityServer to start + // wait for teamcityServer to start teamcityServerFuture.get(); final String teamCityUrl = String.format(