Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 75 additions & 70 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Continuous Integration & Delivery

on:
push:
branches: [ develop, main, bugfix/*, feature/* ]
paths-ignore: [ 'docs/**', 'examples/**' ]
branches: [develop, main, bugfix/*, feature/*]
paths-ignore: ["docs/**", "examples/**"]
pull_request:
branches: [ develop, main ]
paths-ignore: [ 'docs/**', 'examples/**' ]
branches: [develop, main]
paths-ignore: ["docs/**", "examples/**"]
workflow_dispatch:
inputs:
publish_nuget_package:
Expand All @@ -31,72 +31,77 @@ jobs:
strategy:
max-parallel: 6
matrix:
test-projects: [
{ name: "Testcontainers", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Platform.Linux", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Platform.Windows", runs-on: "windows-2022" },
{ name: "Testcontainers.Databases", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.ResourceReaper", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.ActiveMq", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.ArangoDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Azurite", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.BigQuery", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Bigtable", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Cassandra", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.ClickHouse", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.CockroachDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Consul", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.CosmosDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Couchbase", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.CouchDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Db2", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.DynamoDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Elasticsearch", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.EventHubs", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.EventStoreDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.FakeGcsServer", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.FirebirdSql", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Firestore", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.InfluxDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.JanusGraph", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.K3s", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Kafka", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Keycloak", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Kusto", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.LocalStack", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.LowkeyVault", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.MariaDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Milvus", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Minio", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.MongoDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.MsSql", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.MySql", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Nats", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Neo4j", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Ollama", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.OpenSearch", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Oracle", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Oracle11", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Oracle18", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Oracle21", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Oracle23", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Papercut", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.PostgreSql", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.PubSub", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Pulsar", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Qdrant", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.RabbitMq", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.RavenDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Redis", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Redpanda", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.ServiceBus", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Sftp", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Typesense", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Weaviate", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.WebDriver", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Xunit", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.XunitV3", runs-on: "ubuntu-22.04" }
]
test-projects:
[
{ name: "Testcontainers", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Platform.Linux", runs-on: "ubuntu-22.04" },
{
name: "Testcontainers.Platform.Windows",
runs-on: "windows-2022",
},
{ name: "Testcontainers.Databases", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.ResourceReaper", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.ActiveMq", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.ArangoDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Azurite", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.BigQuery", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Bigtable", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Cassandra", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.ClickHouse", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.CockroachDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Consul", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.CosmosDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Couchbase", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.CouchDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Db2", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.DynamoDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Elasticsearch", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.EventHubs", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.EventStoreDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.FakeGcsServer", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.FirebirdSql", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Firestore", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.InfluxDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.JanusGraph", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.K3s", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Kafka", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Keycloak", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Kusto", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.LocalStack", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.LowkeyVault", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.MariaDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Milvus", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Minio", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.MongoDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.MsSql", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.MySql", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Nats", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Neo4j", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Ollama", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.OpenSearch", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Oracle", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Oracle11", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Oracle18", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Oracle21", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Oracle23", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Papercut", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.PostgreSql", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.PubSub", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Pulsar", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Qdrant", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.RabbitMq", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.RavenDb", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Redis", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Redpanda", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.ServiceBus", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Sftp", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Typesense", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Weaviate", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.WebDriver", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.Xunit", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.XunitV3", runs-on: "ubuntu-22.04" },
{ name: "Testcontainers.SpiceDB", runs-on: "ubuntu-22.04" },
]

runs-on: ${{ matrix.test-projects.runs-on }}

Expand Down
3 changes: 3 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.6.1"/>
<PackageVersion Include="Docker.DotNet.Enhanced.X509" Version="3.128.3"/>
<PackageVersion Include="Docker.DotNet.Enhanced" Version="3.128.3"/>
<PackageVersion Include="Grpc.Core" Version="2.46.6" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0"/>
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1"/>
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.3"/>
Expand Down Expand Up @@ -61,6 +62,8 @@
<PackageVersion Include="Google.Cloud.Firestore" Version="3.1.0"/>
<PackageVersion Include="Google.Cloud.PubSub.V1" Version="3.5.0"/>
<PackageVersion Include="Google.Cloud.Storage.V1" Version="4.6.0"/>
<PackageVersion Include="Grpc.HealthCheck" Version="2.60.0"/>
<PackageVersion Include="Grpc.Net.Client" Version="2.60.0"/>
<PackageVersion Include="InfluxDB.Client" Version="4.18.0"/>
<PackageVersion Include="JanusGraph.Net" Version="1.0.0"/>
<PackageVersion Include="Keycloak.Net.Core" Version="1.0.20"/>
Expand Down
18 changes: 18 additions & 0 deletions Testcontainers.sln
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Xunit.Tests"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.XunitV3.Tests", "tests\Testcontainers.XunitV3.Tests\Testcontainers.XunitV3.Tests.csproj", "{B2E8B7FB-7D1E-4DD3-A25E-34DE4386B1EB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.SpiceDB", "src\Testcontainers.SpiceDB\Testcontainers.SpiceDB.csproj", "{64B27088-14DC-4CA2-B24E-5D0D5BA14355}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.SpiceDB.Tests", "tests\Testcontainers.SpiceDB.Tests\Testcontainers.SpiceDB.Tests.csproj", "{21D155EB-A843-4D4D-84E1-5C913217BE89}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -751,6 +755,18 @@ Global
{B2E8B7FB-7D1E-4DD3-A25E-34DE4386B1EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2E8B7FB-7D1E-4DD3-A25E-34DE4386B1EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2E8B7FB-7D1E-4DD3-A25E-34DE4386B1EB}.Release|Any CPU.Build.0 = Release|Any CPU
{64B27088-14DC-4CA2-B24E-5D0D5BA14355}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{64B27088-14DC-4CA2-B24E-5D0D5BA14355}.Debug|Any CPU.Build.0 = Debug|Any CPU
{64B27088-14DC-4CA2-B24E-5D0D5BA14355}.Release|Any CPU.ActiveCfg = Release|Any CPU
{64B27088-14DC-4CA2-B24E-5D0D5BA14355}.Release|Any CPU.Build.0 = Release|Any CPU
{A9F554E5-9183-4F8A-B226-58DD46BB2060}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A9F554E5-9183-4F8A-B226-58DD46BB2060}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A9F554E5-9183-4F8A-B226-58DD46BB2060}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A9F554E5-9183-4F8A-B226-58DD46BB2060}.Release|Any CPU.Build.0 = Release|Any CPU
{21D155EB-A843-4D4D-84E1-5C913217BE89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{21D155EB-A843-4D4D-84E1-5C913217BE89}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21D155EB-A843-4D4D-84E1-5C913217BE89}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21D155EB-A843-4D4D-84E1-5C913217BE89}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -878,5 +894,7 @@ Global
{EBA72C3B-57D5-43FF-A5B4-3D55B3B6D4C2} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{E901DF14-6F05-4FC2-825A-3055FAD33561} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{B2E8B7FB-7D1E-4DD3-A25E-34DE4386B1EB} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{64B27088-14DC-4CA2-B24E-5D0D5BA14355} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{21D155EB-A843-4D4D-84E1-5C913217BE89} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
EndGlobalSection
EndGlobal
3 changes: 2 additions & 1 deletion docs/modules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ await moduleNameContainer.StartAsync();
We will add module-specific documentations soon.

| Module | Image | NuGet | Source |
|-------------------|---------------------------------------------------------------------|----------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|
| ----------------- | ------------------------------------------------------------------- | -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| ActiveMQ Artemis | `apache/activemq-artemis:2.31.2` | [NuGet](https://www.nuget.org/packages/Testcontainers.ActiveMq) | [Source](https://github.com/testcontainers/testcontainers-dotnet/tree/develop/src/Testcontainers.ActiveMq) |
| ArangoDB | `arangodb:3.11.5` | [NuGet](https://www.nuget.org/packages/Testcontainers.ArangoDb) | [Source](https://github.com/testcontainers/testcontainers-dotnet/tree/develop/src/Testcontainers.ArangoDb) |
| Azure Cosmos DB | `mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest` | [NuGet](https://www.nuget.org/packages/Testcontainers.CosmosDb) | [Source](https://github.com/testcontainers/testcontainers-dotnet/tree/develop/src/Testcontainers.CosmosDb) |
Expand Down Expand Up @@ -73,6 +73,7 @@ await moduleNameContainer.StartAsync();
| Typesense | `typesense/typesense:28.0` | [NuGet](https://www.nuget.org/packages/Testcontainers.Typesense) | [Source](https://github.com/testcontainers/testcontainers-dotnet/tree/develop/src/Testcontainers.Typesense) |
| Weaviate | `semitechnologies/weaviate:1.26.14` | [NuGet](https://www.nuget.org/packages/Testcontainers.Weaviate) | [Source](https://github.com/testcontainers/testcontainers-dotnet/tree/develop/src/Testcontainers.Weaviate) |
| WebDriver | `selenium/standalone-chrome:110.0` | [NuGet](https://www.nuget.org/packages/Testcontainers.WebDriver) | [Source](https://github.com/testcontainers/testcontainers-dotnet/tree/develop/src/Testcontainers.WebDriver) |
| SpiceDB | `authzed/spicedb:v1.45.1` | [NuGet](https://www.nuget.org/packages/Testcontainers.SpiceDB) | [Source](https://github.com/testcontainers/testcontainers-dotnet/tree/develop/src/Testcontainers.SpiceDB) |

## Implement a module

Expand Down
56 changes: 56 additions & 0 deletions docs/modules/spicedb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# SpiceDB

[SpiceDB](https://authzed.com/spicedb/) is an open-source, Google Zanzibar-inspired permissions database that provides a centralized service to store, compute, and validate application permissions. It enables fine-grained authorization at scale with a flexible relationship-based permission model.

Add the following dependency to your project file:

```shell title="NuGet"
dotnet add package Testcontainers.SpiceDB
```

You can start a SpiceDB 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.

=== "Usage Example"

````csharp
public sealed class SpiceDBContainerTest : IAsyncLifetime
{
private readonly SpiceDBContainer \_spicedbContainer = new SpiceDBBuilder().Build();

public Task InitializeAsync()
{
return _spicedbContainer.StartAsync();
}

public Task DisposeAsync()
{
return _spicedbContainer.DisposeAsync().AsTask();
}

[Fact]
public async Task SpiceDBContainer_IsRunning_ReturnsTrue()
{
// Given
var containerState = await _spicedbContainer.GetStateAsync();

// ...
}
}
```

The test example uses the following NuGet dependencies:

=== "Package References"
`xml
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="Testcontainers.SpiceDB" />
</ItemGroup>
`

To execute the tests, use the command `dotnet test` from a terminal.

--8<-- "docs/modules/\_call_out_test_projects.txt"
````
1 change: 1 addition & 0 deletions src/Testcontainers.SpiceDB/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
root = true
Loading