Skip to content

Commit 3588e21

Browse files
authored
Merge branch 'master' into selenium-refactoring
2 parents cbd9426 + a715548 commit 3588e21

File tree

48 files changed

+160
-116
lines changed

Some content is hidden

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

48 files changed

+160
-116
lines changed

.github/workflows/ci-examples.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
env:
88
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
99
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
10+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
11+
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
1012

1113
jobs:
1214
find_gradle_jobs:
@@ -15,12 +17,12 @@ jobs:
1517
matrix: ${{ steps.set-matrix.outputs.matrix }}
1618
steps:
1719
- uses: actions/checkout@v2
18-
- uses: actions/setup-java@v2.3.1
20+
- uses: actions/setup-java@v2.4.0
1921
with:
2022
java-version: '8.0.302'
2123
distribution: temurin
2224
- name: Cache Gradle Home files
23-
uses: actions/[email protected].6
25+
uses: actions/[email protected].7
2426
continue-on-error: true
2527
with:
2628
path: ~/.gradle/caches
@@ -43,12 +45,12 @@ jobs:
4345
runs-on: ubuntu-18.04
4446
steps:
4547
- uses: actions/checkout@v2
46-
- uses: actions/setup-java@v2.3.1
48+
- uses: actions/setup-java@v2.4.0
4749
with:
4850
java-version: '8.0.302'
4951
distribution: temurin
5052
- name: Cache Gradle Home files
51-
uses: actions/[email protected].6
53+
uses: actions/[email protected].7
5254
continue-on-error: true
5355
with:
5456
path: ~/.gradle/caches

.github/workflows/ci.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
env:
88
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
99
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
10+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
11+
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
1012

1113
jobs:
1214
thundra_test_initializer:
@@ -23,12 +25,12 @@ jobs:
2325
matrix: ${{ steps.set-matrix.outputs.matrix }}
2426
steps:
2527
- uses: actions/checkout@v2
26-
- uses: actions/setup-java@v2.3.1
28+
- uses: actions/setup-java@v2.4.0
2729
with:
2830
java-version: '8.0.302'
2931
distribution: temurin
3032
- name: Cache Gradle Home files
31-
uses: actions/[email protected].6
33+
uses: actions/[email protected].7
3234
with:
3335
path: ~/.gradle/caches
3436
key: ${{ runner.os }}-gradle-home-testmatrix-${{ hashFiles('**/*.gradle') }}
@@ -49,12 +51,12 @@ jobs:
4951
runs-on: ubuntu-18.04
5052
steps:
5153
- uses: actions/checkout@v2
52-
- uses: actions/setup-java@v2.3.1
54+
- uses: actions/setup-java@v2.4.0
5355
with:
5456
java-version: '8.0.302'
5557
distribution: temurin
5658
- name: Cache Gradle Home files
57-
uses: actions/[email protected].6
59+
uses: actions/[email protected].7
5860
continue-on-error: true
5961
with:
6062
path: ~/.gradle/caches
@@ -73,4 +75,4 @@ jobs:
7375
$([[ -f $THUNDRA_GRADLE_INIT_SCRIPT_PATH ]] && echo "--init-script $THUNDRA_GRADLE_INIT_SCRIPT_PATH")
7476
env:
7577
THUNDRA_AGENT_TEST_RUN_ID: ${{ needs.thundra_test_initializer.outputs.thundra_agent_testrun_id }}
76-
THUNDRA_AGENT_REPORT_REST_BASEURL: https://collector.thundra.us/v1
78+
THUNDRA_AGENT_REPORT_REST_BASEURL: https://collector.thundra.us/v1

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-18.04
1414
steps:
1515
- uses: actions/checkout@v2
16-
- uses: actions/setup-java@v2.3.1
16+
- uses: actions/setup-java@v2.4.0
1717
with:
1818
java-version: '8.0.302'
1919
distribution: temurin

.github/workflows/update-docs-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
sed -i "s/latest_version: .*/latest_version: ${GITHUB_REF##*/}/g" mkdocs.yml
1818
git diff
1919
- name: Create Pull Request
20-
uses: peter-evans/create-pull-request@3c3d696d5b8aa2eb0e70f76c251e4b149122acf1 # v3.10.1
20+
uses: peter-evans/create-pull-request@67df31e08a133c6a77008b89689677067fef169e # v3.10.1
2121
with:
2222
title: Update docs version to ${GITHUB_REF##*/}
2323
body: |

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,6 @@ src/mkdocs-codeinclude-plugin
6464
src/pip-delete-this-directory.txt
6565

6666
.DS_Store
67+
68+
# Codespaces / VSCode
69+
/.vscode/

build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,14 @@ subprojects {
4646
task delombok(type: io.franzbecker.gradle.lombok.task.DelombokTask) {
4747
def outputDir = file("$buildDir/delombok")
4848
outputs.dir(outputDir)
49+
outputs.cacheIf {
50+
true
51+
}
4952
for (srcDir in project.sourceSets.main.java.srcDirs) {
53+
// TODO: named input and relative path for `srcDir` to make task more cacheable
5054
inputs.dir(srcDir)
51-
args(srcDir, "-d", outputDir)
55+
// TODO: `outputDir` as relative path to make task more cacheable
56+
args(srcDir, "-d", outputDir, "-f", "generateDelombokComment:skip")
5257
}
5358
}
5459
delombok.onlyIf {

core/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,20 @@ configurations.all {
5353
}
5454

5555
dependencies {
56-
baseline 'org.testcontainers:testcontainers:1.16.0', {
56+
baseline 'org.testcontainers:testcontainers:1.16.2', {
5757
exclude group: "*", module: "*"
5858
}
5959

6060
api 'junit:junit:4.13.2'
6161
api 'org.slf4j:slf4j-api:1.7.32'
62-
compileOnly 'org.jetbrains:annotations:22.0.0'
63-
testCompileClasspath 'org.jetbrains:annotations:21.0.1'
62+
compileOnly 'org.jetbrains:annotations:23.0.0'
63+
testCompileClasspath 'org.jetbrains:annotations:23.0.0'
6464
api 'org.apache.commons:commons-compress:1.21'
6565
api ('org.rnorth.duct-tape:duct-tape:1.0.8') {
6666
exclude(group: 'org.jetbrains', module: 'annotations')
6767
}
6868

69-
shaded 'org.awaitility:awaitility:4.1.0'
69+
shaded 'org.awaitility:awaitility:4.1.1'
7070

7171
api platform('com.github.docker-java:docker-java-bom:3.2.12')
7272
shaded platform('com.github.docker-java:docker-java-bom:3.2.12')
@@ -90,10 +90,10 @@ dependencies {
9090

9191
testImplementation 'org.apache.httpcomponents:httpclient:4.5.9'
9292
testImplementation 'redis.clients:jedis:3.7.0'
93-
testImplementation 'com.rabbitmq:amqp-client:5.13.1'
93+
testImplementation 'com.rabbitmq:amqp-client:5.14.0'
9494
testImplementation 'org.mongodb:mongo-java-driver:3.12.10'
9595

96-
testImplementation ('org.mockito:mockito-core:3.12.4') {
96+
testImplementation ('org.mockito:mockito-core:4.1.0') {
9797
exclude(module: 'hamcrest-core')
9898
}
9999
// Synthetic JAR used for MountableFileTest and DirectoryTarResourceTest

core/src/main/java/org/testcontainers/containers/wait/internal/ExternalPortListeningCheck.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.testcontainers.containers.ContainerState;
55

66
import java.io.IOException;
7+
import java.net.InetSocketAddress;
78
import java.net.Socket;
89
import java.util.Set;
910
import java.util.concurrent.Callable;
@@ -21,8 +22,9 @@ public Boolean call() {
2122
String address = containerState.getHost();
2223

2324
externalLivenessCheckPorts.parallelStream().forEach(externalPort -> {
24-
try {
25-
new Socket(address, externalPort).close();
25+
try (Socket socket = new Socket()) {
26+
InetSocketAddress inetSocketAddress = new InetSocketAddress(address, externalPort);
27+
socket.connect(inetSocketAddress, 1000);
2628
} catch (IOException e) {
2729
throw new IllegalStateException("Socket not listening yet: " + externalPort);
2830
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.github.dockerjava.api.model.AuthConfig;
66
import com.google.common.annotations.VisibleForTesting;
77
import org.apache.commons.lang.StringUtils;
8+
import org.apache.commons.lang.SystemUtils;
89
import org.slf4j.Logger;
910
import org.zeroturnaround.exec.InvalidResultException;
1011
import org.zeroturnaround.exec.ProcessExecutor;
@@ -337,8 +338,9 @@ private String extractCredentialProviderErrorMessage(InvalidResultException inva
337338
private String runCredentialProgram(String hostName, String credentialHelperName)
338339
throws InvalidResultException, InterruptedException, TimeoutException, IOException {
339340

341+
String[] command = SystemUtils.IS_OS_WINDOWS ? new String[] {"cmd", "/c", credentialHelperName, "get"} : new String[]{credentialHelperName, "get"};
340342
return new ProcessExecutor()
341-
.command(credentialHelperName, "get")
343+
.command(command)
342344
.redirectInput(new ByteArrayInputStream(hostName.getBytes()))
343345
.readOutput(true)
344346
.exitValueNormal()

docs/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Testcontainers make the following kinds of tests easier:
1010

1111
* **Data access layer integration tests**: use a containerized instance of a MySQL, PostgreSQL or Oracle database to test your data access layer code for complete compatibility, but without requiring complex setup on developers' machines and safe in the knowledge that your tests will always start with a known DB state. Any other database type that can be containerized can also be used.
1212
* **Application integration tests**: for running your application in a short-lived test mode with dependencies, such as databases, message queues or web servers.
13-
* **UI/Acceptance tests**: use containerized web browsers, compatible with Selenium, for conducting automated UI tests. Each test can get a fresh instance of the browser, with no browser state, plugin variations or automated browser upgrades to worry about. And you get a video recording of each test session, or just each session where tests failed.
13+
* **UI/Acceptance tests**: use [containerized web browsers](modules/webdriver_containers.md), compatible with Selenium, for conducting automated UI tests. Each test can get a fresh instance of the browser, with no browser state, plugin variations or automated browser upgrades to worry about. And you get a video recording of each test session, or just each session where tests failed.
1414
* **Much more!** Check out the various contributed modules or create your own custom container classes using [`GenericContainer`](features/creating_container.md) as a base.
1515

1616
## Prerequisites
@@ -65,6 +65,7 @@ Using Maven you can add the following to `dependencyManagement` section in your
6565
</dependencies>
6666
</dependencyManagement>
6767
```
68+
6869
and then use dependencies without specifying a version:
6970

7071
```xml tab='Maven'

0 commit comments

Comments
 (0)