@Override public void build() throws IOException, InterruptedException { dockerCompose.build(); }
@Override public void build() throws IOException, InterruptedException { dockerCompose.build(); }
@Override public void build() throws IOException, InterruptedException { dockerCompose.build(); }
void before(ExtensionContext extensionContext, Class<?> testClass, Compose compose) throws Exception { final ExtensionContext.Namespace namespace = namespace(extensionContext); ExtensionContext.Store store = extensionContext.getStore(namespace); DockerCompose dockerCompose = dockerCompose(store, compose); LogCollector logCollector = logCollector(extensionContext, testClass, store, compose); dockerCompose.build(); dockerCompose.up(); logCollector.startCollecting(dockerCompose); Cluster cluster = cluster(store, compose); log.debug("Waiting for services"); final List<ClusterWait> clusterWaits = new ArrayList<ClusterWait>(); clusterWaits.add( new ClusterWait(ClusterHealthCheck.nativeHealthChecks(), Duration.standardSeconds(compose.clusterHealthCheckTimeout())) ); clusterWaits.add(healthCheck(compose)); clusterWaits.forEach(clusterWait -> clusterWait.waitUntilReady(cluster)); log.debug("docker-compose cluster started"); }
@Test public void call_build_and_up_before_tests_are_run() throws IOException, InterruptedException { rule.before(); verify(dockerCompose).build(); verify(dockerCompose).up(); }
@Override public void before() throws IOException, InterruptedException { log.debug("Starting docker-compose cluster"); dockerCompose().build(); DockerCompose upDockerCompose = dockerCompose(); if (removeConflictingContainersOnStartup()) { upDockerCompose = new ConflictingContainerRemovingDockerCompose(upDockerCompose, docker()); } upDockerCompose.up(); logCollector().startCollecting(dockerCompose()); log.debug("Waiting for services"); clusterWaits().forEach(clusterWait -> clusterWait.waitUntilReady(containers())); log.debug("docker-compose cluster started"); }
@Override public void before() throws IOException, InterruptedException { log.debug("Starting docker-compose cluster"); dockerCompose().build(); DockerCompose upDockerCompose = dockerCompose(); if (removeConflictingContainersOnStartup()) { upDockerCompose = new ConflictingContainerRemovingDockerCompose(upDockerCompose, docker()); } upDockerCompose.up(); logCollector().startCollecting(dockerCompose()); log.debug("Waiting for services"); clusterWaits().forEach(clusterWait -> clusterWait.waitUntilReady(containers())); log.debug("docker-compose cluster started"); }
@Test public void calls_pull_build_and_up_when_tests_are_run_and_pullOnStartup_is_true() throws InterruptedException, IOException { defaultBuilder().pullOnStartup(true) .build() .before(); verify(dockerCompose).pull(); verify(dockerCompose).build(); verify(dockerCompose).up(); }
@Override public void before() throws IOException, InterruptedException { log.debug("Starting docker-compose cluster"); if (pullOnStartup()) { dockerCompose().pull(); } dockerCompose().build(); DockerCompose upDockerCompose = dockerCompose(); if (removeConflictingContainersOnStartup()) { upDockerCompose = new ConflictingContainerRemovingDockerCompose(upDockerCompose, docker()); } upDockerCompose.up(); logCollector().startCollecting(dockerCompose()); log.debug("Waiting for services"); new ClusterWait(ClusterHealthCheck.nativeHealthChecks(), nativeServiceHealthCheckTimeout()) .waitUntilReady(containers()); clusterWaits().forEach(clusterWait -> clusterWait.waitUntilReady(containers())); log.debug("docker-compose cluster started"); }