open-feature / flagd-testbed

Shared test harness for flagd SDK testing, with Gherkin tests
https://openfeature.dev
4 stars 7 forks source link

OpenFeature Test Harness

This repository contains a docker image to support the gherkin suites in the OpenFeature specification.

flagd-testbed container

The flagd-testbed container is a docker image built on flagd, which essentially just adds a simple set of flags for the purposes of testing OpenFeature SDKs. testing-flags.json contains a set of flags consistent with the evaluation feature. change-flag.sh runs in the test container generates a file changing-flag.json, which contains a flag that changes once every seconds, allowing to easily test change events.

See the flagd docs for more information on flagd.

Gherkin test suite

The gherkin/ dir includes a set of gherkin tests that define expected behavior associated with the configurations defined in the flagd-testbed (see flags/). Combined with the flagd-provider for the associated SDK and the flagd-testbed, these comprise a complete integration test suite.

Included suites:

flagd.feature includes tests relevant to flagd and all flagd providers:

flagd-json-evaluator.feature includes tests relevant to flagd and in-process providers:

Lint Gherkin files

The Gherkin files structure can be linted using gherkin-lint. The following commands require Node.js 10 or later.

  1. npm install
  2. npm run gherkin-lint