Skip to content

Commit

Permalink
feat: migrate file to own provider type
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
  • Loading branch information
aepfli committed Jan 19, 2025
1 parent 1174329 commit e9b17ab
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 46 deletions.
34 changes: 26 additions & 8 deletions gherkin/config.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Feature: Configuration Test
| contextEnricher | - | sync-metadata to evaluation context mapping function | function | identity function | in-process |
"""

@rpc @in-process
@rpc @in-process @file
Scenario Outline: Default Config
When a config was initialized
Then the option "<option>" of type "<type>" should have the value "<default>"
Expand Down Expand Up @@ -69,7 +69,7 @@ Feature: Configuration Test
| option | type | default |
| cache | CacheType | lru |
| maxCacheSize | Integer | 1000 |
@offline
@file
Scenarios: offline
| option | type | default |
| offlineFlagSourcePath | String | null |
Expand All @@ -93,7 +93,25 @@ Feature: Configuration Test
| option | type | default |
| port | Integer | 8015 |

@rpc @in-process
@file
Scenario Outline: File Backwards compatibility
Given an option "resolver" of type "ResolverType" with value "<resolverSet>"
And an option "offlineFlagSourcePath" of type "String" with value "some-path"
When a config was initialized
Then the option "resolver" of type "ResolverType" should have the value "<resolverExpected>"
Scenarios:
| resolverSet | resolverExpected |
| in-process | file |
| rpc | rpc |
| file | file |

@file
Scenario: Default Config File
Given an option "resolver" of type "ResolverType" with value "file"
When a config was initialized
Then we should have an error

@rpc @in-process @file
Scenario Outline: Dedicated Config
Given an option "<option>" of type "<type>" with value "<value>"
When a config was initialized
Expand Down Expand Up @@ -139,13 +157,13 @@ Feature: Configuration Test
| option | type | value |
| cache | CacheType | disabled |
| maxCacheSize | Integer | 1236 |
@offline
@file
Scenarios: offline
| option | type | value |
| offlineFlagSourcePath | String | path |
| offlinePollIntervalMs | Integer | 1000 |

@rpc @in-process
@rpc @in-process @file
Scenario Outline: Dedicated Config via Env_var
Given an environment variable "<env>" with value "<value>"
When a config was initialized
Expand Down Expand Up @@ -194,13 +212,13 @@ Feature: Configuration Test
| option | env | type | value |
| cache | FLAGD_CACHE | CacheType | disabled |
| maxCacheSize | FLAGD_MAX_CACHE_SIZE | Integer | 1236 |
@offline
@file
Scenarios: Offline
| option | env | type | value |
| offlineFlagSourcePath | FLAGD_OFFLINE_FLAG_SOURCE_PATH | String | path |
| offlinePollIntervalMs | FLAGD_OFFLINE_POLL_MS | Integer | 1000 |

@rpc @in-process
@rpc @in-process @file
Scenario Outline: Dedicated Config via Env_var and set
Given an environment variable "<env>" with value "<env-value>"
And an option "<option>" of type "<type>" with value "<value>"
Expand Down Expand Up @@ -247,7 +265,7 @@ Feature: Configuration Test
| option | env | type | value | env-value |
| cache | FLAGD_CACHE | CacheType | disabled | lru |
| maxCacheSize | FLAGD_MAX_CACHE_SIZE | Integer | 1236 | 2345 |
@offline
@file
Scenarios: Offline
| option | env | type | value | env-value |
| offlineFlagSourcePath | FLAGD_OFFLINE_FLAG_SOURCE_PATH | String | path | lll |
Expand Down
1 change: 1 addition & 0 deletions gherkin/connection.feature
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Feature: flagd provider disconnect and reconnect functionality
# | name |
# | socket |

@unavailable
Scenario: Provider unavailable
Given an option "deadlineMs" of type "Integer" with value "1000"
And a unavailable flagd provider
Expand Down
2 changes: 1 addition & 1 deletion gherkin/evaluation.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@rpc @in-process
@rpc @in-process @file
Feature: flagd evaluations

# This test suite contains scenarios to test flagd providers.
Expand Down
2 changes: 1 addition & 1 deletion gherkin/events.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@rpc @in-process
@rpc @in-process @events
Feature: Flagd Provider State Changes

Background:
Expand Down
28 changes: 0 additions & 28 deletions gherkin/offline.feature

This file was deleted.

12 changes: 6 additions & 6 deletions gherkin/rpc-caching.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ Feature: Flag evaluation with Caching
And the reason should be "CACHED"

Examples:
| key | type | default | resolved_variant | resolved_value |
| boolean-flag | Boolean | false | on | true |
| string-flag | String | bye | greeting | hi |
| integer-flag | Integer | 1 | ten | 10 |
| float-flag | Float | 0.1 | half | 0.5 |
| object-flag | Object | {} | template | {"showImages": true, "title": "Check out these pics!", "imagesPerPage": 100 } |
| key | type | default | resolved_variant | resolved_value |
| boolean-flag | Boolean | false | on | true |
| string-flag | String | bye | greeting | hi |
| integer-flag | Integer | 1 | ten | 10 |
| float-flag | Float | 0.1 | half | 0.5 |
| object-flag | Object | {} | template | {"showImages": true, "title": "Check out these pics!", "imagesPerPage": 100 } |

Scenario: Flag change event with caching
Given a String-flag with key "changing-flag" and a default value "false"
Expand Down
4 changes: 2 additions & 2 deletions gherkin/targeting.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@rpc @in-process @targeting
@rpc @in-process @file @targeting
Feature: Targeting rules

# This test suite contains scenarios to test the json-evaluation of flagd and flag-in-process providers.
Expand Down Expand Up @@ -138,7 +138,7 @@ Feature: Targeting rules
When the flag was evaluated with details
Then the resolved details value should be "<value>"
Examples:
| key | value |
| key | value |
| targeting-null-variant-flag | 2 |
| error-targeting-flag | 3 |
| missing-variant-targeting-flag | 3 |
Expand Down

0 comments on commit e9b17ab

Please sign in to comment.