Dotnet Testcontainers Versions Save

A library to support tests with throwaway instances of Docker containers for all compatible .NET Standard versions.

3.8.0

1 month ago

Thank you very much to all contributors once again. This version contains really great features and important fixes. Awesome increment ๐Ÿ™.

What's Changed

โš ๏ธ Breaking Changes

If you have overwritten the default logger previously (setting TestcontainersSettings.Logger), please be aware that each builder now offers a dedicated API to configure the actual logger. This has several advantages; among others, it integrates very nicely into xUnit.net's scoped loggers.

  • feat: Add WithLogger(ILogger) builder API (#1100) @0xced

๐Ÿš€ Features

  • feat: Use built-in PEM certificate import on .NET 6 and onwards (#1139) @0xced
  • feat: Add WithLogger(ILogger) builder API (#1100) @0xced
  • feat: Add support for the target frameworks net6.0 and net8.0 (#1133) @HofmeisterAn
  • feat: Add Milvus module (#1131) @roji
  • feat: Embed symbols and enable continuous integration builds (deterministic source paths) (#1129) @tom-englert
  • feat: Add remote container registry identity token support (#1124) @HofmeisterAn
  • feat: Add URL-based resource mapping container builder API (#1118) @0xced
  • feat: Add CockroachDB module (#1077) @rafaumlemos
  • feat: Add reuse support (#1051) @david-szabo97

๐Ÿ› Bug Fixes

  • fix: Prevent a NullReferenceException when pulling uncached base images to build an image (#1126) @tom-englert
  • fix: Prevent .dockerignore entry from matching everything if it ends with globstart (#1122) @HofmeisterAn
  • fix: Consider the timestamp in the log message wait strategy (read the correct log message chunk) (#1110) @HofmeisterAn
  • fix(CosmosDb): SSL connection could not be established (#1109) @WakaToa

๐Ÿงน Housekeeping

  • chore: Ensure that stderr is empty after executing scripts (#1116) @0xced
  • chore: Use the pg_isready command to assess whether PostgreSQL is ready or not (#1111) @0xced
  • chore: Switch to the SDK's included Central Package Management (#1106) @HofmeisterAn
  • chore: Use relative ProjectReference paths instead of $(SolutionDir) (#1094) @0xced
  • chore: Update xUnit.net (#1087) @HofmeisterAn

๐Ÿ“ฆ Dependency Updates

  • chore(deps): Bump Microsoft.Data.SqlClient from 5.1.0 to 5.1.3 in /tests/Testcontainers.SqlEdge.Tests (#1088) @dependabot
  • chore(deps): Bump Microsoft.Data.SqlClient from 5.1.0 to 5.1.3 in /tests/Testcontainers.MsSql.Tests (#1089) @dependabot

3.7.0

4 months ago

Happy New Year and a massive thank you to all the contributors who made the new version of Testcontainers for .NET possible ๐Ÿ™Œ!

What's Changed

๐Ÿš€ Features

  • feat: Add Firebird SQL module (#1073) @park-jasper
  • feat(Azurite): Add in-memory support (#1063) @Xzelsius
  • feat: Add ArangoDB module (#1058) @ShirAvneri
  • feat: Add ActiveMQ Artemis module (#1055) @ShirAvneri
  • feat: Add Bigtable module (#1046) @peroyhav
  • feat: Add BigQuery module (#1034) @dejandjenic
  • feat: Add JanusGraph module (#837) @rngcntr
  • feat: Add Papercut module (#1044) @TechLiam
  • feat: Improve tar stream logging (copy files to container) (#1050) @HofmeisterAn

๐Ÿ› Bug Fixes

  • fix: Retry configuring Couchbase on HttpIOException (#1064) @mgroves

๐Ÿ“– Documentation

  • docs: Add ASP.NET integration test example (#1061) @HofmeisterAn

๐Ÿงน Housekeeping

  • chore: Update Ryuk image from version 0.5.1 to 0.6.0 (#1084) @HofmeisterAn
  • chore: Improve the Base64Provider resilience to malformed configuration files (#1081) @0xced
  • chore: Invert #if NETSTANDARD* conditional compilation conditions (#1079) @0xced
  • chore: Rename the file CouchDbContainerTest.cs to CouchbaseContainerTest.cs (#1067) @mgroves
  • chore: Replace custom wait strategy with default strategies (#1059) @ShirAvneri
  • chore: Remove Microsoft.SourceLink.GitHub (#1057) @HofmeisterAn
  • chore: Update .NET SDK to version 8 (LTS) (#1054) @HofmeisterAn

3.6.0

6 months ago

A heartfelt thank you to each contributor. Your contributions, whether through sharing ideas for improvements, identifying issues, submitting pull requests, or writing articles, are immensely appreciated and help me a lot. THANK YOU for your support.

What's Changed

โš ๏ธ Breaking Changes

The members of the container and image builder, WithImagePullPolicy and WithImageBuildPolicy, previously received a callback argument of type ImagesListResponse. We've now updated these callbacks, and they will receive an argument of type ImageInspectResponse. This change was implemented to offer more detailed information regarding the actual cached image.

  • feat: Use Docker's inspect API to get resource information (#1018) @HofmeisterAn

๐Ÿš€ Features

  • feat: Extend the "wait until file exists" API to distinguish between the test host and container filesystem (#1009) @maaex
  • chore: Do not pre-pull cached images (#1032) @HofmeisterAn
  • feat: Add Consul module (#1028) @witskeeper
  • feat: Add Google Cloud Storage API (fake-gcs-server) module (#1023) @KSemenenko
  • feat: Add PubSub module (#1005) @dejandjenic
  • feat: Share common interface (IDatabaseContainer) for ADO.NET compatible containers (#920) @0xced
  • feat: Use Docker's inspect API to get resource information (#1018) @HofmeisterAn
  • feat: Ignore FROM args when pre-pulling images (#1016) @HofmeisterAn
  • feat: Add NATS module (#1003) @niklasfp
  • feat: Add Firestore module (#988) @dejandjenic

๐Ÿ› Bug Fixes

  • fix: Retain the internal Couchbase builder configuration if the user overrides the default configuration (#1040) @HofmeisterAn
  • fix: Prevent invalid negative timestamps getting container logs (#1038) @mausch

๐Ÿ“– Documentation

  • docs: Add Neo4j example (#1013) @khalidabuhakmeh
  • docs: Add MongoDB example (#1012) @khalidabuhakmeh
  • docs: Add Elasticsearch example (#1010) @khalidabuhakmeh
  • docs: Add Microsoft SQL Server example (#1008) @khalidabuhakmeh
  • docs: Add Flyway example (#1002) @HofmeisterAn

๐Ÿงน Housekeeping

  • refactor: Cache Docker image full and host name (#1043) @HofmeisterAn
  • chore: Remove unnecessary internal APIs (#1020) @HofmeisterAn
  • chore: Update SSH.NET to version 2023.0.0 (#1019) @WojciechNagorski

3.5.0

8 months ago

What's Changed

๐Ÿš€ Features

  • feat: Allow MongoDb module configuration without credentials (#983) @the-avid-engineer
  • feat: Add support for RSA private key (RsaPrivateCrtKeyParameters) TLS authentication with protected Docker daemon sockets (#978) @zuntio
  • feat: Add InfluxDb module (#975) @MelomanG

๐Ÿ› Bug Fixes

  • fix: Do not pre pull Dockerfile build stages that do not correspond to base images (#979) @HofmeisterAn

๐Ÿ“– Documentation

  • docs: Add documentation on enabling debug log messages for the default logger (#991) @HofmeisterAn
  • docs: Add global Testcontainers header (#967) @leocross

๐Ÿงน Housekeeping

  • chore: Improve error message when Docker is not running (#987) @0xced
  • chore: Update BouncyCastle.Cryptography to 2.2.1 (previous Portable.BouncyCastle) (#985) @jcmrva
  • chore: Add User-Agent HTTP header to Docker.DotNet client (#970) @eddumelendez
  • chore: Remove CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT env var (#971) @eddumelendez

3.4.0

9 months ago

Thank you to all contributors for your valuable efforts towards this release. Your contributions are greatly appreciated โค๏ธ.

What's Changed

โš ๏ธ Breaking Changes

  • chore: Remove WithResourceMapping(string, string, UnixFileModes) obsolete flag (#964) @HofmeisterAn
  • chore: Remove obsolete member CopyFileAsync (#937) @HofmeisterAn

๐Ÿš€ Features

  • feat: Add Azure Data Explorer Kusto emulator module (#963) @JonasBenz
  • feat: Restore output consumer support (#959) @jacobjmarks
  • feat: Pull dependent images from private registries while building an image (#951) @benjaminangerer
  • feat: Add ClickHouse module (#944) @smbecker
  • chore: Disable Elasticsearch GeoIP2 downloads (#945) @HofmeisterAn

๐Ÿ› Bug Fixes

  • fix(CosmosDb): Wait until all partitions are started (#961) @jacobjmarks
  • fix: Do not dispose a custom HTTP message handler in an HTTP wait strategy (#958) @jacobjmarks
  • fix(MySql): Rename default database to test (do not use MySQL system schema) (#949) @benjaminoerskovtryg
  • fix: Replaceย mysql withย mariadb binary inย MariaDBย module (#942) @FlorianHockmann
  • fix: Copy files to container without removing first character from filename (#938) @HofmeisterAn

๐Ÿ“– Documentation

  • docs: Provide instructions for copying directories or files to the container (#939) @HofmeisterAn

๐Ÿงน Housekeeping

  • chore: Disable signing NuGet dependencies (#968) @HofmeisterAn
  • chore: Add test coverage to unbound port bindings (#966) @HofmeisterAn
  • chore: Bump Azurite from 3.23.0 to 3.24.0 (#947) @Xzelsius
  • chore: Remove obsolete member CopyFileAsync (#937) @HofmeisterAn

3.3.0

10 months ago

What's Changed

๐Ÿš€ Features

  • feat: Add support for copying directories and files to a container (#913) @HofmeisterAn
  • feat: Change access modifier of OracleBuilder.WithUsername(string) to public (#923) @0xced
  • feat: Add UsingHttpMessageHandler(HttpMessageHandler) to HttpWaitStrategy (#910) @mkstephenson

๐Ÿ› Bug Fixes

  • fix: Use the actual Docker endpoint to extract the socket path for the Resource Reaper (#930) @HofmeisterAn
  • fix: Ensure site_url is set in the MkDocs config to prevent None in sitemap generation (#927) @leocross
  • fix: Remove cref from inheritdoc (#922) @HofmeisterAn
  • fix: Add Docker Desktop (for Linux / macOS) authentication provider (#911) @HofmeisterAn

๐Ÿ“– Documentation

  • docs: Fix typo in Testcontainers properties file path (#935) @HofmeisterAn
  • docs: Update Testcontainers for Java docs url (#916) @leocross
  • docs: Add RabbitMQ module documentation incl. an example (#918) @AnnaErdi
  • docs: Replaceย "mess up" with "clutter up" in the best practices (#905) @gurry

๐Ÿงน Housekeeping

  • chore: Add DebugLogLevelEnabled property to default logger implementation (#928) @HofmeisterAn
  • chore: Set ContinuousIntegrationBuild and EmbedUntrackedSources MSBuild propery (#926) @HofmeisterAn
  • fix: Prefer indexing instead of Enumerable methods (#912) @HofmeisterAn
  • fix: Refactor tests to support Podman container runtime (#906) @HofmeisterAn
  • chore: Update WeatherForecast example (#904) @HofmeisterAn
  • chore: Refactor legacy TestcontainersContainerTest class (#901) @HofmeisterAn

3.2.0

11 months ago

What's Changed

๐Ÿš€ Features

  • feat: Add TC host strategy (#885) @HofmeisterAn
  • feat: Add Keycloak module (#880) @VMelnalksnis
  • feat: Add Docker image build policy (#882) @HofmeisterAn

๐Ÿ› Bug Fixes

  • fix: Do not create a Port Forwarding Container instance if auto-discovery does not detect Docker host (#900) @HofmeisterAn
  • fix: Replace CLI command to detect open ports in Linux containers (#883) @HofmeisterAn
  • fix: Remove trailing slash from rootless Docker socket path (#881) @HofmeisterAn

๐Ÿ“– Documentation

  • docs: Add information about running Testcontainers in specific CI environments (#895) @HofmeisterAn
  • fix: Typo in Selenium (#893) @dotkarl
  • docs: Link to Wikipedia to explain the .properties file format (#889) @HofmeisterAn
  • docs: Add Docker remote host configuration (#888) @HofmeisterAn

๐Ÿงน Housekeeping

  • chore: Favor custom environment variable configurations over properties file (#899) @HofmeisterAn
  • chore: Update Docker.DotNet from version 3.125.13 to 3.125.15 (#898) @HofmeisterAn
  • chore: Update Ryuk image from version 0.4.0 to 0.5.1 (#896) @HofmeisterAn
  • chore: Build image with ITestcontainersClient implementation (#884) @HofmeisterAn

3.1.0

1 year ago

What's Changed

โš ๏ธ Breaking Changes

  • As mentioned in the two previous releases, we replaced the legacy extension method modules with a dedicated API. We recommend moving forward to the new API. In this release, all classes and interfaces related to the legacy extension method approach have been removed.

๐Ÿš€ Features

  • feat: Add default session-id label to Docker resources (#878) @HofmeisterAn
  • feat: Expose host ports (#873) @HofmeisterAn
  • feat: Automatically detect Docker Desktop for Linux rootless socket (#872) @HofmeisterAn
  • feat: Replace Azurite module (#871) @HofmeisterAn
  • feat: Add .NET Source Link to modules (#870) @HofmeisterAn
  • feat: Detect rootless Docker endpoint configurations (#868) @HofmeisterAn
  • feat: Always use Docker's assigned random host port (Ryuk) (#852) @HofmeisterAn
  • feat: Add container builder member to depend on other Docker resources (#832) @HofmeisterAn
  • feat: Add K3s module (#835) @adar2
  • feat: Replace CosmosDb module (#833) @AButler
  • feat: Add WebDriver module (#780) @ShaharM7

๐Ÿ› Bug Fixes

  • fix: KafkaException (timeout) while creating a topic (#849) @HofmeisterAn
  • fix: Log Docker image build progress messages (#839) @HofmeisterAn

๐Ÿ“– Documentation

  • docs: Explain how to delete multi-stage intermediate layers (#867) @HofmeisterAn
  • docs: Explain the Docker build context (building a Docker image) (#861) @HofmeisterAn
  • docs: Update ASP.NET Core Blazor out-off-process example (#838) @HofmeisterAn
  • docs: Update the documentation and WeatherForecast example (#823) @HofmeisterAn

๐Ÿงน Housekeeping

  • chore: Update Ryuk image from version 0.3.4 to 0.4.0 (#854) @HofmeisterAn
  • chore: Update LocalStack image from version 1.4 to 2.0 (#864) @HofmeisterAn
  • chore: Update Redpanda image (#840) @eddumelendez
  • feat: Prepare next release cycle (3.1.0) (#822) @HofmeisterAn

3.0.0

1 year ago

What's Changed

We have added and replaced the modules mentioned below. Each module contains its own builder and configuration type, making it much easier to support various test cases. Currently, the modules are designed to quickly spin up common configurations of real dependencies to establish a connection to the application or service running inside it.

We are interested in your opinions and requirements in regards of the module's capabilities. Creating great modules is a community effort, so please consider sharing your thoughts with us and other Testcontainers users in this discussion or in our Slack workspace.

We will continuously add module features and documentation. Currently, information on how to configure and run modules can be found in the tests. If you are already familiar with Testcontainers, you should have no trouble understanding it as the experience is very similar as before. Here is a quick example using xUnit.net:

public sealed class ModuleSupport : IAsyncLifetime
{
    private readonly MsSqlContainer _msSqlContainer = new MsSqlBuilder().Build();

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

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

    [Fact]
    public void ConnectionStateReturnsOpen()
    {
        // Given
        using DbConnection connection = new SqlConnection(_msSqlContainer.GetConnectionString());

        // When
        connection.Open();

        // Then
        Assert.Equal(ConnectionState.Open, connection.State);
    }
}

โš ๏ธ Breaking Changes

  • chore!: Remove legacy WithCreateContainerParametersModifier(Action<CreateContainerParameters>) (#809) @HofmeisterAn
  • chore!: Remove legacy IDockerImage (#808) @HofmeisterAn
  • chore!: Remove legacy TestcontainersVolumeBuilder, IDockerVolume (#805) @HofmeisterAn
  • chore!: Remove legacy TestcontainersNetworkBuilder, IDockerNetwork (#804) @HofmeisterAn
Old name New name
ITestcontainersContainer, IDockerContainer, IRunningDockerContainer IContainer
IDockerImage IImage
IDockerNetwork INetwork
IDockerVolume IVolume
TestcontainersBuilder ContainerBuilder
TestcontainersContainer DockerContainer
TestcontainersNetworkBuilder NetworkBuilder
TestcontainersVolumeBuilder VolumeBuilder
WithCreateContainerParametersModifier WithCreateParameterModifier

๐Ÿš€ Features

  • feat: Sign assemblies with a strong name (#815) @HofmeisterAn
  • feat: Add SQL Edge module (#812) @HofmeisterAn
  • feat: Replace Kafka module (#802) @HofmeisterAn
  • feat: Replace Couchbase module (#798) @HofmeisterAn
  • feat: Add Redpanda module (#796) @eddumelendez
  • fix: Wait until container ports are mapped, removed generated credentials (#791) @HofmeisterAn
  • feat: Replace output consumer with IContainer.GetLogsAsync(DateTime, DateTime, bool, CancellationToken) (#793) @HofmeisterAn
  • feat: Add EventStoreDb module (#778) @meysamhadeli
  • feat: Replace Elasticsearch module (#790) @HofmeisterAn
  • feat: Replace RabbitMq module (#788) @HofmeisterAn
  • feat: Replace Neo4j module (#785) @HofmeisterAn
  • feat: Replace CouchDb module (#779) @HofmeisterAn
  • feat: Replace MongoDB module (#776) @HofmeisterAn
  • feat: Add DynamoDB module (#768) @dominikus1993
  • feat: Replace PostgreSQL module (#772) @HofmeisterAn
  • feat: Replace Oracle module (#770) @HofmeisterAn
  • feat: Add RavenDB module (#769) @HofmeisterAn
  • feat: Add MinIO module (#760) @dominikus1993
  • feat: Replace Redis module (#764) @HofmeisterAn
  • feat: Replace MariaDB module (#763) @HofmeisterAn
  • feat: Replace MySQL module (#761) @HofmeisterAn
  • feat: Replace Microsoft SQL Server module (#757) @HofmeisterAn

๐Ÿ› Bug Fixes

  • fix: InvalidOperationException when adding future volume (#817) @HofmeisterAn
  • fix: Wait until container ports are mapped, removed generated credentials (#791) @HofmeisterAn
  • fix(#783): Dispose container while Resource Reaper is disabled (#789) @HofmeisterAn

๐Ÿ“– Documentation

  • docs: Add best practices (#816) @HofmeisterAn
  • docs: Add community links (#807) @HofmeisterAn
  • docs: Update Testcontainers for Node docs link (#806) @cristianrgreco
  • docs: Add section 'Implement a module' (#771) @HofmeisterAn
  • docs: Replace obsolete builders (#756) @HofmeisterAn

๐Ÿงน Housekeeping

  • fix: Coverlet 'Unable to read beyond end of stream' IOException (#800) @HofmeisterAn
  • chore: Clean up EventStoreDb module (#792) @HofmeisterAn
  • chore: Clean up LocalStack module (#781) @HofmeisterAn
  • chore: Clean up DynamoDB module (#774) @HofmeisterAn
  • chore: Clean up MinIO module (#766) @HofmeisterAn
  • fix: Use TCP to connect to the MySQL module (#765) @HofmeisterAn
  • fix: Use sqlcmd utility to detect readiness of the container (#759) @HofmeisterAn
  • fix: Move MsSqlContainerTest class to namespace (#758) @HofmeisterAn
  • chore: Update the WeatherForecast example to 2.4.0 (#754) @HofmeisterAn
  • chore: Remove obsolete property IDockerNetwork.Id (#753) @HofmeisterAn
  • feat: Prepare next release cycle (2.5.0) (#752) @HofmeisterAn

2.4.0

1 year ago

What's Changed

โš ๏ธ Breaking Changes

We made a concerted effort to avoid breaking changes as much as possible. Our goal was to provide a smooth transition to the new version for our users. To achieve this, we have flagged all upcoming breaking changes as obsolete, which means that they will still work for now but will be removed in the next version.

However, there may be cases where we are unable to maintain backwards compatibility. In such instances, we will do our best to provide clear documentation and guidance on how to update your code to work with the new version. We apologize in advance for any inconvenience this may cause and we appreciate your understanding.

  1. The interface member IWaitUntil.Until(ITestcontainersContainer, ILogger) has been changed to IWaitUntil.UntilAsync(IContainer). The container instance now holds the instance of ILogger.

  2. The member ImageFromDockerfileBuilder.Build() does not return a Task<string> anymore. It returns an implementation of IFutureDockerImage. To finally build the image call CreateAsync(CancellationToken).

  3. Use the ContainerBuilder instead of TestcontainersBuilder<TestcontainersContainer> or ContainerBuilder<DockerContainer> for generic (non module) configurations. If you rely on the module builder, please be aware of https://github.com/testcontainers/testcontainers-dotnet/issues/750#issuecomment-1412257694 for now.

  4. Following interfaces and classes has been renamed (the old interfaces and classes are still supported in 2.4.0):

    Old name New name
    ITestcontainersContainer, IDockerContainer, IRunningDockerContainer IContainer
    IDockerImage IImage
    IDockerNetwork INetwork
    IDockerVolume IVolume
    TestcontainersBuilder ContainerBuilder
    TestcontainersNetworkBuilder NetworkBuilder
    TestcontainersVolumeBuilder VolumeBuilder
    TestcontainersContainer DockerContainer
  • feat(#493): Add container lifecycle events (#743) @HofmeisterAn
  • refactor(#493): Replace module extension methods with module API (#729) @HofmeisterAn

๐Ÿš€ Features

  • feat: Invoke create parameter modifier for image, network, volume build or create (#746) @HofmeisterAn
  • feat(#493): Add .NET module template (#742) @HofmeisterAn
  • feat(#493): Add container lifecycle events (#743) @HofmeisterAn
  • feat(#493): Add low level modifications API for all resources (#741) @HofmeisterAn
  • refactor(#493): Replace module extension methods with module API (#729) @HofmeisterAn
  • feat: Add GitHub Codespaces configuration (Dev Container) (#735) @HofmeisterAn
  • feat(#725): Do not return JSON auth config for partial Docker registry matches (#726) @HofmeisterAn
  • chore: Replace SharpZipLib TarArchive helper class with TarOutputStream (#724) @HofmeisterAn
  • feat: Include file path in TarException: Entry closed at [...] (Docker build) (#720) @HofmeisterAn
  • feat(#715): Add HttpWaitStrategy (#717) @HofmeisterAn

๐Ÿ› Bug Fixes

  • fix: Wait until LocalStack writes ready message (#738) @HofmeisterAn

๐Ÿ“– Documentation

  • chore: Add link Open in GitHub Codespaces (#739) @eddumelendez
  • docs: Add Docker Desktop Compose example (#731) @HofmeisterAn

๐Ÿงน Housekeeping

  • chore: Rename release branch to main (#748) @HofmeisterAn
  • feat(#493): Prepare module NuGet support, sign NuGet (#744) @HofmeisterAn
  • chore: Replace host port 0 with an empty string (#727) @HofmeisterAn
  • fix: Remove Sonar finding csharpsquid:S6444 (#721) @HofmeisterAn
  • chore: Increase HttpWaitStrategy test coverage (#719) @HofmeisterAn
  • fix: Remove Sonar finding csharpsquid:S1006 (#718) @HofmeisterAn
  • chore: Reduce concurrent builds (#714) @HofmeisterAn
  • feat: Prepare next release cycle (2.4.0) (#711) @HofmeisterAn