-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathrpc-caching.feature
More file actions
60 lines (55 loc) · 2.87 KB
/
rpc-caching.feature
File metadata and controls
60 lines (55 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
@rpc @caching
Feature: Flag evaluation with Caching
# This test suite contains scenarios to test the flag evaluation API with caching (RPC only)
Background:
Given an option "cache" of type "CacheType" with value "lru"
And a stable flagd provider
Scenario Outline: Resolves <type> details with caching
Given a <type>-flag with key "<key>" and a default value "<default>"
When the flag was evaluated with details
Then the resolved details value should be "<resolved_value>"
And the variant should be "<resolved_variant>"
And the reason should be "STATIC"
When the flag was evaluated with details
Then the resolved details value should be "<resolved_value>"
And the variant should be "<resolved_variant>"
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.0 } |
Scenario: Flag change event with caching
Given a String-flag with key "changing-flag" and a default value "false"
And a change event handler
When the flag was modified
And a change event was fired
And 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 the flag was modified
And a change event was fired
And 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"
Scenario: Stale and Error stage
Given a ready event handler
And a stale event handler
And a error event handler
And a Boolean-flag with key "boolean-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 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"