Replies: 1 comment 1 reply
|
I think this is a great idea. I have a feeling this should be a spec appendix, since we already have similar gherkin there. I suspect we need more than just a gherkin suite... which makes me thing maybe a new repo for that actual code? Not quite sure how to split it up, but I think that's an implementation detail. @aepfli how much code besides gherkin do you foresee needing to exist, long term? I don't want to add too much actual code to the spec repo if we can avoid it. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Problem
There is currently no standard way to verify that an OpenFeature provider correctly implements the specification. Each provider is tested in isolation, with test strategies that differ across languages and vendors. This makes it hard to trust that replacing one provider with another will produce identical behavior — which is the core promise of OpenFeature.
The closest thing we have is the flagd TCK, which validates flagd-specific behavior. It proves the model works, but it is not general-purpose and cannot be adopted by other providers without significant rework.
Proposal
A Provider TCK (Technology Compatibility Kit): a suite of language-agnostic conformance tests written in Gherkin that any provider can run against by wiring up a thin harness shim. The test cases are derived directly from the OpenFeature specification — they test the provider contract, not backend logic.
What gets tested
The TCK covers only what the spec requires of providers:
TYPE_MISMATCH, not a coercionFLAG_NOT_FOUND,TYPE_MISMATCH,PARSE_ERROR,GENERALsurfaced correctly; default value returned on error; no thrown exceptions from resolutionSTATIC,TARGETING_MATCH,DEFAULT,UNKNOWN,CACHED,ERRORreturned correctlyREADY,ERROR,STALEstates reached at the right times; correct events emitted (PROVIDER_READY,PROVIDER_ERROR,PROVIDER_STALE,PROVIDER_CONFIGURATION_CHANGED)PROVIDER_CONFIGURATION_CHANGEDfires when backend signals a change; re-evaluation reflects the updated flagshutdown()cleans up without errorsThe question is also what is a must, and what a should. eg. STALE is an optional state. We should be able to also activate and deactivate this easily
What is explicitly not tested: backend evaluation logic, targeting rule behavior, flag modification APIs, or how the provider communicates with its backend.
Architectural-Idea (just one possible idea)
The harness controls the mock backend — not the provider. This is what makes disconnect testing, flag change events, and error conditions deterministic and reproducible across providers.
Each provider author implements one interface (approximately) or a defined docker image with rest endpoints.
That's the full surface area. Point your provider at
localhost:{port}, implement the harness, run the suite.Language agnosticism
Test cases are defined once in Gherkin. Each language ecosystem provides:
The mock backend speaks whatever protocol the provider expects (REST, gRPC, etc.). The harness drives it via the control interface above. Two providers using different protocols can run identical Gherkin scenarios.
Relation to the flagd TCK
The flagd TCK is a direct input to this work. The generalized TCK is built fresh so the contract is clean, but flagd should require minimal effort to adopt it — the scenarios are largely the same, and the harness maps cleanly to flagd's existing test infrastructure. That migration is part of validating the design.
PoC
A PoC will accompany this proposal to validate feasibility. It will:
Open questions
openfeature/provider-tckrepo, or withinopenfeature/spec?All reactions