orleans icon indicating copy to clipboard operation
orleans copied to clipboard

Simplify testing infrastructure to use Testcontainers

Open Meir017 opened this issue 2 months ago • 5 comments

Goal

Simplify the testing infrastructure by migrating from GitHub Actions services to Testcontainers, which will make tests easier to run locally and maintain.

Current State

The CI workflow currently uses GitHub Actions services for various providers. Here are the Docker images being used:

Database Providers

  • Redis: redis (latest)
  • PostgreSQL: postgres (latest)
  • MariaDB/MySQL: mariadb:10.6
  • SQL Server: mcr.microsoft.com/mssql/server:latest

Azure Services

  • Azure Storage (Azurite): mcr.microsoft.com/azure-storage/azurite:latest

Clustering Providers

  • ZooKeeper: zookeeper:3.9
  • Consul: (uses local installation, not containerized yet)

AWS Providers

  • DynamoDB: amazon/dynamodb-local:latest

Streaming Providers

  • NATS: nats:latest (started with --js --http-port=8222 flags)

Not Containerized

  • Cassandra: Currently uses environment variable CASSANDRAVERSION with versions 4.0, 4.1, 5.0 (needs investigation on how it's started)
  • Cosmos DB: Currently disabled (if: ${{ false }}) - uses Azure Cosmos DB Emulator on Windows

Tasks

  • [ ] Migrate Redis tests to Testcontainers
  • [ ] Migrate PostgreSQL tests to Testcontainers
  • [ ] Migrate MariaDB/MySQL tests to Testcontainers
  • [ ] Migrate SQL Server tests to Testcontainers
  • [ ] Migrate Azure Storage (Azurite) tests to Testcontainers
  • [ ] Migrate ZooKeeper tests to Testcontainers
  • [ ] Migrate Consul tests to Testcontainers #9707
  • [ ] Migrate DynamoDB tests to Testcontainers
  • [ ] Migrate NATS tests to Testcontainers
  • [ ] Migrate Cassandra tests to Testcontainers (versions 4.0, 4.1, 5.0)
  • [ ] Investigate and migrate Cosmos DB tests to Testcontainers (if feasible)
  • [ ] Update documentation for running tests locally
  • [ ] Remove GitHub Actions services configuration from CI workflow

Migration Plan

For each provider, we should:

  1. Replace GitHub Actions services with Testcontainers equivalents
  2. Ensure tests can run both in CI and locally
  3. Maintain the same test coverage and configuration
  4. Update documentation for running tests locally

Benefits

  • Local Development: Developers can run all provider tests locally without manual setup
  • Consistency: Same container images used in CI and local development
  • Maintainability: Easier to update versions and configurations
  • Cross-platform: Works on Windows, Linux, and macOS (where Docker is available)

Meir017 avatar Oct 05 '25 20:10 Meir017

@ReubenBond thoughts on this?

Meir017 avatar Oct 23 '25 20:10 Meir017

If this works well with GitHub Actions and other CIs, then I'm all for it.

ReubenBond avatar Oct 23 '25 21:10 ReubenBond

I don't see a testcontainers package for zookeeper

ReubenBond avatar Oct 23 '25 21:10 ReubenBond

Ceeared https://github.com/testcontainers/testcontainers-dotnet/issues/1560 or we could use the generic container and handle this one last

Meir017 avatar Oct 23 '25 22:10 Meir017

I added the TestContainers packages to the .NET feed, they should be there now.

ReubenBond avatar Oct 23 '25 22:10 ReubenBond