Skip to content

Commit 78aa475

Browse files
seglobsideuprnorthcristiangrecodependabot[bot]
authored
Kafka cluster example (#1984)
* Simplify `KafkaContainerCluster#start` * When an image version is not specified, use `latest` as the default tag (#3313) * Add workflow for Update Gradle Wrapper Action. (#3297) Co-authored-by: Richard North <[email protected]> * Always continue on error for examples CI (#3339) * Bump snakeyaml from 1.25 to 1.27 in /core (#3252) Bumps [snakeyaml](https://bitbucket.org/asomov/snakeyaml) from 1.25 to 1.27. - [Commits](https://bitbucket.org/asomov/snakeyaml/branches/compare/snakeyaml-1.27..snakeyaml-1.25) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump lombok from 1.18.12 to 1.18.14 in /examples (#3322) Bumps [lombok](https://github.com/rzwitserloot/lombok) from 1.18.12 to 1.18.14. - [Release notes](https://github.com/rzwitserloot/lombok/releases) - [Changelog](https://github.com/rzwitserloot/lombok/blob/master/doc/changelog.markdown) - [Commits](projectlombok/lombok@v1.18.12...v1.18.14) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump r2dbc-mariadb from 0.8.3-beta1 to 0.8.4-rc in /modules/mariadb (#3300) Bumps [r2dbc-mariadb](https://github.com/mariadb-corporation/mariadb-connector-r2dbc) from 0.8.3-beta1 to 0.8.4-rc. - [Release notes](https://github.com/mariadb-corporation/mariadb-connector-r2dbc/releases) - [Changelog](https://github.com/mariadb-corporation/mariadb-connector-r2dbc/blob/master/CHANGELOG.md) - [Commits](https://github.com/mariadb-corporation/mariadb-connector-r2dbc/commits) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump testng from 7.2.0 to 7.3.0 in /examples (#3068) Bumps [testng](https://github.com/cbeust/testng) from 7.2.0 to 7.3.0. - [Release notes](https://github.com/cbeust/testng/releases) - [Changelog](https://github.com/cbeust/testng/blob/master/CHANGES.txt) - [Commits](https://github.com/cbeust/testng/commits) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump assertj-core from 3.17.1 to 3.17.2 in /core (#3251) Bumps [assertj-core](https://github.com/joel-costigliola/assertj-core) from 3.17.1 to 3.17.2. - [Release notes](https://github.com/joel-costigliola/assertj-core/releases) - [Commits](assertj/assertj@assertj-core-3.17.1...assertj-core-3.17.2) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump aws-java-sdk-dynamodb from 1.11.865 to 1.11.880 in /modules/dynalite (#3332) Bumps [aws-java-sdk-dynamodb](https://github.com/aws/aws-sdk-java) from 1.11.865 to 1.11.880. - [Release notes](https://github.com/aws/aws-sdk-java/releases) - [Changelog](https://github.com/aws/aws-sdk-java/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-java@1.11.865...1.11.880) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump mockito-core from 3.5.11 to 3.5.13 in /core (#3275) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump elasticsearch-rest-client from 7.9.1 to 7.9.2 in /modules/elasticsearch (#3276) Bumps [elasticsearch-rest-client](https://github.com/elastic/elasticsearch) from 7.9.1 to 7.9.2. - [Release notes](https://github.com/elastic/elasticsearch/releases) - [Commits](elastic/elasticsearch@v7.9.1...v7.9.2) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Increase memory limits used in example (#3340) For improved test stability * Bump mockito-core from 3.5.11 to 3.5.13 in /modules/junit-jupiter (#3283) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Richard North <[email protected]> * Bump tomcat-jdbc from 9.0.37 to 9.0.39 in /modules/jdbc-test (#3338) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Richard North <[email protected]> * Bump junit from 4.13 to 4.13.1 in /examples (#3328) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Richard North <[email protected]> * Bump mariadb-java-client from 2.6.2 to 2.7.0 in /modules/mariadb (#3278) Bumps [mariadb-java-client](https://github.com/mariadb-corporation/mariadb-connector-j) from 2.6.2 to 2.7.0. - [Release notes](https://github.com/mariadb-corporation/mariadb-connector-j/releases) - [Changelog](https://github.com/mariadb-corporation/mariadb-connector-j/blob/master/CHANGELOG.md) - [Commits](mariadb-corporation/mariadb-connector-j@2.6.2...2.7.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump solr-solrj from 8.6.2 to 8.6.3 in /examples (#3321) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Richard North <[email protected]> * Bump postgresql from 42.2.16 to 42.2.17 in /examples (#3323) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Richard North <[email protected]> * Bump postgresql from 42.2.16 to 42.2.17 in /modules/junit-jupiter (#3327) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Richard North <[email protected]> * Bump postgresql from 42.2.16 to 42.2.17 in /modules/spock (#3330) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Richard North <[email protected]> * Bump tomcat-jdbc from 9.0.37 to 9.0.39 in /modules/jdbc (#3333) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Richard North <[email protected]> * Bump postgresql from 42.2.16 to 42.2.17 in /modules/postgresql (#3334) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Richard North <[email protected]> * Bump aws-java-sdk-sqs from 1.11.860 to 1.11.880 in /modules/localstack (#3337) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Richard North <[email protected]> * Bump httpclient from 4.5.12 to 4.5.13 in /modules/junit-jupiter (#3326) Bumps httpclient from 4.5.12 to 4.5.13. Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump httpclient from 4.5.12 to 4.5.13 in /modules/spock (#3329) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Richard North <[email protected]> * Bump cucumber-junit from 6.7.0 to 6.8.1 in /examples (#3325) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Richard North <[email protected]> * Bump org.springframework.boot from 2.3.3.RELEASE to 2.3.4.RELEASE in /examples (#3247) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Richard North <[email protected]> * Bump aws-java-sdk-s3 from 1.11.870 to 1.11.880 in /modules/localstack (#3336) Bumps [aws-java-sdk-s3](https://github.com/aws/aws-sdk-java) from 1.11.870 to 1.11.880. - [Release notes](https://github.com/aws/aws-sdk-java/releases) - [Changelog](https://github.com/aws/aws-sdk-java/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-java@1.11.870...1.11.880) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump zt-exec from 1.10 to 1.12 in /core (#3253) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Richard North <[email protected]> * Bump s3 from 2.14.21 to 2.15.7 in /modules/localstack (#3335) Bumps s3 from 2.14.21 to 2.15.7. Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump cucumber-java from 6.6.0 to 6.8.1 in /examples (#3324) Bumps [cucumber-java](https://github.com/cucumber/cucumber-jvm) from 6.6.0 to 6.8.1. - [Release notes](https://github.com/cucumber/cucumber-jvm/releases) - [Changelog](https://github.com/cucumber/cucumber-jvm/blob/main/CHANGELOG.md) - [Commits](cucumber/cucumber-jvm@v6.6.0...v6.8.1) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Remove GitHub Actions cache restore keys (#3342) For more specific cache matching * Allow users to specify a MongoDB database name (#2980) Co-authored-by: Richard North <[email protected]> * Add GCloud module for Google Cloud Datastore, Firestore, PubSub, and Spanner emulators (#2690) Co-authored-by: Richard North <[email protected]> * Use a lighter weight image for MultiplePortsExposedTest (#3343) * Use a lighter weight image for MultiplePortsExposedTest * Update helloworld container version * docker-machine: get full remote daemon URL, to allow for use of custom daemon port (#2769) (#3237) Co-authored-by: Vitalii Chura <[email protected]> * Fix remote gradle cache 400 InvalidArgument error (#3346) per hint given in https://www.digitalocean.com/community/questions/node-upload-file-to-s3-error-invalidargument-null * Add gcloud endpoint accessors (#3344) Co-authored-by: Sergei Egorov <[email protected]> Co-authored-by: Richard North <[email protected]> Co-authored-by: Cristian Greco <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: silaev <[email protected]> Co-authored-by: Eddú Meléndez Gonzales <[email protected]> Co-authored-by: vcvitaly <[email protected]> Co-authored-by: Vitalii Chura <[email protected]>
1 parent 45ae825 commit 78aa475

File tree

47 files changed

+669
-66
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+669
-66
lines changed

.github/workflows/ci-examples.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ jobs:
2020
java-version: '1.8'
2121
- name: Cache Gradle Home files
2222
uses: actions/cache@v1
23+
continue-on-error: true
2324
with:
2425
path: ~/.gradle/caches
2526
key: ${{ runner.os }}-gradle-home-testmatrix-examples-${{ hashFiles('**/*.gradle') }}
26-
restore-keys: |
27-
${{ runner.os }}-gradle-home-testmatrix-examples-
2827
- id: set-matrix
2928
working-directory: ./examples/
3029
env:
@@ -48,11 +47,10 @@ jobs:
4847
java-version: '1.8'
4948
- name: Cache Gradle Home files
5049
uses: actions/cache@v1
50+
continue-on-error: true
5151
with:
5252
path: ~/.gradle/caches
5353
key: ${{ runner.os }}-gradle-home-examples-${{matrix.gradle_args}}_check-${{ hashFiles('**/*.gradle') }}
54-
restore-keys: |
55-
${{ runner.os }}-gradle-home-examples-${{matrix.gradle_args}}_check-
5654
- name: Clear existing docker image cache
5755
run: docker image prune -af
5856
- name: Build and test Examples with Gradle (${{matrix.gradle_args}})

.github/workflows/ci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ jobs:
2323
with:
2424
path: ~/.gradle/caches
2525
key: ${{ runner.os }}-gradle-home-testmatrix-${{ hashFiles('**/*.gradle') }}
26-
restore-keys: |
27-
${{ runner.os }}-gradle-home-testmatrix-
2826
- id: set-matrix
2927
env:
3028
# Since we override the tests executor,
@@ -51,8 +49,6 @@ jobs:
5149
with:
5250
path: ~/.gradle/caches
5351
key: ${{ runner.os }}-gradle-home-${{matrix.gradle_args}}_check-${{ hashFiles('**/*.gradle') }}
54-
restore-keys: |
55-
${{ runner.os }}-gradle-home-${{matrix.gradle_args}}_check-
5652
- name: Clear existing docker image cache
5753
run: docker image prune -af
5854
- name: Build and test with Gradle (${{matrix.gradle_args}})
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Update Gradle Wrapper
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
7+
jobs:
8+
update-gradle-wrapper:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Update Gradle Wrapper
15+
uses: gradle-update/update-gradle-wrapper-action@74a035c
16+
with:
17+
repo-token: ${{ secrets.GITHUB_TOKEN }}
18+
labels: dependencies
19+
20+
- uses: gradle/wrapper-validation-action@e2c57ac

core/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ dependencies {
192192

193193
compile 'com.github.docker-java:docker-java-transport-zerodep:3.2.5'
194194

195-
shaded "org.yaml:snakeyaml:1.25"
195+
shaded "org.yaml:snakeyaml:1.27"
196196

197197
shaded 'org.glassfish.main.external:trilead-ssh2-repackaged:4.1.2'
198198

199-
shaded 'org.zeroturnaround:zt-exec:1.10', {
199+
shaded 'org.zeroturnaround:zt-exec:1.12', {
200200
exclude(group: 'org.slf4j')
201201
}
202202

@@ -205,13 +205,13 @@ dependencies {
205205
testCompile 'com.rabbitmq:amqp-client:5.9.0'
206206
testCompile 'org.mongodb:mongo-java-driver:3.12.7'
207207

208-
testCompile ('org.mockito:mockito-core:3.5.11') {
208+
testCompile ('org.mockito:mockito-core:3.5.13') {
209209
exclude(module: 'hamcrest-core')
210210
}
211211
// Synthetic JAR used for MountableFileTest and DirectoryTarResourceTest
212212
testCompile files('testlib/repo/fakejar/fakejar/0/fakejar-0.jar')
213213

214-
testCompile 'org.assertj:assertj-core:3.17.1'
214+
testCompile 'org.assertj:assertj-core:3.17.2'
215215
testCompile project(':test-support')
216216

217217
jarFileTestCompileOnly "org.projectlombok:lombok:${lombok.version}"

core/src/main/java/org/testcontainers/dockerclient/DockerMachineClientProviderStrategy.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ private TransportConfig resolveTransportConfig() throws InvalidConfigurationExce
3737

3838
DockerMachineClient.instance().ensureMachineRunning(machineName);
3939

40-
String dockerDaemonIpAddress = DockerMachineClient.instance().getDockerDaemonIpAddress(machineName);
40+
String dockerDaemonUrl = DockerMachineClient.instance().getDockerDaemonUrl(machineName);
4141

42-
log.info("Docker daemon IP address for docker machine {} is {}", machineName, dockerDaemonIpAddress);
42+
log.info("Docker daemon URL for docker machine {} is {}", machineName, dockerDaemonUrl);
4343

4444
return TransportConfig.builder()
45-
.dockerHost(URI.create("tcp://" + dockerDaemonIpAddress + ":2376"))
45+
.dockerHost(URI.create(dockerDaemonUrl))
4646
.sslConfig(
4747
new LocalDirectorySSLConfig(
4848
Paths.get(System.getProperty("user.home") + "/.docker/machine/certs/").toString()

core/src/main/java/org/testcontainers/utility/DockerMachineClient.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,18 @@ public void ensureMachineRunning(@NonNull String machineName) {
7979
}
8080
}
8181

82+
/**
83+
* @deprecated Use getDockerDaemonUrl(@NonNull String machineName) for connection to docker-machine
84+
*/
85+
@Deprecated
8286
public String getDockerDaemonIpAddress(@NonNull String machineName) {
8387
return runShellCommand(executableName, "ip", machineName);
8488
}
8589

90+
public String getDockerDaemonUrl(@NonNull String machineName) {
91+
return runShellCommand(executableName, "url", machineName);
92+
}
93+
8694
public boolean isMachineRunning(String machineName) {
8795
String status = runShellCommand("docker-machine", "status", machineName);
8896
return status.trim().equalsIgnoreCase("running");

core/src/main/java/org/testcontainers/utility/Versioning.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ public boolean isValid() {
2424

2525
@Override
2626
public String getSeparator() {
27-
return "";
27+
return ":";
2828
}
2929

3030
@Override
3131
public String toString() {
32-
return "";
32+
return "latest";
3333
}
3434

3535
@Override
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package org.testcontainers.dockerclient;
2+
3+
import com.github.dockerjava.api.DockerClient;
4+
import com.github.dockerjava.api.model.Image;
5+
import org.junit.Test;
6+
import org.testcontainers.DockerClientFactory;
7+
import org.testcontainers.containers.GenericContainer;
8+
import org.testcontainers.containers.startupcheck.OneShotStartupCheckStrategy;
9+
import org.testcontainers.utility.DockerImageName;
10+
11+
import java.util.List;
12+
13+
public class AmbiguousImagePullTest {
14+
15+
@Test(timeout = 30_000)
16+
public void testNotUsingParse() {
17+
DockerClient client = DockerClientFactory.instance().client();
18+
List<Image> alpineImages = client.listImagesCmd()
19+
.withImageNameFilter("alpine:latest")
20+
.exec();
21+
for (Image alpineImage : alpineImages) {
22+
client.removeImageCmd(alpineImage.getId()).exec();
23+
}
24+
25+
try (
26+
final GenericContainer<?> container = new GenericContainer<>(DockerImageName.parse("alpine"))
27+
.withCommand("/bin/sh", "-c", "sleep 0")
28+
.withStartupCheckStrategy(new OneShotStartupCheckStrategy())
29+
) {
30+
container.start();
31+
// do nothing other than start and stop
32+
}
33+
}
34+
}

core/src/test/java/org/testcontainers/utility/DockerImageNameTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public void testParsing() {
112112
canonicalName = unversionedPart + versionSeparator + version;
113113
} else {
114114
combined = unversionedPart;
115-
canonicalName = unversionedPart;
115+
canonicalName = unversionedPart + ":latest";
116116
}
117117

118118
VisibleAssertions.context("For " + combined);
@@ -124,7 +124,7 @@ public void testParsing() {
124124
if (version != null) {
125125
assertEquals(combined + " has version part: " + version, version, imageName.getVersionPart());
126126
} else {
127-
assertEquals(combined + " has no version specified", "", imageName.getVersionPart());
127+
assertEquals(combined + " has automatic 'latest' version specified", "latest", imageName.getVersionPart());
128128
}
129129
assertEquals(combined + " has canonical name: " + canonicalName, canonicalName, imageName.asCanonicalNameString());
130130

docs/examples/junit4/generic/src/test/java/generic/CmdModifierTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public class CmdModifierTest {
1919
// }
2020

2121
// memory {
22-
private long memoryInBytes = 8 * 1024 * 1024;
23-
private long memorySwapInBytes = 12 * 1024 * 1024;
22+
private long memoryInBytes = 32 * 1024 * 1024;
23+
private long memorySwapInBytes = 64 * 1024 * 1024;
2424

2525
@Rule
2626
public GenericContainer memoryLimitedRedis = new GenericContainer<>(DockerImageName.parse("redis:3.0.2"))
@@ -40,6 +40,6 @@ public void testHostnameModified() throws IOException, InterruptedException {
4040
@Test
4141
public void testMemoryLimitModified() throws IOException, InterruptedException {
4242
final Container.ExecResult execResult = memoryLimitedRedis.execInContainer("cat", "/sys/fs/cgroup/memory/memory.limit_in_bytes");
43-
assertEquals("8388608", execResult.getStdout().trim());
43+
assertEquals(String.valueOf(memoryInBytes), execResult.getStdout().trim());
4444
}
4545
}

0 commit comments

Comments
 (0)