feat: Add KurrentDb module#1583
Conversation
✅ Deploy Preview for testcontainers-dotnet ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughAdds a new KurrentDb module (builder, configuration, container), project and tests; marks EventStoreDb builder as obsolete; updates solution files and package props to include KurrentDB.Client v1.2.0; adds CI runner and editorconfig files for the new projects. Changes
Sequence Diagram(s)sequenceDiagram
actor Test as Test Code
participant Builder as KurrentDbBuilder
participant Config as KurrentDbConfiguration
participant Container as KurrentDbContainer
participant Docker as Docker Engine
Test->>Builder: new KurrentDbBuilder()
Test->>Builder: Build()
Builder->>Config: Init() -> create config
Builder->>Docker: Create & start container (image, env, ports)
Docker-->>Container: container ready
Builder-->>Test: KurrentDbContainer
Test->>Container: GetConnectionString()
Container-->>Test: returns esdb://host:port/?tls=false
Test->>KurrentDB.Client: use connection string to append/read stream
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (15)
.github/workflows/cicd.yml(1 hunks)Directory.Packages.props(1 hunks)Testcontainers.sln(6 hunks)Testcontainers.slnx(1 hunks)src/Testcontainers.EventStoreDb/EventStoreDbBuilder.cs(1 hunks)src/Testcontainers.KurrentDb/.editorconfig(1 hunks)src/Testcontainers.KurrentDb/KurrentDbBuilder.cs(1 hunks)src/Testcontainers.KurrentDb/KurrentDbConfiguration.cs(1 hunks)src/Testcontainers.KurrentDb/KurrentDbContainer.cs(1 hunks)src/Testcontainers.KurrentDb/Testcontainers.KurrentDb.csproj(1 hunks)src/Testcontainers.KurrentDb/Usings.cs(1 hunks)tests/Testcontainers.KurrentDb.Tests/.editorconfig(1 hunks)tests/Testcontainers.KurrentDb.Tests/KurrentDbContainerTest.cs(1 hunks)tests/Testcontainers.KurrentDb.Tests/Testcontainers.KurrentDb.Tests.csproj(1 hunks)tests/Testcontainers.KurrentDb.Tests/Usings.cs(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-08T09:04:00.045Z
Learnt from: HofmeisterAn
Repo: testcontainers/testcontainers-dotnet PR: 1509
File: tests/Testcontainers.Grafana.Tests/GrafanaContainerTest.cs:45-46
Timestamp: 2025-11-08T09:04:00.045Z
Learning: In xUnit.net test methods in the testcontainers-dotnet project, ConfigureAwait(true) is recommended and correct to use, as it ensures proper synchronization context capture for xUnit's test parallelism management. Do not suggest changing ConfigureAwait(true) to ConfigureAwait(false) in test methods.
Applied to files:
tests/Testcontainers.KurrentDb.Tests/Usings.cs
🧬 Code graph analysis (4)
src/Testcontainers.KurrentDb/KurrentDbContainer.cs (2)
src/Testcontainers.KurrentDb/KurrentDbBuilder.cs (8)
PublicAPI(4-69)KurrentDbContainer(34-37)KurrentDbBuilder(14-18)KurrentDbBuilder(24-28)KurrentDbBuilder(40-50)KurrentDbBuilder(53-56)KurrentDbBuilder(59-62)KurrentDbBuilder(65-68)src/Testcontainers.KurrentDb/KurrentDbConfiguration.cs (6)
PublicAPI(4-53)KurrentDbConfiguration(10-12)KurrentDbConfiguration(18-22)KurrentDbConfiguration(28-32)KurrentDbConfiguration(38-42)KurrentDbConfiguration(49-52)
tests/Testcontainers.KurrentDb.Tests/KurrentDbContainerTest.cs (2)
src/Testcontainers.KurrentDb/KurrentDbBuilder.cs (7)
KurrentDbContainer(34-37)KurrentDbBuilder(14-18)KurrentDbBuilder(24-28)KurrentDbBuilder(40-50)KurrentDbBuilder(53-56)KurrentDbBuilder(59-62)KurrentDbBuilder(65-68)src/Testcontainers.KurrentDb/KurrentDbContainer.cs (2)
KurrentDbContainer(11-14)GetConnectionString(20-25)
src/Testcontainers.KurrentDb/KurrentDbBuilder.cs (3)
src/Testcontainers.EventStoreDb/EventStoreDbBuilder.cs (1)
PublicAPI(4-70)src/Testcontainers.KurrentDb/KurrentDbConfiguration.cs (6)
PublicAPI(4-53)KurrentDbConfiguration(10-12)KurrentDbConfiguration(18-22)KurrentDbConfiguration(28-32)KurrentDbConfiguration(38-42)KurrentDbConfiguration(49-52)src/Testcontainers.KurrentDb/KurrentDbContainer.cs (2)
PublicAPI(4-26)KurrentDbContainer(11-14)
src/Testcontainers.KurrentDb/KurrentDbConfiguration.cs (2)
src/Testcontainers.KurrentDb/KurrentDbBuilder.cs (1)
PublicAPI(4-69)src/Testcontainers.KurrentDb/KurrentDbContainer.cs (1)
PublicAPI(4-26)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: analyze (csharp)
🔇 Additional comments (15)
tests/Testcontainers.KurrentDb.Tests/.editorconfig (1)
1-1: LGTM!Standard EditorConfig root marker.
tests/Testcontainers.KurrentDb.Tests/Usings.cs (1)
1-5: LGTM!The global using directives are appropriate for a testcontainers test project using xUnit.
src/Testcontainers.KurrentDb/.editorconfig (1)
1-1: LGTM!Standard EditorConfig root marker.
src/Testcontainers.EventStoreDb/EventStoreDbBuilder.cs (1)
5-5: LGTM!Clear deprecation message with helpful migration guidance and documentation link.
tests/Testcontainers.KurrentDb.Tests/Testcontainers.KurrentDb.Tests.csproj (2)
1-19: Test project configuration looks good otherwise.The project structure, package references, and project references are correctly configured for a testcontainers test project.
3-3: No changes required..NET 10 officially released on November 11, 2025, as a Long-Term Support release, making targeting
net10.0appropriate and supported. The codebase consistently follows this pattern: test projects target onlynet10.0, while library projects support multiple frameworks for broader compatibility. This is an intentional design choice and no update is needed.src/Testcontainers.KurrentDb/Usings.cs (1)
1-6: LGTM!The global using directives are appropriate and consistent with other testcontainers modules in the repository.
Testcontainers.sln (1)
77-78: LGTM! Solution file updates are consistent.The solution file changes correctly integrate the new KurrentDb project and its tests into the solution structure, following the same pattern as other Testcontainers modules.
Also applies to: 203-204, 401-404, 653-656, 854-854, 917-917
tests/Testcontainers.KurrentDb.Tests/KurrentDbContainerTest.cs (2)
36-37: Review ConfigureAwait usage in test code.The test uses
.ConfigureAwait(true)at lines 36 and 42, which explicitly captures the synchronization context. This is unusual in test code—typically.ConfigureAwait(false)is used in library code or the parameter is omitted in tests.Verify this is intentional. If the test framework requires continuation on the original context, this is correct; otherwise, consider omitting
.ConfigureAwait()or usingfalse.Also applies to: 41-42
5-18: LGTM! Proper container lifecycle management.The test correctly implements
IAsyncLifetimeto manage the container lifecycle, ensuring the container is started before tests and properly disposed afterward.src/Testcontainers.KurrentDb/KurrentDbConfiguration.cs (1)
1-53: LGTM! Configuration class follows Testcontainers patterns.The
KurrentDbConfigurationclass correctly implements the immutable configuration pattern used throughout the Testcontainers library, with all constructors properly delegating to base implementations.src/Testcontainers.KurrentDb/KurrentDbBuilder.cs (3)
40-50: LGTM! Builder configuration is appropriate for testing.The
Init()method correctly configures KurrentDB for testing with:
- Single-node cluster (appropriate for tests)
- All projections enabled
- Insecure mode (appropriate for test containers)
- Health check wait strategy
The configuration mirrors the obsolete EventStoreDbBuilder and is well-suited for integration testing.
1-69: Consistent implementation with Testcontainers patterns.The
KurrentDbBuilderclass correctly implements the builder pattern used throughout the Testcontainers library, with proper initialization, cloning, and merging behavior.
7-7: Docker image version verified as correct and latest.The KurrentDB image version
25.1used in the code is confirmed as the latest stable release and is documented in official KurrentDB installation guidance. No changes required.src/Testcontainers.KurrentDb/Testcontainers.KurrentDb.csproj (1)
3-3: No action required—.NET 10 is now available..NET 10 was officially released on November 11, 2025, so the codebase's consistent targeting of
net10.0across all projects (evident from the script results showing the pattern across the entire solution) is now appropriate and intentional.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
tests/Testcontainers.EventStoreDb.Tests/EventStoreDbContainerTest.cs (1)
29-37: KurrentDB client wiring mirrors previous EventStore client flow; double‑check compatibility and language versionThe switch to:
KurrentDBClientSettings.Create(_eventStoreDbContainer.GetConnectionString())using var client = new KurrentDBClient(settings);AppendToStreamAsync(streamName, StreamState.NoStream, [eventData], ...)keeps the test flow intact and correctly reuses the container connection string and cancellation token. Two minor points to verify:
- Connection string compatibility –
EventStoreDbContainer.GetConnectionString()still returns anesdb://...URI. Ensure this format is fully supported byKurrentDBClientSettings.Createso the client connects without hidden quirks.- Collection expression
[eventData]– this uses the newer C# collection expression syntax. Confirm the test project’sLangVersion(or SDK defaults) supports it; otherwise you may want to revert tonew[] { eventData }for broader compatibility.If both are satisfied, this migration looks good.
If you need a more compatible variant, you can revert the collection expression with:
- _ = await client.AppendToStreamAsync(streamName, StreamState.NoStream, [eventData], cancellationToken: TestContext.Current.CancellationToken) + _ = await client.AppendToStreamAsync(streamName, StreamState.NoStream, new[] { eventData }, cancellationToken: TestContext.Current.CancellationToken) .ConfigureAwait(true);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
tests/Testcontainers.EventStoreDb.Tests/EventStoreDbContainerTest.cs(2 hunks)tests/Testcontainers.EventStoreDb.Tests/Testcontainers.EventStoreDb.Tests.csproj(1 hunks)tests/Testcontainers.KurrentDb.Tests/Testcontainers.KurrentDb.Tests.csproj(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- tests/Testcontainers.KurrentDb.Tests/Testcontainers.KurrentDb.Tests.csproj
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-17T17:58:43.916Z
Learnt from: diegosasw
Repo: testcontainers/testcontainers-dotnet PR: 1583
File: src/Testcontainers.KurrentDb/Testcontainers.KurrentDb.csproj:7-7
Timestamp: 2025-11-17T17:58:43.916Z
Learning: In the testcontainers-dotnet repository, JetBrains.Annotations should use version 2023.3.0 to maintain consistency with the main Testcontainers csproj, rather than always using the latest available version.
Applied to files:
tests/Testcontainers.EventStoreDb.Tests/Testcontainers.EventStoreDb.Tests.csprojtests/Testcontainers.EventStoreDb.Tests/EventStoreDbContainerTest.cs
🧬 Code graph analysis (1)
tests/Testcontainers.EventStoreDb.Tests/EventStoreDbContainerTest.cs (1)
src/Testcontainers.EventStoreDb/EventStoreDbContainer.cs (1)
GetConnectionString(20-25)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: ci (Testcontainers.BigQuery, ubuntu-24.04)
- GitHub Check: ci (Testcontainers.ArangoDb, ubuntu-24.04)
- GitHub Check: ci (Testcontainers.Cassandra, ubuntu-24.04)
- GitHub Check: ci (Testcontainers.Azurite, ubuntu-24.04)
- GitHub Check: ci (Testcontainers.ActiveMq, ubuntu-24.04)
- GitHub Check: ci (Testcontainers.Bigtable, ubuntu-24.04)
- GitHub Check: analyze (csharp)
🔇 Additional comments (2)
tests/Testcontainers.EventStoreDb.Tests/Testcontainers.EventStoreDb.Tests.csproj (1)
14-14: No changes required—package reference is properly configured.The verification confirms that
KurrentDB.Clientis correctly defined inDirectory.Packages.propswith version1.2.0. The package reference in the test project properly uses the centralized package management pattern with no explicit version, which is the correct approach for this repository.tests/Testcontainers.EventStoreDb.Tests/EventStoreDbContainerTest.cs (1)
1-1: Using KurrentDB.Client import is consistent with the updated client usageThe added
using KurrentDB.Client;matches the newKurrentDBClientSettings/KurrentDBClienttypes used below and keeps the test focused on the KurrentDB client stack.Please confirm the referenced
KurrentDB.Clientpackage version is the one defined centrally (e.g., inDirectory.Packages.props) so test and library projects stay aligned.
HofmeisterAn
left a comment
There was a problem hiding this comment.
Thanks for taking care of this. I almost forgot about the branch. I made a few small updates to keep the overall changes to a minimum. We'll remove the EventStoreDb module in the release after the next one.
What does this PR do?
Completes already started work from @HofmeisterAn to support KurrentDB TestContainer.
It uses latest
kurrentplatform/kurrentdb:25.1and the newKurrentDB.Clientin test project to assert that it's possible to write and read in KurrentDB stream.Why is it important?
There was support for the old EventStoreDB but not for the new KurrentDB, which is a well-known leading event sourcing database. The work was commenced in branch https://github.com/testcontainers/testcontainers-dotnet/tree/feature/add-kurrent-db
Related issues
How to test this PR
Run automated test that writes and reads from KurrentDB test container