Coder Social home page Coder Social logo

open-feature / flagd-testbed Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 7.0 368 KB

Shared test harness for flagd SDK testing, with Gherkin tests

Home Page: https://openfeature.dev

Dockerfile 6.14% Shell 8.74% Makefile 0.55% Go 43.23% Gherkin 41.34%

flagd-testbed's People

Contributors

beeme1mr avatar colebaileygit avatar github-actions[bot] avatar kavindu-dodan avatar odubajdt avatar realanna avatar renovate[bot] avatar skyerus avatar tcarrio avatar toddbaert avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flagd-testbed's Issues

Repetitive "then"s in evaluation.feature

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"

Implement tests for injected properties

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 rules

Add tests for configuration nuances and misconfugurations

We should add some flags here and associated tests here for common edge cases and mis-configurations, including:

  • targeting rule returns null should fall through to defaultVariant and return reason STATIC
  • invalid/erroneous JSON logic (should error, and cause use of application (SDK) default)
  • targeting returns a variant which is not in variant definition (should error, and cause use of application (SDK) default)

Implement `events` e2e gherken test suite

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:

  • new gherkin suite testing events happy path
  • supporting changes in flagd-testbed container

Blocked by:

  • flagd providers updated to use events

Add new test suite for caching

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.

Release versioned flagd-testbed image

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.

[TESTING] remove testbed sync-server in favor of flagd v0.9.1+

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.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
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-actions
.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
gomod
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
npm
package.json
  • gherkin-lint ^4.2.2

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.