Commit 5720a9a
committed
feat(tck): refuse a capability this SDK cannot express, rather than leaving it to adopters
Re-pin the spec submodule to 89b1519a, which adds a fifth rule for declaring to
Appendix F -- a capability the language's SDK cannot express is refused by the
implementation, not left to adopters -- and corrects the canonical flag set's
comments, which still told every reader that every scenario expects reason
STATIC. Neither feature file changes.
Two such capabilities exist anywhere: @large-integers where the integer accessor
is a 32-bit Integer, and @numeric-coercion where the language has one numeric
type and "a float requested as an integer" does not name two different requests.
Neither says anything about a provider. Leaving it to adopters means every
adopter in the language has to know a fact about their language and remember to
act on it, and in one implementation three separate suites each left the same
capability undeclared with its own comment restating the same property -- three
places to get right, and a single wrong one puts a claim in a report that no
scenario could have verified.
So INEXPRESSIBLE_CAPABILITIES maps such a capability to the property of the SDK
that puts the question out of reach, TckConfig refuses one at construction, the
capability gate skips its scenarios with that reason, and a knownDeviations entry
may not name one -- the gap would be the language's and the entry would attribute
it to this provider. A mapping rather than a set because the message has to name
the property: an adopter who reaches this has done nothing wrong and "the
specification says you may not" is not something they can act on.
The two refusals stay distinguishable, in separate predicates with separate
messages and separate skip reasons. A reservation is global and temporary -- no
scenario anywhere carries the tag, and it expires the moment the specification
writes one. An inexpressibility is one language's and permanent: the scenarios
exist and other languages run and pass them. A reader seeing a capability absent
from a report has to be able to tell "this provider declined" from "no provider
in this language can be asked", because only the first says anything about the
provider. Where a scenario is gated by both kinds, the language-wide reason wins,
because the provider's declaration could not have made that scenario run either
way.
**The mapping is empty in Python, and that was measured rather than assumed.**
`int` is arbitrary-precision; FlagType.INTEGER and FlagType.FLOAT are separate,
reach separate provider methods and are type-checked against `int` and `float`
separately. All four questions the two tags ask were put through the SDK's own
client against a provider implementing the borrowed coercion rule: 2^53 - 1
resolved exactly, 0.5 as an Integer gave TYPE_MISMATCH and the caller's default,
10.0 as an Integer gave 10 and 10 as a Float gave 10.0.
The adoptions agree from the other direction, and this was measured too rather
than reasoned from the source: declaring @numeric-coercion in both flagd suites
and running it, the in-process resolver refuses 0.5 as an integer and widens 10
to a float, while the RPC resolver widens 10 and silently narrows 0.5 to 0. Two
resolvers of one provider giving different answers to the same three questions is
exactly what a language that could not ask them makes impossible. Both are
defects in an implementation, withholding the tag is the honest report for each,
and neither is anything the language prevents. The third scenario fails on both
for a third reason again -- flagd-testbed seeds no integral-float-flag -- which
is also why the run leaves both suites' declarations exactly as they were.
So nothing here is in force, and the machinery is added anyway. The rule belongs
to Appendix F rather than to this package, a future capability may hit it, and
the costs are not symmetric: an unused mechanism is a few lines nobody reads,
while a missing one is discovered by an adopter publishing a claim no scenario
could have examined. It is exercised rather than left dead -- the tests supply
an entry and drive the refusal, the deviation refusal, both skip reasons and the
precedence between them, so a mechanism with no instances is still known to work.
DECLARABLE_CAPABILITIES is derived from both sets rather than listing what it
excludes, which matters precisely because the new one is empty here: a derivation
that quietly dropped it would look right in Python forever and be wrong in the one
language where an entry gets added.
Self-tests move from 214 passed / 42 skipped to 221 passed / 42 skipped.
Signed-off-by: Simon Schrottner <simon.schrottner@flagsmith.com>1 parent 8221e4a commit 5720a9a
7 files changed
Lines changed: 593 additions & 114 deletions
File tree
- tools/openfeature-tck
- src/openfeature/contrib/tools/tck
- tests
Large diffs are not rendered by default.
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
| |||
125 | 130 | | |
126 | 131 | | |
127 | 132 | | |
| 133 | + | |
128 | 134 | | |
129 | 135 | | |
130 | 136 | | |
| |||
Lines changed: 94 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
| |||
199 | 207 | | |
200 | 208 | | |
201 | 209 | | |
202 | | - | |
203 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
204 | 217 | | |
205 | 218 | | |
206 | 219 | | |
| |||
214 | 227 | | |
215 | 228 | | |
216 | 229 | | |
217 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
218 | 234 | | |
219 | 235 | | |
220 | 236 | | |
| |||
394 | 410 | | |
395 | 411 | | |
396 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
397 | 432 | | |
398 | 433 | | |
399 | 434 | | |
| |||
418 | 453 | | |
419 | 454 | | |
420 | 455 | | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
421 | 502 | | |
422 | | - | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
423 | 506 | | |
424 | | - | |
| 507 | + | |
425 | 508 | | |
426 | 509 | | |
427 | 510 | | |
| |||
434 | 517 | | |
435 | 518 | | |
436 | 519 | | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
437 | 526 | | |
438 | 527 | | |
439 | 528 | | |
| |||
Lines changed: 68 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
| |||
214 | 218 | | |
215 | 219 | | |
216 | 220 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
222 | 229 | | |
223 | 230 | | |
224 | 231 | | |
| |||
283 | 290 | | |
284 | 291 | | |
285 | 292 | | |
| 293 | + | |
286 | 294 | | |
287 | 295 | | |
288 | 296 | | |
| |||
353 | 361 | | |
354 | 362 | | |
355 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
356 | 409 | | |
357 | 410 | | |
358 | 411 | | |
| |||
398 | 451 | | |
399 | 452 | | |
400 | 453 | | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
401 | 463 | | |
402 | 464 | | |
403 | 465 | | |
| |||
Lines changed: 65 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
215 | 226 | | |
216 | 227 | | |
217 | 228 | | |
| |||
226 | 237 | | |
227 | 238 | | |
228 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
229 | 251 | | |
230 | 252 | | |
231 | 253 | | |
| |||
235 | 257 | | |
236 | 258 | | |
237 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
238 | 264 | | |
239 | 265 | | |
240 | 266 | | |
241 | 267 | | |
242 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
243 | 306 | | |
244 | 307 | | |
245 | | - | |
| 308 | + | |
246 | 309 | | |
247 | 310 | | |
248 | 311 | | |
| 312 | + | |
249 | 313 | | |
250 | 314 | | |
251 | 315 | | |
| |||
0 commit comments