Skip to content

Commit

Permalink
fixup: formating
Browse files Browse the repository at this point in the history
Signed-off-by: Todd Baert <[email protected]>
  • Loading branch information
toddbaert committed Sep 5, 2023
1 parent d575557 commit 88eec8e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 26 deletions.
4 changes: 3 additions & 1 deletion .gherkin-lintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"Feature": 0,
"Background": 2,
"Scenario": 2,
"Step": 4
"Step": 4,
"Examples": 4,
"example": 6
}
],
"no-trailing-spaces": "on",
Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,20 @@ See the [flagd docs](https://flagd.dev/) for more information on flagd.
The _sync_-testbed_ container is a docker image built on conforming to the sync.proto - a grpc which flagd or flagd in-process providers can use as a sync-source.
It features an identical set of flags to the [flagd-testbed container](#flagd-testbed-container)

For details on the sync-testbed, see [sync/README.me](sync/README.md)
For details on the sync-testbed, see [sync/README.me](sync/README.md)

## Gherkin test suite

The [gherkin/](gherkin/) dir includes a set of [_gherkin_](https://cucumber.io/docs/gherkin/) tests that define expected behavior associated with the configurations defined in the flagd-testbed (see [flags/](flags/)).
Combined with the _flagd-provider_ for the associated SDK and the flagd-testbed, these comprise a complete integration test suite.
They include tests for:
* default value (zero-value) handling (some proto3 implementations handle these inconsistently).
* basic event handling
* custom JSONLogic operators (`starts_with`, `ends_with`, `fractional`, `sem_ver`)

### Lint Gherkin files

The Gherkin files structure can be linted using [gherkin-lint](https://github.com/vsiakka/gherkin-lint). The following commands require Node.js 10 or later.

1. npm install
1. npm run gherkin-lint
48 changes: 24 additions & 24 deletions gherkin/flagd.feature
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Feature: flagd providers

# This test suite contains scenarios to test flagd providers (both RPC and in-process).
# It's associated with the flags configured in flags/custom-ops.json and flags/zero-flags.json
# It should be used in conjunection with the suites supplied by the OpenFeature specification
# This test suite contains scenarios to test flagd providers (both RPC and in-process).
# It's associated with the flags configured in flags/custom-ops.json and flags/zero-flags.json
# It should be used in conjunection with the suites supplied by the OpenFeature specification

Background:
Given a flagd provider is set

Expand Down Expand Up @@ -41,41 +41,41 @@ Feature: flagd providers
And a context containing a nested property with outer key "user" and inner key "name", with value <name>
Then the returned value should be <value>
Examples:
|name|value|
|jack|clubs|
|queen|diamonds|
|ace|hearts|
|joker|spades|
| name | value |
| jack | clubs |
| queen | diamonds |
| ace | hearts |
| joker | spades |

Scenario Outline: Substring operators
When a string flag with key "starts-ends-flag" is evaluated with default value "fallback"
And a context containing a key "id", with value <id>
Then the returned value should be <value>
Examples:
|id|value|
|abcdef|prefix|
|uvwxyz|postfix|
|abcxyz|prefix|
|lmnopq|nomatch|
| id | value |
| abcdef | prefix |
| uvwxyz | postfix |
| abcxyz | prefix |
| lmnopq | nomatch |

Scenario Outline: Semantic version operator numeric comparision
When a string flag with key "equal-greater-lesser-version-flag" is evaluated with default value "fallback"
And a context containing a key "version", with value <version>
Then the returned value should be <value>
Examples:
|version|value|
|2.0.0|equal|
|2.1.0|greater|
|1.9.0|lesser|
|2.0.0-alpha|lesser|
|2.0.0.0|invalid|
| version | value |
| 2.0.0 | equal |
| 2.1.0 | greater |
| 1.9.0 | lesser |
| 2.0.0-alpha | lesser |
| 2.0.0.0 | invalid |

Scenario Outline: Semantic version operator semantic comparision
When a string flag with key "major-minor-version-flag" is evaluated with default value "fallback"
And a context containing a key "version", with value <version>
Then the returned value should be <value>
Examples:
|version|value|
|3.0.1|minor|
|3.1.0|major|
|4.0.0|none|
| version | value |
| 3.0.1 | minor |
| 3.1.0 | major |
| 4.0.0 | none |

0 comments on commit 88eec8e

Please sign in to comment.