From 4d12d00dec49f8e48651b9ee79ca5b384e850b1f Mon Sep 17 00:00:00 2001 From: Simon Schrottner Date: Mon, 16 Nov 2026 11:46:13 +0100 Subject: [PATCH] feat!: drop the legacy gherkin/ suite for tck-extensions/ BREAKING CHANGE: gherkin/ is removed. flagd providers run tck-extensions/ through the Provider TCK instead. SDKs still on the legacy suite pin a 3.x release, which keeps being cut from the release/v3 branch. Signed-off-by: Simon Schrottner --- README.md | 28 +- agents.md | 9 +- gherkin/config.feature | 387 --------------- gherkin/connection.feature | 100 ---- gherkin/contextEnrichment.feature | 50 -- gherkin/disabled.feature | 37 -- gherkin/evaluation.feature | 134 ------ gherkin/events.feature | 42 -- gherkin/metadata.feature | 57 --- gherkin/rpc-caching.feature | 60 --- gherkin/selector.feature | 23 - gherkin/sync-payload.feature | 28 -- gherkin/targeting.feature | 761 ------------------------------ tck-extensions/README.md | 12 +- 14 files changed, 21 insertions(+), 1707 deletions(-) delete mode 100644 gherkin/config.feature delete mode 100644 gherkin/connection.feature delete mode 100644 gherkin/contextEnrichment.feature delete mode 100644 gherkin/disabled.feature delete mode 100644 gherkin/evaluation.feature delete mode 100644 gherkin/events.feature delete mode 100644 gherkin/metadata.feature delete mode 100644 gherkin/rpc-caching.feature delete mode 100644 gherkin/selector.feature delete mode 100644 gherkin/sync-payload.feature delete mode 100644 gherkin/targeting.feature diff --git a/README.md b/README.md index 9b39897d..5677d7ce 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. --- @@ -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 diff --git a/agents.md b/agents.md index 27d361a7..582b721c 100644 --- a/agents.md +++ b/agents.md @@ -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. @@ -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) | @@ -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. @@ -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. diff --git a/gherkin/config.feature b/gherkin/config.feature deleted file mode 100644 index 8024e22a..00000000 --- a/gherkin/config.feature +++ /dev/null @@ -1,387 +0,0 @@ -Feature: Configuration Test -"""markdown - This is the official option configuration table - | Option name | Environment variable name | Explanation | Type & Values | Default | Compatible resolver | - | --------------------- | ------------------------------ | --------------------------------------------------------------------------------------------------------------- | ---------------------------- | ----------------------------- | ------------------- | - | resolver | FLAGD_RESOLVER | mode of operation | String - `rpc`, `in-process` | rpc | rpc & in-process | - | host | FLAGD_HOST | remote host | String | localhost | rpc & in-process | - | port | FLAGD_PORT | remote port | int | 8013 (rpc), 8015 (in-process) | rpc & in-process | - | targetUri | FLAGD_TARGET_URI | alternative to host/port, supporting custom name resolution | string | null | rpc & in-process | - | tls | FLAGD_TLS | connection encryption | boolean | false | rpc & in-process | - | socketPath | FLAGD_SOCKET_PATH | alternative to host port, unix socket | String | null | rpc & in-process | - | certPath | FLAGD_SERVER_CERT_PATH | tls cert path | String | null | rpc & in-process | - | deadlineMs | FLAGD_DEADLINE_MS | deadline for unary calls, and timeout for initialization | int | 500 | rpc & in-process | - | streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | deadline for streaming calls, useful as an application-layer keepalive | int | 600000 | rpc & in-process | - | retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | initial backoff for stream retry | int | 1000 | rpc & in-process | - | retryBackoffMaxMs | FLAGD_RETRY_BACKOFF_MAX_MS | maximum backoff for stream retry | int | 5000 | rpc & in-process | - | retryGracePeriod | FLAGD_RETRY_GRACE_PERIOD | time before provider moves from STALE to ERROR state | int | 10 | rpc & in-process | - | keepAliveTime | FLAGD_KEEP_ALIVE_TIME_MS | http 2 keepalive | long | 0 | rpc & in-process | - | cache | FLAGD_CACHE | enable cache of static flags | String - `lru`, `disabled` | lru | rpc | - | maxCacheSize | FLAGD_MAX_CACHE_SIZE | max size of static flag cache | int | 1000 | rpc | - | selector | FLAGD_SOURCE_SELECTOR | selects a single sync source to retrieve flags from only that source | string | null | in-process | - | offlineFlagSourcePath | FLAGD_OFFLINE_FLAG_SOURCE_PATH | offline, file-based flag definitions, overrides host/port/targetUri | string | null | in-process | - | offlinePollIntervalMs | FLAGD_OFFLINE_POLL_MS | poll interval for reading offlineFlagSourcePath | int | 5000 | in-process | - | contextEnricher | - | sync-metadata to evaluation context mapping function | function | identity function | in-process | - | fatalStatusCodes | FLAGD_FATAL_STATUS_CODES | a list of gRPC status codes, which will cause streams to give up and put the provider in a PROVIDER_FATAL state | array | [] | rpc & in-process | -""" - - Scenario Outline: Default Config - When a config was initialized - Then the option "