Skip to content

Commit 9e8f3c7

Browse files
authored
Merge branch 'develop' into UntilDatabaseIsAvailable
2 parents 6df9aa5 + e37b279 commit 9e8f3c7

File tree

25 files changed

+458
-31
lines changed

25 files changed

+458
-31
lines changed

Testcontainers.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.FirebirdSql"
5353
EndProject
5454
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Firestore", "src\Testcontainers.Firestore\Testcontainers.Firestore.csproj", "{B3CC460D-0DFD-48A8-9502-54E9828B7B05}"
5555
EndProject
56+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.GCloud", "src\Testcontainers.GCloud\Testcontainers.GCloud.csproj", "{D7CE8744-E58B-4277-BBB7-6840A4FF2049}"
57+
EndProject
5658
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.InfluxDb", "src\Testcontainers.InfluxDb\Testcontainers.InfluxDb.csproj", "{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678}"
5759
EndProject
5860
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.JanusGraph", "src\Testcontainers.JanusGraph\Testcontainers.JanusGraph.csproj", "{C5AF86A8-2F11-41B6-BB01-325AD9016B94}"
@@ -326,6 +328,10 @@ Global
326328
{B3CC460D-0DFD-48A8-9502-54E9828B7B05}.Debug|Any CPU.Build.0 = Debug|Any CPU
327329
{B3CC460D-0DFD-48A8-9502-54E9828B7B05}.Release|Any CPU.ActiveCfg = Release|Any CPU
328330
{B3CC460D-0DFD-48A8-9502-54E9828B7B05}.Release|Any CPU.Build.0 = Release|Any CPU
331+
{D7CE8744-E58B-4277-BBB7-6840A4FF2049}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
332+
{D7CE8744-E58B-4277-BBB7-6840A4FF2049}.Debug|Any CPU.Build.0 = Debug|Any CPU
333+
{D7CE8744-E58B-4277-BBB7-6840A4FF2049}.Release|Any CPU.ActiveCfg = Release|Any CPU
334+
{D7CE8744-E58B-4277-BBB7-6840A4FF2049}.Release|Any CPU.Build.0 = Release|Any CPU
329335
{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
330336
{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678}.Debug|Any CPU.Build.0 = Debug|Any CPU
331337
{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -716,6 +722,7 @@ Global
716722
{FF86B509-2F9E-4269-ABC2-912B3339DE29} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
717723
{31BAF2C4-0608-4C0F-845A-14FE7C0A1670} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
718724
{B3CC460D-0DFD-48A8-9502-54E9828B7B05} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
725+
{D7CE8744-E58B-4277-BBB7-6840A4FF2049} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
719726
{8F483B83-7BD4-4BD5-9F03-DFC26E1CE678} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
720727
{C5AF86A8-2F11-41B6-BB01-325AD9016B94} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
721728
{111B840F-9DB0-4166-83E6-0580FD418F07} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}

compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
docs:
3+
image: python:3.8-alpine
4+
command: sh -c "pip install -r requirements.txt && mkdocs serve -a 0.0.0.0:8000"
5+
working_dir: /docs
6+
volumes:
7+
- ./:/docs
8+
ports:
9+
- 8000:8000

docs/cicd/index.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,23 @@ services:
2020
variables:
2121
DOCKER_HOST: tcp://docker:2375
2222
```
23+
24+
## Bitbucket Pipelines
25+
26+
Enable Bitbucket Pipelines as usual on the **Repository settings → Pipelines → Settings** page. After enabling your pipeline, replace the contents of the `bitbucket-pipelines.yml` file, located at the root of your repository, with the following:
27+
28+
```yml title="bitbucket-pipelines.yml file"
29+
image: mcr.microsoft.com/dotnet/sdk:8.0
30+
options:
31+
docker: true
32+
pipelines:
33+
default:
34+
- step:
35+
script:
36+
# Bitbucket Pipelines does not support Ryuk:
37+
# https://dotnet.testcontainers.org/api/resource_reaper/.
38+
- export TESTCONTAINERS_RYUK_DISABLED=true
39+
- dotnet test
40+
services:
41+
- docker
42+
```

docs/contributing_docs.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ We publish our documentation using Netlify.
1515
* Set up a virtualenv and run `pip install -r requirements.txt` in the `testcontainers-dotnet` root directory.
1616
* Once Python dependencies have been installed, run `mkdocs serve` to start a local auto-updating MkDocs server.
1717

18+
### Using Docker
19+
20+
The root of the project contains a `compose.yml` file. Simply run `docker compose up` and access the docs at: `http://localhost:8000`.
21+
1822
### PR preview deployments
1923

2024
Note that documentation for pull requests will automatically be published by Netlify as 'deploy preview'.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Running inside another container
1+
# Running inside a container
22

3-
## 'Docker wormhole' pattern - Sibling Docker containers
3+
## 'Docker Wormhole' pattern - Sibling Docker containers
44

55
### Docker-only example
66

@@ -33,5 +33,5 @@ services:
3333
# environment:
3434
# - TESTCONTAINERS_HOST_OVERRIDE=host.docker.internal
3535
volumes:
36-
- /var/run/docker.sock:/var/run/docker.sock
36+
- /var/run/docker.sock.raw:/var/run/docker.sock
3737
```

docs/full_framework/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# .NET Framework
2+
3+
When working with older versions of the .NET Framework (e.g., .NET Framework 4.x), you may encounter issues related to assembly binding conflicts. These conflicts typically occur when your application requires specific versions of assemblies that are different from the versions being loaded at runtime.
4+
5+
To resolve these conflicts and ensure the correct versions of assemblies are used, binding redirects are often necessary. Binding redirects allow you to specify which version of an assembly should be used by the runtime, preventing errors and version mismatches during execution.
6+
7+
Testcontainers for .NET relies on several external dependencies, which may require different versions of assemblies. Legacy applications or projects targeting the full .NET Framework may not automatically resolve these dependencies correctly, and without binding redirects, runtime errors or unexpected behavior may occur.
8+
9+
In executable .NET Framework projects (such as console apps, web apps, etc.), Visual Studio typically handles binding redirects automatically. However, this is not the case for class libraries or test projects.
10+
11+
For **test projects**, binding redirects are **not automatically added** by Visual Studio, which means you may need to manually configure them in the `App.config` file (or enable [`AutoGenerateBindingRedirects`](https://learn.microsoft.com/dotnet/framework/configure-apps/redirect-assembly-versions#rely-on-automatic-binding-redirection)).

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ dotnet add package Testcontainers
77
```csharp title="Run the Hello World container"
88
// Create a new instance of a container.
99
var container = new ContainerBuilder()
10-
// Set the image for the container to "testcontainers/helloworld:1.1.0".
11-
.WithImage("testcontainers/helloworld:1.1.0")
10+
// Set the image for the container to "testcontainers/helloworld:1.2.0".
11+
.WithImage("testcontainers/helloworld:1.2.0")
1212
// Bind port 8080 of the container to a random port on the host.
1313
.WithPortBinding(8080, true)
1414
// Wait until the HTTP endpoint of the container is available.
@@ -21,7 +21,7 @@ await container.StartAsync()
2121
.ConfigureAwait(false);
2222

2323
// Create a new instance of HttpClient to send HTTP requests.
24-
var httpClient = new HttpClient();
24+
using var httpClient = new HttpClient();
2525

2626
// Construct the request URI by specifying the scheme, hostname, assigned random host port, and the endpoint "uuid".
2727
var requestUri = new UriBuilder(Uri.UriSchemeHttp, container.Hostname, container.GetMappedPublicPort(8080), "uuid").Uri;

docs/modules/activemq.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Apache ActiveMQ Artemis
2+
3+
[Apache ActiveMQ Artemis](https://activemq.apache.org/components/artemis/) is an open source project to build a multi-protocol, embeddable, very high performance, clustered, asynchronous messaging system.
4+
5+
Add the following dependency to your project file:
6+
7+
```shell title="NuGet"
8+
dotnet add package Testcontainers.ActiveMq
9+
```
10+
11+
You can start an Apache ActiveMQ Artemis container instance from any .NET application. This example uses xUnit.net's `IAsyncLifetime` interface to manage the lifecycle of the container. The container is started in the `InitializeAsync` method before the test method runs, ensuring that the environment is ready for testing. After the test completes, the container is removed in the `DisposeAsync` method.
12+
13+
=== "Base test class"
14+
```csharp
15+
--8<-- "tests/Testcontainers.ActiveMq.Tests/ArtemisContainerTest.cs:UseArtemisContainer"
16+
}
17+
```
18+
=== "Without auth"
19+
```csharp
20+
--8<-- "tests/Testcontainers.ActiveMq.Tests/ArtemisContainerTest.cs:UseArtemisContainerNoAuth"
21+
```
22+
=== "Default credentials"
23+
```csharp
24+
--8<-- "tests/Testcontainers.ActiveMq.Tests/ArtemisContainerTest.cs:UseArtemisContainerDefaultAuth"
25+
```
26+
=== "Custom credentials"
27+
```csharp
28+
--8<-- "tests/Testcontainers.ActiveMq.Tests/ArtemisContainerTest.cs:UseArtemisContainerCustomAuth"
29+
```
30+
31+
Connect to the container and produce a message:
32+
33+
=== "EstablishesConnection"
34+
```csharp
35+
--8<-- "tests/Testcontainers.ActiveMq.Tests/ArtemisContainerTest.cs:ArtemisContainerEstablishesConnection"
36+
```
37+
38+
The test example uses the following NuGet dependencies:
39+
40+
=== "Package References"
41+
```xml
42+
--8<-- "tests/Testcontainers.ActiveMq.Tests/Testcontainers.ActiveMq.Tests.csproj:PackageReferences"
43+
```
44+
45+
To execute the tests, use the command `dotnet test` from a terminal.
46+
47+
--8<-- "docs/modules/_call_out_test_projects.txt"

mkdocs.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,18 @@ nav:
4141
- api/resource_reuse.md
4242
- api/wait_strategies.md
4343
- api/best_practices.md
44+
- dind/index.md
45+
- full_framework/index.md
4446
- test_frameworks/xunit_net.md
4547
- Examples:
46-
- examples/dind.md
4748
- examples/aspnet.md
4849
- Modules:
4950
- modules/index.md
50-
- modules/cassandra.md
51-
- modules/pulsar.md
52-
- modules/eventhubs.md
53-
- modules/servicebus.md
51+
- modules/activemq.md # Apache
52+
- modules/cassandra.md # Apache
53+
- modules/pulsar.md # Apache
54+
- modules/eventhubs.md # Azure
55+
- modules/servicebus.md # Azure
5456
- modules/db2.md
5557
- modules/elasticsearch.md
5658
- modules/mongodb.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
root = true

0 commit comments

Comments
 (0)