Skip to content

Commit 22828e6

Browse files
authored
Merge branch 'main' into couchbase-retry-createPrimaryIndex
2 parents 95cf8e7 + 92a475d commit 22828e6

File tree

28 files changed

+726
-129
lines changed

28 files changed

+726
-129
lines changed

.github/workflows/ci-rootless.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ jobs:
4848
steps:
4949
- uses: actions/checkout@v4
5050
- name: Setup rootless Docker
51-
uses: ScribeMD/rootless-docker@0.2.2
52-
- name: Remove Docket root socket
53-
run: sudo rm -rf /var/run/docker.sock
51+
uses: docker/setup-docker-action@v4
52+
with:
53+
rootless: true
5454
- name: Setup Gradle Build Action
5555
uses: gradle/actions/setup-gradle@v4
5656
- name: Build with Gradle

.github/workflows/moby-latest.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,31 @@ jobs:
1313
test_docker:
1414
strategy:
1515
matrix:
16-
install-docker-type: ["STABLE", "ROOTLESS", "ROOTFUL"]
17-
name: "Core tests using Docker ${{ matrix.install-docker-type }}"
16+
include:
17+
- { install-docker-type: "STABLE", channel: stable, rootless: false }
18+
- { install-docker-type: "ROOTLESS", channel: stable, rootless: true }
19+
- { install-docker-type: "ROOTFUL", channel: test, rootless: false }
20+
name: "Core tests using Docker ${{ matrix.install-docker-type }} (channel ${{ matrix.channel }})"
1821
runs-on: ubuntu-22.04
1922
continue-on-error: true
2023
steps:
2124
- uses: actions/checkout@v4
2225
- uses: ./.github/actions/setup-build
2326

2427
- name: Install Stable Docker
25-
if: ${{ matrix.install-docker-type == 'STABLE' }}
26-
run: curl https://get.docker.com
27-
28-
- name: Install Docker from the TEST channel
29-
if: ${{ matrix.install-docker-type == 'ROOTFUL' }}
30-
run: curl https://get.docker.com | CHANNEL=test sh
31-
32-
- name: Setup rootless Docker
33-
if: ${{ matrix.install-docker-type == 'ROOTLESS' }}
34-
uses: ScribeMD/rootless-docker@6bd157a512c2fafa4e0243a8aa87d964eb890886 # v0.2.2
35-
36-
- name: Remove Docker root socket
37-
if: ${{ matrix.install-docker-type == 'ROOTLESS' }}
38-
run: sudo rm -rf /var/run/docker.sock
28+
id: setup_docker
29+
uses: docker/setup-docker-action@v4
30+
with:
31+
channel: ${{ matrix.channel }}
32+
rootless: ${{ matrix.rootless }}
3933

4034
- name: Check Docker version
4135
run: docker version
4236

4337
- name: Build with Gradle
4438
run: ./gradlew cleanTest --no-daemon --continue --scan -Dscan.tag.DOCKER_${{ matrix.install-docker-type }} testcontainers:test -Dorg.gradle.caching=false
39+
env:
40+
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
4541
- uses: ./.github/actions/setup-junit-report
4642

4743
- name: Notify to Slack on failures

core/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ dependencies {
8888

8989
shaded 'org.awaitility:awaitility:4.2.0'
9090

91-
api platform('com.github.docker-java:docker-java-bom:3.4.0')
92-
shaded platform('com.github.docker-java:docker-java-bom:3.4.0')
91+
api platform('com.github.docker-java:docker-java-bom:3.4.1')
92+
shaded platform('com.github.docker-java:docker-java-bom:3.4.1')
9393

9494
api "com.github.docker-java:docker-java-api"
9595

core/src/test/java/org/testcontainers/containers/GenericContainerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class GenericContainerTest {
5252
public void shouldReportOOMAfterWait() {
5353
Info info = DockerClientFactory.instance().client().infoCmd().exec();
5454
// Poor man's rootless Docker detection :D
55-
Assumptions.assumeThat(info.getSecurityOptions()).doesNotContain("rootless");
55+
Assumptions.assumeThat(info.getSecurityOptions()).doesNotContain("name=rootless");
5656
try (
5757
GenericContainer<?> container = new GenericContainer<>(TestImages.TINY_IMAGE)
5858
.withStartupCheckStrategy(new NoopStartupCheckStrategy())

core/src/test/java/org/testcontainers/dockerclient/EnvironmentAndSystemPropertyClientProviderStrategyTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.util.Properties;
1919

2020
import static org.assertj.core.api.Assertions.assertThat;
21+
import static org.assertj.core.api.Assumptions.assumeThat;
2122
import static org.mockito.ArgumentMatchers.anyString;
2223
import static org.mockito.ArgumentMatchers.eq;
2324
import static org.mockito.ArgumentMatchers.isNull;
@@ -147,6 +148,8 @@ public void applicableWhenIgnoringUserPropertiesAndConfigured() {
147148

148149
@Test
149150
public void notApplicableWhenIgnoringUserPropertiesAndNotConfigured() {
151+
assumeThat(System.getenv("DOCKER_HOST")).isNull();
152+
150153
Mockito
151154
.doReturn("autoIgnoringUserProperties")
152155
.when(TestcontainersConfiguration.getInstance())

docs/examples/junit4/generic/build.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,3 @@ dependencies {
1010
testImplementation "org.seleniumhq.selenium:selenium-api:4.25.0"
1111
testImplementation 'org.assertj:assertj-core:3.26.3'
1212
}
13-
14-
test {
15-
javaLauncher = javaToolchains.launcherFor {
16-
languageVersion = JavaLanguageVersion.of(11)
17-
}
18-
}
19-
20-
compileTestJava {
21-
javaCompiler = javaToolchains.compilerFor {
22-
languageVersion = JavaLanguageVersion.of(11)
23-
}
24-
options.release.set(11)
25-
}

docs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ A huge thank you to our sponsors:
221221
* [Spark ClickHouse Connector](https://github.com/housepower/spark-clickhouse-connector) - Integration tests for Apache Spark with both single node ClickHouse instance and multi-node ClickHouse cluster.
222222
* [Quarkus](https://github.com/quarkusio/quarkus) - Testcontainers is used extensively for Quarkus' [DevServices](https://quarkus.io/guides/dev-services) feature.
223223
* [Apache Kyuubi](https://kyuubi.apache.org) - Integration testing with Trino as data source engine, Kafka, etc.
224+
* [Dash0](https://www.dash0.com) - Integration testing for OpenTelemetry Observability product.
225+
224226

225227
## License
226228

docs/modules/azure.md

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,73 @@ This module is INCUBATING. While it is ready for use and operational in the curr
55

66
Testcontainers module for the Microsoft Azure's [SDK](https://github.com/Azure/azure-sdk-for-java).
77

8-
Currently, the module supports `CosmosDB` emulator. In order to use it, you should use the following class:
8+
Currently, the module supports `Azurite` and `CosmosDB` emulators. In order to use them, you should use the following classes:
99

1010
Class | Container Image
1111
-|-
12+
AzuriteContainer | [mcr.microsoft.com/azure-storage/azurite](https://github.com/microsoft/containerregistry)
1213
CosmosDBEmulatorContainer | [mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator](https://github.com/microsoft/containerregistry)
1314

1415
## Usage example
1516

17+
### Azurite Storage Emulator
18+
19+
Start Azurite Emulator during a test:
20+
21+
<!--codeinclude-->
22+
[Starting a Azurite container](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:emulatorContainer
23+
<!--/codeinclude-->
24+
25+
!!! note
26+
SSL configuration is possible using the `withSsl(MountableFile, String)` and `withSsl(MountableFile, MountableFile)` methods.
27+
28+
If the tested application needs to use more than one set of credentials, the container can be configured to use custom credentials.
29+
Please see some examples below.
30+
31+
<!--codeinclude-->
32+
[Starting a Azurite Blob container with one account and two keys](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:withTwoAccountKeys
33+
<!--/codeinclude-->
34+
35+
<!--codeinclude-->
36+
[Starting a Azurite Blob container with more accounts and keys](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:withMoreAccounts
37+
<!--/codeinclude-->
38+
39+
#### Using with Blob
40+
41+
Build Azure Blob client:
42+
43+
<!--codeinclude-->
44+
[Build Azure Blob Service client](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:createBlobClient
45+
<!--/codeinclude-->
46+
47+
In case the application needs to use custom credentials, we can obtain them with a different method:
48+
49+
<!--codeinclude-->
50+
[Obtain connection string with non-default credentials](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:useNonDefaultCredentials
51+
<!--/codeinclude-->
52+
53+
#### Using with Queue
54+
55+
Build Azure Queue client:
56+
57+
<!--codeinclude-->
58+
[Build Azure Queue Service client](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:createQueueClient
59+
<!--/codeinclude-->
60+
61+
!!! note
62+
We can use custom credentials the same way as defined in the Blob section.
63+
64+
#### Using with Table
65+
66+
Build Azure Table client:
67+
68+
<!--codeinclude-->
69+
[Build Azure Table Service client](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:createTableClient
70+
<!--/codeinclude-->
71+
72+
!!! note
73+
We can use custom credentials the same way as defined in the Blob section.
74+
1675
### CosmosDB
1776

1877
Start Azure CosmosDB Emulator during a test:

examples/cucumber/build.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,3 @@ dependencies {
1818
testImplementation 'org.testcontainers:selenium'
1919
testImplementation 'org.assertj:assertj-core:3.26.3'
2020
}
21-
22-
test {
23-
javaLauncher = javaToolchains.launcherFor {
24-
languageVersion = JavaLanguageVersion.of(11)
25-
}
26-
}
27-
28-
compileTestJava {
29-
javaCompiler = javaToolchains.compilerFor {
30-
languageVersion = JavaLanguageVersion.of(11)
31-
}
32-
options.release.set(11)
33-
}

modules/activemq/build.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,3 @@ dependencies {
77
testImplementation "org.apache.activemq:activemq-client:6.1.2"
88
testImplementation "org.apache.activemq:artemis-jakarta-client:2.37.0"
99
}
10-
11-
test {
12-
javaLauncher = javaToolchains.launcherFor {
13-
languageVersion = JavaLanguageVersion.of(17)
14-
}
15-
}
16-
17-
compileTestJava {
18-
javaCompiler = javaToolchains.compilerFor {
19-
languageVersion = JavaLanguageVersion.of(17)
20-
}
21-
options.release.set(11)
22-
}

0 commit comments

Comments
 (0)