Repository navigation
Commit 3e50e8f
committed
test(ofrep): claim the standard resolution reasons
spec@c342461a moved every resolution-reason assertion into a new gated
gherkin/reason.feature, so the reasons are now a claim a provider declares
rather than a house rule every adopter is held to. Declare @standard-reasons.
Eight of the file's nine scenarios run here and all eight pass: the four
rule-less rows as STATIC, an unknown flag and a type mismatch as ERROR beside
their error codes, and -- because @targeting is declared -- TARGETING_MATCH for
the matched rule and DEFAULT for the miss. The ninth composes with
@disabled-flags, which stays withheld, so it is skipped with that reason.
The obstacle expected here is not the one that exists, and it was measured
rather than reasoned about. ofrep/__init__.py:159 indexes `Reason[data["reason"]]`
by name, so a reason outside the SDK's enum raises KeyError -- which made this
capability look like the risky one. It is not: every reason reason.feature
asserts is an enum member, DISABLED included. Declaring @disabled-flags beside
this one and running the ninth scenario shows that index surviving the DISABLED
reason and the next keyword argument failing instead -- `variant=data["variant"]`
on line 160, KeyError: 'variant', reported to the application as GENERAL. That is
the same one-line defect the @disabled-flags note already records, and it is
unrelated to the reason vocabulary.
The tally moves from 2 failed, 37 passed, 16 skipped, 1 xfailed to 2 failed, 45
passed, 17 skipped, 1 xfailed. The two failures are unchanged -- large-integer-flag
is still not seeded by flagd-testbed v3.8.0. Collection moves from 56 to 65.
Signed-off-by: Simon Schrottner <simon.schrottner@flagsmith.com>1 parent 70b4f50 commit 3e50e8f
2 files changed
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
78 | 104 | | |
79 | 105 | | |
80 | 106 | | |
| |||
228 | 254 | | |
229 | 255 | | |
230 | 256 | | |
| 257 | + | |
231 | 258 | | |
232 | 259 | | |
233 | 260 | | |
| |||
0 commit comments