Skip to content

Commit b987798

Browse files
authoredDec 6, 2024··
feat: rework config gherkin file (#162)
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
1 parent 7192e8c commit b987798

File tree

1 file changed

+145
-85
lines changed

1 file changed

+145
-85
lines changed
 

‎gherkin/config.feature

+145-85
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,44 @@
11
Feature: Configuration Test
2+
"""markdown
3+
This is the official option configuration table
4+
| Option name | Environment variable name | Explanation | Type & Values | Default | Compatible resolver |
5+
| --------------------- | ------------------------------ | ------------------------------------------------------------------------------- | ---------------------------- | ----------------------------- | ------------------- |
6+
| resolver | FLAGD_RESOLVER | mode of operation | String - `rpc`, `in-process` | rpc | rpc & in-process |
7+
| host | FLAGD_HOST | remote host | String | localhost | rpc & in-process |
8+
| port | FLAGD_PORT | remote port | int | 8013 (rpc), 8015 (in-process) | rpc & in-process |
9+
| targetUri | FLAGD_TARGET_URI | alternative to host/port, supporting custom name resolution | string | null | rpc & in-process |
10+
| tls | FLAGD_TLS | connection encryption | boolean | false | rpc & in-process |
11+
| socketPath | FLAGD_SOCKET_PATH | alternative to host port, unix socket | String | null | rpc & in-process |
12+
| certPath | FLAGD_SERVER_CERT_PATH | tls cert path | String | null | rpc & in-process |
13+
| deadlineMs | FLAGD_DEADLINE_MS | deadline for unary calls, and timeout for initialization | int | 500 | rpc & in-process |
14+
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | deadline for streaming calls, useful as an application-layer keepalive | int | 600000 | rpc & in-process |
15+
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | initial backoff for stream retry | int | 1000 | rpc & in-process |
16+
| retryBackoffMaxMs | FLAGD_RETRY_BACKOFF_MAX_MS | maximum backoff for stream retry | int | 120000 | rpc & in-process |
17+
| retryGraceAttempts | FLAGD_RETRY_GRACE_ATTEMPTS | amount of stream retry attempts before provider moves from STALE to ERROR state | int | 5 | rpc & in-process |
18+
| keepAliveTime | FLAGD_KEEP_ALIVE_TIME_MS | http 2 keepalive | long | 0 | rpc & in-process |
19+
| cache | FLAGD_CACHE | enable cache of static flags | String - `lru`, `disabled` | lru | rpc |
20+
| maxCacheSize | FLAGD_MAX_CACHE_SIZE | max size of static flag cache | int | 1000 | rpc |
21+
| selector | FLAGD_SOURCE_SELECTOR | selects a single sync source to retrieve flags from only that source | string | null | in-process |
22+
| offlineFlagSourcePath | FLAGD_OFFLINE_FLAG_SOURCE_PATH | offline, file-based flag definitions, overrides host/port/targetUri | string | null | in-process |
23+
| offlinePollIntervalMs | FLAGD_OFFLINE_POLL_MS | poll interval for reading offlineFlagSourcePath | int | 5000 | in-process |
24+
| contextEnricher | - | sync-metadata to evaluation context mapping function | function | identity function | in-process |
25+
"""
226

327
@rpc @in-process
428
Scenario Outline: Default Config
5-
When we initialize a config
29+
When a config was initialized
630
Then the option "<option>" of type "<type>" should have the value "<default>"
731
Examples: Basic
8-
| option | type | default |
9-
| resolverType | ResolverType | rpc |
10-
| host | String | localhost |
11-
| port | Integer | 8013 |
12-
| tls | Boolean | false |
13-
| deadline | Integer | 500 |
32+
| option | type | default |
33+
| resolver | ResolverType | rpc |
34+
| host | String | localhost |
35+
| port | Integer | 8013 |
36+
| tls | Boolean | false |
37+
| deadlineMs | Integer | 500 |
38+
@targetURI
39+
Examples: Target URI
40+
| option | type | default |
41+
| targetUri | String | null |
1442
@customCert
1543
Examples: Certificates
1644
| option | type | default |
@@ -21,54 +49,63 @@ Feature: Configuration Test
2149
| socketPath | String | null |
2250
@events
2351
Examples: Events
24-
| option | type | default |
25-
| streamDeadlineMs | Integer | 600000 |
26-
| keepAlive | Long | 0 |
27-
| retryBackoffMs | Integer | 1000 |
52+
| option | type | default |
53+
| streamDeadlineMs | Integer | 600000 |
54+
| keepAliveTime | Long | 0 |
55+
| retryBackoffMs | Integer | 1000 |
56+
| retryBackoffMaxMs | Integer | 120000 |
57+
| retryGraceAttempts | Integer | 5 |
2858
@sync
2959
Examples: Sync
30-
| option | type | default |
31-
| streamDeadlineMs | Integer | 600000 |
32-
| keepAlive | Long | 0 |
33-
| retryBackoffMs | Integer | 1000 |
34-
| selector | String | null |
60+
| option | type | default |
61+
| streamDeadlineMs | Integer | 600000 |
62+
| keepAliveTime | Long | 0 |
63+
| retryBackoffMs | Integer | 1000 |
64+
| retryBackoffMaxMs | Integer | 120000 |
65+
| retryGraceAttempts | Integer | 5 |
66+
| selector | String | null |
3567
@caching
3668
Examples: caching
3769
| option | type | default |
38-
| cacheType | CacheType | lru |
70+
| cache | CacheType | lru |
3971
| maxCacheSize | Integer | 1000 |
4072
@offline
4173
Examples: offline
42-
| option | type | default |
43-
| offlineFlagSourcePath | String | null |
74+
| option | type | default |
75+
| offlineFlagSourcePath | String | null |
76+
| offlinePollIntervalMs | Integer | 5000 |
4477

4578
@rpc
4679
Scenario Outline: Default Config RPC
47-
When we initialize a config for "rpc"
80+
When a config was initialized for "rpc"
4881
Then the option "<option>" of type "<type>" should have the value "<default>"
4982
Examples:
5083
| option | type | default |
5184
| port | Integer | 8013 |
5285

5386
@in-process
5487
Scenario Outline: Default Config In-Process
55-
When we initialize a config for "in-process"
88+
When a config was initialized for "in-process"
5689
Then the option "<option>" of type "<type>" should have the value "<default>"
5790
Examples:
5891
| option | type | default |
5992
| port | Integer | 8015 |
6093

6194
Scenario Outline: Dedicated Config
62-
When we have an option "<option>" of type "<type>" with value "<value>"
63-
And we initialize a config
95+
Given an option "<option>" of type "<type>" with value "<value>"
96+
When a config was initialized
6497
Then the option "<option>" of type "<type>" should have the value "<value>"
6598
Examples:
66-
| option | type | value |
67-
| resolverType | ResolverType | in-process |
68-
| host | String | local |
69-
| tls | Boolean | True |
70-
| port | Integer | 1234 |
71-
| deadline | Integer | 123 |
99+
| option | type | value |
100+
| resolver | ResolverType | in-process |
101+
| host | String | local |
102+
| tls | Boolean | True |
103+
| port | Integer | 1234 |
104+
| deadline | Integer | 123 |
105+
@targetURI
106+
Examples: Target URI
107+
| option | type | value |
108+
| targetUri | String | path |
72109
@customCert
73110
Examples:
74111
| option | type | value |
@@ -79,41 +116,50 @@ Feature: Configuration Test
79116
| socketPath | String | path |
80117
@events
81118
Examples:
82-
| option | type | value |
83-
| streamDeadlineMs | Integer | 500000 |
84-
| keepAlive | Long | 5 |
85-
| retryBackoffMs | Integer | 5000 |
119+
| option | type | value |
120+
| streamDeadlineMs | Integer | 500000 |
121+
| keepAliveTime | Long | 5 |
122+
| retryBackoffMs | Integer | 5000 |
123+
| retryBackoffMaxMs | Integer | 12000 |
124+
| retryGraceAttempts | Integer | 10 |
86125
@sync
87126
Examples:
88-
| option | type | value |
89-
| streamDeadlineMs | Integer | 500000 |
90-
| keepAlive | Long | 5 |
91-
| retryBackoffMs | Integer | 5000 |
92-
| selector | String | selector |
127+
| option | type | value |
128+
| streamDeadlineMs | Integer | 500000 |
129+
| keepAliveTime | Long | 5 |
130+
| retryBackoffMs | Integer | 5000 |
131+
| retryBackoffMaxMs | Integer | 12000 |
132+
| retryGraceAttempts | Integer | 10 |
133+
| selector | String | selector |
93134
@caching
94135
Examples:
95136
| option | type | value |
96-
| cacheType | CacheType | disabled |
137+
| cache | CacheType | disabled |
97138
| maxCacheSize | Integer | 1236 |
98139
@offline
99140
Examples:
100-
| option | type | value |
101-
| offlineFlagSourcePath | String | path |
141+
| option | type | value |
142+
| offlineFlagSourcePath | String | path |
143+
| offlinePollIntervalMs | Integer | 1000 |
102144

103145
Scenario Outline: Dedicated Config via Env_var
104-
When we have an environment variable "<env>" with value "<value>"
105-
And we initialize a config
146+
Given an environment variable "<env>" with value "<value>"
147+
When a config was initialized
106148
Then the option "<option>" of type "<type>" should have the value "<value>"
107149
Examples:
108-
| option | env | type | value |
109-
| resolverType | FLAGD_RESOLVER | ResolverType | in-process |
110-
| resolverType | FLAGD_RESOLVER | ResolverType | IN-PROCESS |
111-
| resolverType | FLAGD_RESOLVER | ResolverType | rpc |
112-
| resolverType | FLAGD_RESOLVER | ResolverType | RPC |
113-
| host | FLAGD_HOST | String | local |
114-
| tls | FLAGD_TLS | Boolean | True |
115-
| port | FLAGD_PORT | Integer | 1234 |
116-
| deadline | FLAGD_DEADLINE_MS | Integer | 123 |
150+
| option | env | type | value |
151+
| resolver | FLAGD_RESOLVER | ResolverType | in-process |
152+
| resolver | FLAGD_RESOLVER | ResolverType | IN-PROCESS |
153+
| resolver | FLAGD_RESOLVER | ResolverType | rpc |
154+
| resolver | FLAGD_RESOLVER | ResolverType | RPC |
155+
| host | FLAGD_HOST | String | local |
156+
| tls | FLAGD_TLS | Boolean | True |
157+
| port | FLAGD_PORT | Integer | 1234 |
158+
| deadline | FLAGD_DEADLINE_MS | Integer | 123 |
159+
@targetURI
160+
Examples: Target URI
161+
| option | env | type | value |
162+
| targetUri | FLAGD_TARGET_URI | String | path |
117163
@customCert
118164
Examples:
119165
| option | env | type | value |
@@ -124,39 +170,48 @@ Feature: Configuration Test
124170
| socketPath | FLAGD_SOCKET_PATH | String | path |
125171
@events
126172
Examples:
127-
| option | env | type | value |
128-
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | Integer | 500000 |
129-
| keepAlive | FLAGD_KEEP_ALIVE_TIME_MS | Long | 5 |
130-
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | Integer | 5000 |
173+
| option | env | type | value |
174+
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | Integer | 500000 |
175+
| keepAliveTime | FLAGD_KEEP_ALIVE_TIME_MS | Long | 5 |
176+
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | Integer | 5000 |
177+
| retryBackoffMaxMs | FLAGD_RETRY_BACKOFF_MAX_MS | Integer | 12000 |
178+
| retryGraceAttempts | FLAGD_RETRY_GRACE_ATTEMPTS | Integer | 10 |
131179
@sync
132180
Examples:
133-
| option | env | type | value |
134-
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | Integer | 500000 |
135-
| keepAlive | FLAGD_KEEP_ALIVE_TIME_MS | Long | 5 |
136-
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | Integer | 5000 |
137-
| selector | FLAGD_SOURCE_SELECTOR | String | selector |
181+
| option | env | type | value |
182+
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | Integer | 500000 |
183+
| keepAliveTime | FLAGD_KEEP_ALIVE_TIME_MS | Long | 5 |
184+
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | Integer | 5000 |
185+
| retryBackoffMaxMs | FLAGD_RETRY_BACKOFF_MAX_MS | Integer | 12000 |
186+
| retryGraceAttempts | FLAGD_RETRY_GRACE_ATTEMPTS | Integer | 10 |
187+
| selector | FLAGD_SOURCE_SELECTOR | String | selector |
138188
@caching
139189
Examples:
140190
| option | env | type | value |
141-
| cacheType | FLAGD_CACHE | CacheType | disabled |
191+
| cache | FLAGD_CACHE | CacheType | disabled |
142192
| maxCacheSize | FLAGD_MAX_CACHE_SIZE | Integer | 1236 |
143193
@offline
144194
Examples:
145-
| option | env | type | value |
146-
| offlineFlagSourcePath | FLAGD_OFFLINE_FLAG_SOURCE_PATH | String | path |
195+
| option | env | type | value |
196+
| offlineFlagSourcePath | FLAGD_OFFLINE_FLAG_SOURCE_PATH | String | path |
197+
| offlinePollIntervalMs | FLAGD_OFFLINE_POLL_MS | Integer | 1000 |
147198

148199
Scenario Outline: Dedicated Config via Env_var and set
149-
When we have an environment variable "<env>" with value "<env-value>"
150-
And we have an option "<option>" of type "<type>" with value "<value>"
151-
And we initialize a config
200+
Given an environment variable "<env>" with value "<env-value>"
201+
And an option "<option>" of type "<type>" with value "<value>"
202+
When a config was initialized
152203
Then the option "<option>" of type "<type>" should have the value "<value>"
153204
Examples:
154-
| option | env | type | value | env-value |
155-
| resolverType | FLAGD_RESOLVER | ResolverType | in-process | rpc |
156-
| host | FLAGD_HOST | String | local | l |
157-
| tls | FLAGD_TLS | Boolean | True | False |
158-
| port | FLAGD_PORT | Integer | 1234 | 3456 |
159-
| deadline | FLAGD_DEADLINE_MS | Integer | 123 | 345 |
205+
| option | env | type | value | env-value |
206+
| resolver | FLAGD_RESOLVER | ResolverType | in-process | rpc |
207+
| host | FLAGD_HOST | String | local | l |
208+
| tls | FLAGD_TLS | Boolean | True | False |
209+
| port | FLAGD_PORT | Integer | 1234 | 3456 |
210+
| deadline | FLAGD_DEADLINE_MS | Integer | 123 | 345 |
211+
@targetURI
212+
Examples: Target URI
213+
| option | env | type | value | env-value |
214+
| targetUri | FLAGD_TARGET_URI | String | path | fun |
160215
@customCert
161216
Examples:
162217
| option | env | type | value | env-value |
@@ -167,23 +222,28 @@ Feature: Configuration Test
167222
| socketPath | FLAGD_SOCKET_PATH | String | path | rpc |
168223
@events
169224
Examples:
170-
| option | env | type | value | env-value |
171-
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | Integer | 500000 | 400 |
172-
| keepAlive | FLAGD_KEEP_ALIVE_TIME_MS | Long | 5 | 4 |
173-
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | Integer | 5000 | 400 |
225+
| option | env | type | value | env-value |
226+
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | Integer | 500000 | 400 |
227+
| keepAliveTime | FLAGD_KEEP_ALIVE_TIME_MS | Long | 5 | 4 |
228+
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | Integer | 5000 | 4 |
229+
| retryBackoffMaxMs | FLAGD_RETRY_BACKOFF_MAX_MS | Integer | 12000 | 4 |
230+
| retryGraceAttempts | FLAGD_RETRY_GRACE_ATTEMPTS | Integer | 10 | 4 |
174231
@sync
175232
Examples:
176-
| option | env | type | value | env-value |
177-
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | Integer | 500000 | 400 |
178-
| keepAlive | FLAGD_KEEP_ALIVE_TIME_MS | Long | 5 | 4 |
179-
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | Integer | 5000 | 400 |
180-
| selector | FLAGD_SOURCE_SELECTOR | String | selector | sele |
233+
| option | env | type | value | env-value |
234+
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | Integer | 500000 | 400 |
235+
| keepAliveTime | FLAGD_KEEP_ALIVE_TIME_MS | Long | 5 | 4 |
236+
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | Integer | 5000 | 4 |
237+
| retryBackoffMaxMs | FLAGD_RETRY_BACKOFF_MAX_MS | Integer | 12000 | 4 |
238+
| retryGraceAttempts | FLAGD_RETRY_GRACE_ATTEMPTS | Integer | 10 | 4 |
239+
| selector | FLAGD_SOURCE_SELECTOR | String | selector | sele |
181240
@caching
182241
Examples:
183242
| option | env | type | value | env-value |
184-
| cacheType | FLAGD_CACHE | CacheType | disabled | lru |
243+
| cache | FLAGD_CACHE | CacheType | disabled | lru |
185244
| maxCacheSize | FLAGD_MAX_CACHE_SIZE | Integer | 1236 | 2345 |
186245
@offline
187246
Examples:
188-
| option | env | type | value | env-value |
189-
| offlineFlagSourcePath | FLAGD_OFFLINE_FLAG_SOURCE_PATH | String | path | lll |
247+
| option | env | type | value | env-value |
248+
| offlineFlagSourcePath | FLAGD_OFFLINE_FLAG_SOURCE_PATH | String | path | lll |
249+
| offlinePollIntervalMs | FLAGD_OFFLINE_POLL_MS | Integer | 1000 | 4 |

0 commit comments

Comments
 (0)
Please sign in to comment.