Skip to content

Commit

Permalink
feat: improve gherkin files
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Schrottner <[email protected]>
  • Loading branch information
aepfli committed Dec 17, 2024
1 parent cc5e037 commit 796c0e8
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 68 deletions.
4 changes: 2 additions & 2 deletions .gherkin-lintrc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
{
"steps-length": {
"Background": 3,
"Scenario": 15
"Scenario": 16
}
}
]
}
}
106 changes: 53 additions & 53 deletions gherkin/config.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Feature: Configuration Test
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | deadline for streaming calls, useful as an application-layer keepalive | int | 600000 | rpc & in-process |
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | initial backoff for stream retry | int | 1000 | rpc & in-process |
| retryBackoffMaxMs | FLAGD_RETRY_BACKOFF_MAX_MS | maximum backoff for stream retry | int | 120000 | rpc & in-process |
| retryGraceAttempts | FLAGD_RETRY_GRACE_ATTEMPTS | amount of stream retry attempts before provider moves from STALE to ERROR state | int | 5 | rpc & in-process |
| retryGracePeriod | FLAGD_RETRY_GRACE_PERIOD | amount of stream retry attempts before provider moves from STALE to ERROR state | int | 5 | rpc & in-process |
| keepAliveTime | FLAGD_KEEP_ALIVE_TIME_MS | http 2 keepalive | long | 0 | rpc & in-process |
| cache | FLAGD_CACHE | enable cache of static flags | String - `lru`, `disabled` | lru | rpc |
| maxCacheSize | FLAGD_MAX_CACHE_SIZE | max size of static flag cache | int | 1000 | rpc |
Expand Down Expand Up @@ -49,21 +49,21 @@ Feature: Configuration Test
| socketPath | String | null |
@events
Examples: Events
| option | type | default |
| streamDeadlineMs | Integer | 600000 |
| keepAliveTime | Long | 0 |
| retryBackoffMs | Integer | 1000 |
| retryBackoffMaxMs | Integer | 120000 |
| retryGraceAttempts | Integer | 5 |
| option | type | default |
| streamDeadlineMs | Integer | 600000 |
| keepAliveTime | Long | 0 |
| retryBackoffMs | Integer | 1000 |
| retryBackoffMaxMs | Integer | 120000 |
| retryGracePeriod | Integer | 5 |
@sync
Examples: Sync
| option | type | default |
| streamDeadlineMs | Integer | 600000 |
| keepAliveTime | Long | 0 |
| retryBackoffMs | Integer | 1000 |
| retryBackoffMaxMs | Integer | 120000 |
| retryGraceAttempts | Integer | 5 |
| selector | String | null |
| option | type | default |
| streamDeadlineMs | Integer | 600000 |
| keepAliveTime | Long | 0 |
| retryBackoffMs | Integer | 1000 |
| retryBackoffMaxMs | Integer | 120000 |
| retryGracePeriod | Integer | 5 |
| selector | String | null |
@caching
Examples: caching
| option | type | default |
Expand Down Expand Up @@ -119,21 +119,21 @@ Feature: Configuration Test
| socketPath | String | path |
@events
Examples:
| option | type | value |
| streamDeadlineMs | Integer | 500000 |
| keepAliveTime | Long | 5 |
| retryBackoffMs | Integer | 5000 |
| retryBackoffMaxMs | Integer | 12000 |
| retryGraceAttempts | Integer | 10 |
| option | type | value |
| streamDeadlineMs | Integer | 500000 |
| keepAliveTime | Long | 5 |
| retryBackoffMs | Integer | 5000 |
| retryBackoffMaxMs | Integer | 12000 |
| retryGracePeriod | Integer | 10 |
@sync
Examples:
| option | type | value |
| streamDeadlineMs | Integer | 500000 |
| keepAliveTime | Long | 5 |
| retryBackoffMs | Integer | 5000 |
| retryBackoffMaxMs | Integer | 12000 |
| retryGraceAttempts | Integer | 10 |
| selector | String | selector |
| option | type | value |
| streamDeadlineMs | Integer | 500000 |
| keepAliveTime | Long | 5 |
| retryBackoffMs | Integer | 5000 |
| retryBackoffMaxMs | Integer | 12000 |
| retryGracePeriod | Integer | 10 |
| selector | String | selector |
@caching
Examples:
| option | type | value |
Expand Down Expand Up @@ -174,21 +174,21 @@ Feature: Configuration Test
| socketPath | FLAGD_SOCKET_PATH | String | path |
@events
Examples:
| option | env | type | value |
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | Integer | 500000 |
| keepAliveTime | FLAGD_KEEP_ALIVE_TIME_MS | Long | 5 |
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | Integer | 5000 |
| retryBackoffMaxMs | FLAGD_RETRY_BACKOFF_MAX_MS | Integer | 12000 |
| retryGraceAttempts | FLAGD_RETRY_GRACE_ATTEMPTS | Integer | 10 |
| option | env | type | value |
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | Integer | 500000 |
| keepAliveTime | FLAGD_KEEP_ALIVE_TIME_MS | Long | 5 |
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | Integer | 5000 |
| retryBackoffMaxMs | FLAGD_RETRY_BACKOFF_MAX_MS | Integer | 12000 |
| retryGracePeriod | FLAGD_RETRY_GRACE_PERIOD | Integer | 10 |
@sync
Examples:
| option | env | type | value |
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | Integer | 500000 |
| keepAliveTime | FLAGD_KEEP_ALIVE_TIME_MS | Long | 5 |
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | Integer | 5000 |
| retryBackoffMaxMs | FLAGD_RETRY_BACKOFF_MAX_MS | Integer | 12000 |
| retryGraceAttempts | FLAGD_RETRY_GRACE_ATTEMPTS | Integer | 10 |
| selector | FLAGD_SOURCE_SELECTOR | String | selector |
| option | env | type | value |
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | Integer | 500000 |
| keepAliveTime | FLAGD_KEEP_ALIVE_TIME_MS | Long | 5 |
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | Integer | 5000 |
| retryBackoffMaxMs | FLAGD_RETRY_BACKOFF_MAX_MS | Integer | 12000 |
| retryGracePeriod | FLAGD_RETRY_GRACE_PERIOD | Integer | 10 |
| selector | FLAGD_SOURCE_SELECTOR | String | selector |
@caching
Examples:
| option | env | type | value |
Expand Down Expand Up @@ -227,21 +227,21 @@ Feature: Configuration Test
| socketPath | FLAGD_SOCKET_PATH | String | path | rpc |
@events
Examples:
| option | env | type | value | env-value |
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | Integer | 500000 | 400 |
| keepAliveTime | FLAGD_KEEP_ALIVE_TIME_MS | Long | 5 | 4 |
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | Integer | 5000 | 4 |
| retryBackoffMaxMs | FLAGD_RETRY_BACKOFF_MAX_MS | Integer | 12000 | 4 |
| retryGraceAttempts | FLAGD_RETRY_GRACE_ATTEMPTS | Integer | 10 | 4 |
| option | env | type | value | env-value |
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | Integer | 500000 | 400 |
| keepAliveTime | FLAGD_KEEP_ALIVE_TIME_MS | Long | 5 | 4 |
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | Integer | 5000 | 4 |
| retryBackoffMaxMs | FLAGD_RETRY_BACKOFF_MAX_MS | Integer | 12000 | 4 |
| retryGracePeriod | FLAGD_RETRY_GRACE_PERIOD | Integer | 10 | 4 |
@sync
Examples:
| option | env | type | value | env-value |
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | Integer | 500000 | 400 |
| keepAliveTime | FLAGD_KEEP_ALIVE_TIME_MS | Long | 5 | 4 |
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | Integer | 5000 | 4 |
| retryBackoffMaxMs | FLAGD_RETRY_BACKOFF_MAX_MS | Integer | 12000 | 4 |
| retryGraceAttempts | FLAGD_RETRY_GRACE_ATTEMPTS | Integer | 10 | 4 |
| selector | FLAGD_SOURCE_SELECTOR | String | selector | sele |
| option | env | type | value | env-value |
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | Integer | 500000 | 400 |
| keepAliveTime | FLAGD_KEEP_ALIVE_TIME_MS | Long | 5 | 4 |
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | Integer | 5000 | 4 |
| retryBackoffMaxMs | FLAGD_RETRY_BACKOFF_MAX_MS | Integer | 12000 | 4 |
| retryGracePeriod | FLAGD_RETRY_GRACE_PERIOD | Integer | 10 | 4 |
| selector | FLAGD_SOURCE_SELECTOR | String | selector | sele |
@caching
Examples:
| option | env | type | value | env-value |
Expand Down
8 changes: 3 additions & 5 deletions gherkin/events.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
Feature: Flagd Provider State Changes

Background:
Given a unstable flagd provider
Given a stable flagd provider

Scenario Outline: Provider events
Given a <event> event handler
When the connection is lost for 6s
Then the <event> event handler should have been executed
Examples:
| event |
Expand All @@ -17,11 +18,8 @@ Feature: Flagd Provider State Changes
Given a ready event handler
And a error event handler
And a stale event handler
When a ready event was fired
Then the ready event handler should have been executed
When a stale event was fired
When the connection is lost for 6s
Then the stale event handler should have been executed
When a error event was fired
Then the error event handler should have been executed
When a ready event was fired
Then the ready event handler should have been executed
5 changes: 3 additions & 2 deletions gherkin/flagd-reconnect.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ Feature: flagd provider disconnect and reconnect functionality

# This test suite tests the reconnection functionality of flagd providers
Scenario: Provider reconnection
Given a unstable flagd provider
Given a stable flagd provider
And a ready event handler
And a error event handler
When a ready event was fired
Then the ready event handler should have been executed
When a error event was fired
When the connection is lost for 6s
Then the error event handler should have been executed
Then the ready event handler should have been executed

Scenario: Provider unavailable
Given an option "deadlineMs" of type "Integer" with value "1000"
Expand Down
9 changes: 4 additions & 5 deletions gherkin/flagd-rpc-caching.feature
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,19 @@ Feature: Flag evaluation with Caching
Then the reason should be "CACHED"

Scenario: Stale and Error stage
Given an option "cache" of type "CacheType" with value "lru"
And a unstable flagd provider
And a ready event handler
Given a ready event handler
And a stale event handler
And a error event handler
And a String-flag with key "changing-flag" and a default value "false"
When the flag was evaluated with details
Then the reason should be "STATIC"
When the flag was evaluated with details
Then the reason should be "CACHED"
When a stale event was fired
When the connection is lost for 6s
And a stale event was fired
And the flag was evaluated with details
Then the reason should be "CACHED"
When a error event was fired
And a ready event was fired
And the flag was evaluated with details
Then the reason should be "STATIC""
Then the reason should be "STATIC"
1 change: 0 additions & 1 deletion gherkin/flagd.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@rpc @in-process @evaluation
Feature: flagd providers

# This test suite contains scenarios to test flagd providers.
Expand Down

0 comments on commit 796c0e8

Please sign in to comment.