open-feature / flagd-testbed Goto Github PK
View Code? Open in Web Editor NEWShared test harness for flagd SDK testing, with Gherkin tests
Home Page: https://openfeature.dev
Shared test harness for flagd SDK testing, with Gherkin tests
Home Page: https://openfeature.dev
Two of the rules in evaluation.feature
have repeating "then"s.
For example:
Then then the resolved string response should be "INTERNAL"
instead of
Then the resolved string response should be "INTERNAL"
We inject a few properties. We should have some simple gherkin tests (probably added here) which assert that:
$flagd.flagKey
and $flagd.timestamp
can be used as expected in rulesThe current evaluation.feature suite does a good job covering the basic behavior concerning providers / evaluation API, but things like context merging precedence and hook behavior aren't really tested here.
We should create a new suite that tests some of the above.
We should add some flags here and associated tests here for common edge cases and mis-configurations, including:
null
should fall through to defaultVariant
and return reason STATIC
We need a test suite that can be used to test events in all implementing SDKs. Just like our existing suites, it should use the flagd-testbed
docker image. It must implement tests for the PROVIDER_READY
and PROVIDER_CONFIGURATION_CHANGED
events. To simplify things, the container might have one flag which is changed by a simple bash script at a fixed interval automatically. This would allow us to easily subscribe to flag changes without the need to share a volume with the container:
{
"flags": {
"changing-flag": {
"state": "ENABLED",
"variants": {
"flip": "FLIP",
"flop": "FLOP"
},
"defaultVariant": "flip" // this value will change every 3 seconds
}
}
}
Definition of done:
events
happy pathBlocked by:
As caching is being implemented in flagd providers it'd be good to have integration tests for asserting the behaviour is as expected when wired up.
Consider e2e test failures in Go SDK testing 1. This seems to be caused by the sync server and we need to investigate the root cause.
AC
Improve the sync server so that e2e tests become stable
Currently, the test-harness builds, tags as latest
and pushes the flagd-testbed image.
This practice has caused PR workflow processes to fail due to not absorbing test changes required by a later update of flagd.
While it is a good thing to be notified that the tests are failing against an upgraded flagd, having it apparent in unrelated PRs is cumbersome and confusing.
Imo, a better practice would be to version the flagd-testbed image (same version as the base flagd image) and introduce renovate config into the relevant repos to check for flagd-testbed image upgrades. This way any test failures against an upgraded flagd is only apparent in the renovate PR and it's immediately clear to see what's going wrong.
flagd releasing ought to trigger an upgrade of the flagd testbed image to avoid the integration tests running against a stale image.
flagd itself now implements the sync.proto. This means the sync-server in this repo (only used for testing) can be replaced with flagd itself.
Currently, the suite asserts that a flag has been removed from cache but not that other flags are still present in cache.
This means an implementation could hypothetically be purging all cache on update of a flag, this ought to be checked in tests.
s/gerkin/gherkin/
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
flagd/Dockerfile
ghcr.io/open-feature/flagd v0.10.2
busybox 1.36
flagd/Dockerfile.unstable
ghcr.io/open-feature/flagd v0.10.2
busybox 1.36
sync/Dockerfile
golang 1.22-alpine
busybox 1.36
sync/Dockerfile.unstable
golang 1.22-alpine
busybox 1.36
.github/workflows/ci.yml
actions/checkout v4
actions/setup-node v4
docker/build-push-action v5
docker/build-push-action v5
docker/build-push-action v5
docker/build-push-action v5
.github/workflows/lint-pr.yml
amannn/action-semantic-pull-request v5
marocchino/sticky-pull-request-comment v2
marocchino/sticky-pull-request-comment v2
.github/workflows/release-please.yml
google-github-actions/release-please-action v3
actions/checkout v4
docker/login-action v3
docker/build-push-action v5
docker/build-push-action v5
docker/build-push-action v5
docker/build-push-action v5
sync/go.mod
go 1.21
buf.build/gen/go/open-feature/flagd/grpc/go v1.3.0-20240215170432-1e611e2999cc.3@1e611e2999cc
buf.build/gen/go/open-feature/flagd/protocolbuffers/go v1.34.1-20240215170432-1e611e2999cc.1@1e611e2999cc
github.com/fsnotify/fsnotify v1.7.0
golang.org/x/exp v0.0.0-20240525044651-4c93da0ed11d@4c93da0ed11d
google.golang.org/grpc v1.64.0
package.json
gherkin-lint ^4.2.2
Currently, a flagd upgrade is classed as a chore(deps)
, therefore not considered enough for a release.
In order for the integration tests to run against the latest flagd a release of test-harness is needed for each flagd release.
Automate this process.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.