Repository navigation
Commit 22187e0
committed
test(flagd): declare @large-integers and withdraw @numeric-coercion
Follow the conformance assets at spec@15fe8611, which the base now pins:
@numeric-coercion requires lossless coercion in both directions, and the
new @large-integers tag asks for 2^53 - 1.
Neither resolver satisfies all three @numeric-coercion scenarios, so
neither declares it:
- RPC passes back whatever flagd answers, and flagd v0.16.0 -- the image
flagd-testbed v3.8.0 builds on -- resolves an integer request as a
float64 and casts it with a bare int64(val), so float-flag's 0.5 is
narrowed to 0 with no error code. The earlier claim in this file that
flagd answers INVALID_ARGUMENT was not borne out by the server source.
open-feature/flagd#1996 implements the lossless rule.
- In-process admits only int for an integer request (flagd_core.py:25),
so integral-float-flag's 10.0 is a TYPE_MISMATCH where 10 is required.
The other direction is widened (flagd_core.py:113-114), which is why
the lossy scenario alone was passing before.
Both declare @large-integers: RPC carries the value as an int64 that the
provider hands over as a Python int, and in-process parses the ruleset
with json.loads, so nothing narrows 9007199254740991.
Record in the conftest that flagd-testbed v3.8.0 does not seed the six
flags the assets added, so the untagged falsy and precision scenarios,
and the @large-integers one, fail FLAG_NOT_FOUND until the testbed is
updated. Left as failures rather than xfails: the backend is behind, not
the provider.
Signed-off-by: Simon Schrottner <simon.schrottner@flagsmith.com>1 parent a09a6f2 commit 22187e0
3 files changed
Lines changed: 70 additions & 12 deletions
File tree
- providers/openfeature-provider-flagd/tests/tck
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
15 | 34 | | |
16 | 35 | | |
17 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
62 | 76 | | |
63 | 77 | | |
64 | 78 | | |
| |||
70 | 84 | | |
71 | 85 | | |
72 | 86 | | |
73 | | - | |
| 87 | + | |
74 | 88 | | |
75 | 89 | | |
76 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
63 | 88 | | |
64 | 89 | | |
65 | 90 | | |
| |||
71 | 96 | | |
72 | 97 | | |
73 | 98 | | |
74 | | - | |
| 99 | + | |
75 | 100 | | |
76 | 101 | | |
77 | 102 | | |
| |||
0 commit comments