Skip to content

Commit

Permalink
feat: add dedicated gherkin file for events (and grace attempts) (#164)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Schrottner <[email protected]>
  • Loading branch information
aepfli authored Dec 6, 2024
1 parent 4bc696e commit 22ab80c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 22 deletions.
44 changes: 22 additions & 22 deletions gherkin/config.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Feature: Configuration Test
"""markdown
"""markdown
This is the official option configuration table
| Option name | Environment variable name | Explanation | Type & Values | Default | Compatible resolver |
| --------------------- | ------------------------------ | ------------------------------------------------------------------------------- | ---------------------------- | ----------------------------- | ------------------- |
Expand Down Expand Up @@ -96,12 +96,12 @@ Feature: Configuration Test
When a config was initialized
Then the option "<option>" of type "<type>" should have the value "<value>"
Examples:
| option | type | value |
| resolver | ResolverType | in-process |
| host | String | local |
| tls | Boolean | True |
| port | Integer | 1234 |
| deadline | Integer | 123 |
| option | type | value |
| resolver | ResolverType | in-process |
| host | String | local |
| tls | Boolean | True |
| port | Integer | 1234 |
| deadlineMs | Integer | 123 |
@targetURI
Examples: Target URI
| option | type | value |
Expand Down Expand Up @@ -147,15 +147,15 @@ Feature: Configuration Test
When a config was initialized
Then the option "<option>" of type "<type>" should have the value "<value>"
Examples:
| option | env | type | value |
| resolver | FLAGD_RESOLVER | ResolverType | in-process |
| resolver | FLAGD_RESOLVER | ResolverType | IN-PROCESS |
| resolver | FLAGD_RESOLVER | ResolverType | rpc |
| resolver | FLAGD_RESOLVER | ResolverType | RPC |
| host | FLAGD_HOST | String | local |
| tls | FLAGD_TLS | Boolean | True |
| port | FLAGD_PORT | Integer | 1234 |
| deadline | FLAGD_DEADLINE_MS | Integer | 123 |
| option | env | type | value |
| resolver | FLAGD_RESOLVER | ResolverType | in-process |
| resolver | FLAGD_RESOLVER | ResolverType | IN-PROCESS |
| resolver | FLAGD_RESOLVER | ResolverType | rpc |
| resolver | FLAGD_RESOLVER | ResolverType | RPC |
| host | FLAGD_HOST | String | local |
| tls | FLAGD_TLS | Boolean | True |
| port | FLAGD_PORT | Integer | 1234 |
| deadlineMs | FLAGD_DEADLINE_MS | Integer | 123 |
@targetURI
Examples: Target URI
| option | env | type | value |
Expand Down Expand Up @@ -202,12 +202,12 @@ Feature: Configuration Test
When a config was initialized
Then the option "<option>" of type "<type>" should have the value "<value>"
Examples:
| option | env | type | value | env-value |
| resolver | FLAGD_RESOLVER | ResolverType | in-process | rpc |
| host | FLAGD_HOST | String | local | l |
| tls | FLAGD_TLS | Boolean | True | False |
| port | FLAGD_PORT | Integer | 1234 | 3456 |
| deadline | FLAGD_DEADLINE_MS | Integer | 123 | 345 |
| option | env | type | value | env-value |
| resolver | FLAGD_RESOLVER | ResolverType | in-process | rpc |
| host | FLAGD_HOST | String | local | l |
| tls | FLAGD_TLS | Boolean | True | False |
| port | FLAGD_PORT | Integer | 1234 | 3456 |
| deadlineMs | FLAGD_DEADLINE_MS | Integer | 123 | 345 |
@targetURI
Examples: Target URI
| option | env | type | value | env-value |
Expand Down
24 changes: 24 additions & 0 deletions gherkin/events.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@grace
Feature: Flagd Provider State Changes

Background:
Given a flagd provider is set

Scenario Outline: Provider events
When a <event> handler is added
Then the <event> handler must run
Examples:
| event |
| PROVIDER_ERROR |
| PROVIDER_STALE |
| PROVIDER_READY |

Scenario: Provider events chain ready -> stale -> error -> ready
When a PROVIDER_READY handler is added
Then the PROVIDER_READY handler must run
When a PROVIDER_STALE handler is added
Then the PROVIDER_STALE handler must run
When a PROVIDER_ERROR handler is added
Then the PROVIDER_ERROR handler must run
When a PROVIDER_READY handler is added
Then the PROVIDER_READY handler must run

0 comments on commit 22ab80c

Please sign in to comment.