Skip to content

feat: flagd Testcontainers module for integration tests #1992

Backlog

Description

@joe-chambers

Problem

Testing an application that uses the flagd provider against a real flagd currently means hand-rolling a GenericContainer: the image, the start command, ports, readiness, copying flag files in, and TLS. The repo's flagd e2e suite uses the Compose-based test-harness, which is built for conformance testing rather than for consumers' own tests.

Proposal

Add a tools/flagd-testcontainer module (dev.openfeature.contrib.tools:flagd-testcontainer) with a FlagdContainer Testcontainers class:

  • flags from a classpath resource, host file, JSON string, or any flagd --uri; flags can be replaced while the container runs
  • mapped ports for the evaluation, sync, OFREP and management services, with readiness on /readyz
  • TLS, --context-value / --context-from-header, and an escape hatch for other flagd arguments
  • connection details for the test host and for containers on the same Docker network, including the FLAGD_* environment variables the flagd provider reads and per-source selectors

Its only compile dependency is org.testcontainers:testcontainers.

I have an implementation ready and I'm happy to own the module.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions