Skip to content
Merged
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
28 changes: 10 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Flagd Test Harness

This repository contains a Docker image to support the [Gherkin test suites](https://github.com/open-feature/spec/blob/main/specification/appendix-b-gherkin-suites.md) defined in the OpenFeature specification.
This repository contains a Docker image and flagd's [Provider TCK](https://github.com/open-feature/spec/issues/417) extension scenarios, which flagd providers run to check their behaviour.

## `flagd-testbed` Container

Expand Down Expand Up @@ -40,24 +40,16 @@ This file is generated when flagd is started and can be used to test all flags i

---

## Gherkin Test Suite
## TCK Extensions

The [`gherkin`](./gherkin) directory contains [*Gherkin*](https://cucumber.io/docs/gherkin/) tests that validate behavior for the configurations defined in the flagd-testbed (see [Flag Files](#flag-files)).
Combined with the appropriate SDK and provider, these tests form a complete integration suite.
The [`tck-extensions`](./tck-extensions) directory holds flagd's scenarios as extensions for the
[OpenFeature Provider TCK](https://github.com/open-feature/spec/issues/417): a flagd provider runs
them alongside the TCK's own scenarios, against the image above. Its
[README](./tck-extensions/README.md) covers the tags, the extension steps and how to consume it.

### Tagging

Tests are tagged to support selective execution, as not all providers or SDKs support all features. Tags can be applied at both the suite and individual test case level.

Currently supported "provider-tags":

* `@file`
* `@rpc`
* `@in-process`

For example, to run a test in RPC mode, tag the suite or test case with `@rpc`.

Tag-based filtering enables incremental migration and test execution, allowing individual features to be validated progressively rather than all at once.
The legacy `gherkin/` suite was removed in 4.0. SDKs that still run it pin a 3.x release, which
keeps being cut from the [`release/v3`](https://github.com/open-feature/flagd-testbed/tree/release/v3)
branch.

---

Expand All @@ -67,7 +59,7 @@ This repository should be included as a submodule within your sdk which should b

We recommend:
- to setup renovate to automatically update your submodule, always pointing to version tags and not branches
- to load all gherkin files, and eliminate tests via tag exclusions
- to load all extension feature files, and eliminate tests via tag exclusions
- to utilize testcontainers for easier test setup
- to use the version.txt within this repository to load the appropriate docker image

Expand Down
9 changes: 5 additions & 4 deletions agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This file provides guidance for AI agents (such as GitHub Copilot) working in th

It ships:
- A Docker image (`flagd-testbed`) bundling [flagd](https://flagd.dev/) and a control server called **Launchpad**.
- [Gherkin](https://cucumber.io/docs/gherkin/) feature files (in `gherkin/`) that define the expected behaviour of flagd providers.
- [Gherkin](https://cucumber.io/docs/gherkin/) feature files (in `tck-extensions/`) that define the expected behaviour of flagd providers, as Provider TCK extensions. The legacy `gherkin/` suite lives on the `release/v3` branch only.
- Flag definition JSON files (in `flags/`) that back the test scenarios.

SDK teams include this repo as a **git submodule**, spin up the Docker image via [Testcontainers](https://testcontainers.com/) or Docker Compose, then run the Gherkin scenarios against their provider implementation.
Expand All @@ -23,7 +23,8 @@ SDK teams include this repo as a **git submodule**, spin up the Docker image via

| Path | Description |
|------|-------------|
| `gherkin/` | Cucumber/Gherkin `.feature` files — the primary test contracts |
| `tck-extensions/` | Provider TCK extension `.feature` files — the primary test contracts; also a Go module |
| `evaluator/` | Evaluator testkit features and flags for flagd's in-process evaluators |
| `flags/` | flagd flag definition JSON files backing the scenarios |
| `flagd/` | Dockerfile and build assets for the `flagd-testbed` Docker image |
| `launchpad/` | Go HTTP server that controls flagd lifecycle during tests (start/stop/restart/change) |
Expand All @@ -37,7 +38,7 @@ This repo uses [Conventional Commits](https://www.conventionalcommits.org/) enfo

### ⚠️ Important: Gherkin and Flag Changes Are `feat:`

Changes to `gherkin/` feature files and `flags/` JSON files **must** use the `feat:` prefix (not `test:` or `chore:`).
Changes to `tck-extensions/` feature files and `flags/` JSON files **must** use the `feat:` prefix (not `test:` or `chore:`).

**Why:** The Gherkin scenarios and flag definitions are **the product** of this repository. They define the test contract behaviour that every provider SDK must implement. Adding or changing a scenario or flag definition is adding or changing a feature of the contract — it has downstream impact on SDK teams and triggers a version bump.

Expand Down Expand Up @@ -209,7 +210,7 @@ This applies to fixup commits, merge-conflict resolutions, and co-authored commi
When adding a new test scenario, **always provide both artefacts together**:

1. **Flag definition** — add the flag key and its variants/targeting to the appropriate `flags/*.json` file (or create a new one if it belongs to a new category).
2. **Gherkin scenario** — add the scenario to the appropriate `gherkin/*.feature` file (or create a new one).
2. **Gherkin scenario** — add the scenario to the appropriate `tck-extensions/*.feature` file (or create a new one).

A PR that adds only one of the two will be incomplete — the scenario will fail in all SDK test suites because either the flag or the step is missing.

Expand Down
Loading
Loading