Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
CodeRabbit Verify
|
aepfli
force-pushed
the
feat/provider-tck-report
branch
from
September 11, 2026 07:51
4a0f396 to
7ec7e43
Compare
aepfli
force-pushed
the
feat/provider-tck-report
branch
4 times, most recently
from
September 11, 2026 14:37
720c2cd to
7e344b8
Compare
aepfli
force-pushed
the
feat/provider-tck-report
branch
3 times, most recently
from
September 11, 2026 16:47
1a4817f to
9af7cce
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feat/provider-tck #413 +/- ##
=====================================================
- Coverage 90.68% 87.75% -2.94%
=====================================================
Files 47 51 +4
Lines 2599 3258 +659
=====================================================
+ Hits 2357 2859 +502
- Misses 242 399 +157 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aepfli
force-pushed
the
feat/provider-tck-report
branch
10 times, most recently
from
September 13, 2026 14:06
161f4b2 to
e2e48b3
Compare
aepfli
force-pushed
the
feat/provider-tck
branch
from
September 13, 2026 14:11
5720a9a to
691c68b
Compare
aepfli
force-pushed
the
feat/provider-tck-report
branch
4 times, most recently
from
September 13, 2026 20:01
f6736dc to
47f9cad
Compare
aepfli
force-pushed
the
feat/provider-tck-report
branch
5 times, most recently
from
September 16, 2026 19:34
79aba62 to
a892325
Compare
aepfli
force-pushed
the
feat/provider-tck-report
branch
2 times, most recently
from
October 2, 2026 08:57
0568416 to
f6ccb9b
Compare
aepfli
force-pushed
the
feat/provider-tck-report
branch
from
October 8, 2026 08:19
f6ccb9b to
2f9072d
Compare
aepfli
force-pushed
the
feat/provider-tck
branch
from
October 9, 2026 07:38
9e145fc to
ea11693
Compare
aepfli
force-pushed
the
feat/provider-tck-report
branch
from
October 9, 2026 07:38
2f9072d to
21491e6
Compare
aepfli
force-pushed
the
feat/provider-tck
branch
from
October 14, 2026 13:23
ea11693 to
165204e
Compare
aepfli
force-pushed
the
feat/provider-tck-report
branch
2 times, most recently
from
October 14, 2026 14:32
09d040e to
b37866f
Compare
aepfli
force-pushed
the
feat/provider-tck
branch
from
October 16, 2026 15:41
a1e88da to
06cb43f
Compare
aepfli
force-pushed
the
feat/provider-tck-report
branch
2 times, most recently
from
October 16, 2026 16:03
b0f1fa7 to
1db1c18
Compare
aepfli
force-pushed
the
feat/provider-tck-report
branch
3 times, most recently
from
November 3, 2026 07:25
bab9c8e to
d834533
Compare
aepfli
force-pushed
the
feat/provider-tck
branch
from
November 3, 2026 07:38
7ee71c3 to
32866a5
Compare
aepfli
force-pushed
the
feat/provider-tck-report
branch
from
November 3, 2026 07:40
d834533 to
c6b2be4
Compare
Collapsed from 22 commits when this branch was replayed onto the base's controlApi -> backend_type rename and its adopter tag gate, following the js-sdk-contrib replay of the same branch. Several of the commits fought the rename itself, so one squashed replay meant one conflict pass, and this repository squash-merges anyway. The report follows the rename: it writes backend.backendType through backend_type_of(), so a control that states none is reported as "custom", matching the schema change in spec#425. The report-binding fixture now runs ahead of the base's combined scenario gate, so a scenario skipped by any of the gates still reaches its suite. The original subjects, oldest first: - feat(tck): emit a machine-readable conformance report - feat(tck): identify a Scenario Outline row by its parameters - fix(tck): give a failed capability a reason, and stop claiming untested ones - fix(tck): read the tags of the Examples block a row came from - refactor(tck): carry results in Cucumber Messages - feat(tck): record which Cucumber Messages release produced the stream - fix(tck): say when a control does not report how it drives the backend - refactor(tck): rename @strict-numeric-typing to @numeric-coercion - fix(tck): a reserved capability must not be declarable - feat(tck): report an extension under its own uri prefix - feat(tck): refuse a report that did not run the canonical set - fix(tck): read the canonical count from the assets, not from a test - fix(tck): follow the canonical gherkin/ prefix through the report - fix(tck): stop reporting declaration.notApplicable - docs(tck): refresh the report numbers for 56 scenarios - fix(tck): follow the base's rename and the removal of features_path() - feat(tck)!: controlApi is always written, and the guessing goes away - refactor(tck)!: the environment variables drop their PROVIDER_ prefix - docs(tck): separate "answers the question" from "satisfies the capability" - docs(tck): restate the report documentation on the rewritten README - fix(tck): the mismatch matrix is eight rows, not eleven - docs(tck): follow the base branch's run numbers Signed-off-by: Simon Schrottner <simon.schrottner@flagsmith.com>
aepfli
force-pushed
the
feat/provider-tck-report
branch
from
November 3, 2026 08:19
c6b2be4 to
20ae514
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #409 — base is
feat/provider-tck, so the diff here is only the report emitter. Part of open-feature/spec#424; the schema is open-feature/spec#425.This PR was reworked after review. It originally defined a per-scenario result format in the report schema. It no longer does: the results are carried in Cucumber Messages, the ndjson protocol, and the schema is an envelope that references them. The rest of this description describes what that means and what was deleted.
Setting
TCK_REPORT_DIRmakes each suite write two files: an envelope at<dir>/<name>.jsonand the results it points at at<dir>/<name>.ndjson.The envelope:
{ "schemaVersion": "1", "provider": { "name": "In-Memory Provider", "language": "python", "configuration": "in-memory" }, "sdk": { "name": "openfeature-sdk", "version": "0.10.0" }, "tck": { "implementation": "python-sdk-contrib/tools/openfeature-tck", "version": "0.1.0", "specRevision": "8374621763f04a3d0785a911f12035db4794179e" }, "declaration": { "declared": ["@events", "@numeric-coercion", "@object"] }, "results": { "format": "cucumber-messages", "formatVersion": "34.2.0", "location": "in-memory.ndjson", "digest": "sha256:bfa19f6f07aaac33effac4ad898e6fe05a875c22932428c502c0a0fcb20b342a" }, "backend": { "description": "the Python SDK's InMemoryProvider, rebuilt per scenario", "controlApi": "in-process" }, "knownDeviations": [ { "issue": "https://github.com/open-feature/python-sdk/issues/619", "summary": "python-sdk: a boolean satisfies an Integer request. …" } ] }Two capability changes came with the submodule bump
The spec submodule moves from
dfa16586todc4d7ae8, which renames a tag and states a rule the enum was only documenting. Both land here as separate commits.@strict-numeric-typingis now@numeric-coercion, and the rule is correctedThe rule is lossless coercion is permitted; lossy coercion must fail with
TYPE_MISMATCH—10.0requested as an integer succeeds,0.5does not. Appendix F previously said "does not coerce between integer and float", which forbids the case flagd's accepted numeric coercion ADR (open-feature/flagd#1996) requires to work. flagd's own testbed is gaining@numeric-coercionscenarios, so the tag takes flagd's name rather than leaving the reference implementation and the specification with two vocabularies for one property.So
Capability.STRICT_NUMERIC_TYPINGbecomesCapability.NUMERIC_COERCION, the marker and tag becomenumeric-coercionand@numeric-coercion, and the docstring states the rule that holds rather than the one the tag was named for. The pytest marker registration needed no change — it iterates the enum. The existing scenario is unchanged and still passes: it asks about0.5, which is the lossy half.Two gaps were open when this was written; one has since closed. The lossless half now does have scenarios: the canonical flag set gained
integral-float-flag, anderrors.featurecarries three@numeric-coercionscenarios — the lossy one,10.0as an integer, and10as a float — which a declarer must satisfy all three of. That is what stops the shortcut of rejecting every float and calling it strictness, and two of the four OFREP adoptions were taking it. Accessor width, the other gap recorded then, turns out to be modelled after all: Appendix F draws the ADR's 32-bit/64-bit boundary from the other side, making the 2^31 − 1 precision scenario untagged and mandatory because every accessor can ask for it, and gating the 2^53 − 1 one behind@large-integersbecause only some can — mandatory-versus-gated rather than flagd's@int32-boundedtag. What is still open is the negative half: nothing asserts what a provider owes a value that does not fit the requested accessor, and that is spec#430 rather than an oversight here.A reserved capability can no longer be declared
@cachingis reserved: it exists in the vocabulary and no scenario carries it.@targetingwas in the same position when this was written and stopped being so at spec26362f85, once scenarios started carrying it — which is the shape a reserved tag is meant to have: a placeholder that either grows scenarios or is removed, never a claim a report can carry indefinitely. The enum said so in a docstring and left it there, which reads as documentation rather than as the rule it is. The report schema now states it — see thedeclaration.declareddescription — because a capability nothing carries cannot be verified, cannot produce a skip, and tells a reader of a report only that something was claimed and nothing examined.This was a live defect rather than a hypothetical one: a real Java report asserts both tags as declared, not because anyone decided to claim them but because that adoption declares "every capability except X" and picks up every reserved tag on the way past.
RESERVED_CAPABILITIES, and read everywhere else — byCapability.reserved, by the declare-everything helper and byTckConfig's validation — so the list cannot drift from the rule.ALL_CAPABILITIESbecomesDECLARABLE_CAPABILITIES: the vocabulary minus the reserved tags, named for what it is rather than for "all", because the declare-everything convenience is precisely the route a reserved tag takes into a report by accident. It is alsoTckConfig.capabilities' default, so a suite that does not narrow its capabilities no longer declares a tag nothing tests.TckConfig, incapabilitiesor innot_applicable.TckConfigalready refuses a capability claimed as both declared and not-applicable; this is the same class of error — a claim that cannot be true — caught in the same place, where the adopter's own code is still on the stack. A silent drop would make a rejected configuration look like an accepted one, and a warning is a line of CI output nobody reads while an untested capability goes on being asserted in a published report, which is how it got into one.report.pysays why: by the time an envelope is built, a reserved tag cannot be in theTckConfigat all.Why the results are not our format
Per-scenario outcomes, tags, Scenario Outline row identity and the executed feature source are all already specified by Cucumber Messages, which is maintained, cross-language, schema'd, and emitted natively by cucumber-jvm. Defining them again in the report schema created a second format to maintain and version, and two places for the same fact to disagree.
What was deleted
scenarios[]. NowTestCase/TestCaseStarted/TestStepStarted/TestStepFinished/TestCaseFinished, keyed by ids the protocol defines.The four-value outcome enum. Cucumber's own seven statuses replace it. The
not-declared/not-applicablesplit it existed for was never a property of the run: it follows from the envelope'sdeclarationand the scenario's tags, both of which are present, so it is stated once instead of once per scenario.declaration.notApplicablekeeps the distinction the enum was drawing, where it belongs — as an input to reading the results rather than a per-scenario fact.example. This is the clearest case. It was added days ago so an outline row could be identified, and four implementations each reinvented it — one of them, this one, by reverse-engineering how its runner maps a pickle back to a table row. Messages has carried that identity all along: a pickle'sastNodeIdsare[scenario id, table row id], and the row id resolves in theGherkinDocumentto exactly the cells the feature file wrote.tck.assetsTree. The stream carries the executed featureSourceverbatim, so a consumer can read the questions that were actually asked rather than trusting a hash to stand for them. That is strictly stronger than what the tree hash was carrying, and it is one fewer thing for the build to get right. The generatedspec_revision.jsonis now just{"specRevision": "…"}.What stays OpenFeature-specific, and why
The declaration is an input, not a summary. A skipped scenario in the payload says the question was not put to this provider; only the declaration says whether that is because the provider declines the capability. It cannot be derived from the results, which is exactly why it has to be stated.
No standard results format identifies the tested subject. Messages'
Metarecords the runtime, the OS and the CPU — what produced the answers, not what was being asked about. Soprovider,sdk,tckandbackendstay in the envelope.knownDeviations. A gap the provider acknowledges is a claim about the provider, not a result. The Python suite marks one scenarioxfail(strict=True)against python-sdk#619; the payload still reports that scenario asFAILED, and the envelope carries the acknowledgement beside it. An adoption declares it withTckConfig.known_deviations. Recording it in the envelope is what lets a consumer tell a tracked gap from a surprise without the result itself being weakened, which is the trade the previous version got wrong by carrying the issue reference as prose inside areason.Dependencies added
pytest-bdd emits no Cucumber Messages. It ships
cucumber_json.py, the legacy Cucumber JSON format, and nothing for the ndjson protocol — somessages.pyassembles the stream. Two libraries, each doing the half it owns:cucumber-messages(34.2.0, new) — the official Python types, published fromcucumber/messagesitself. Zero dependencies,requires-python >=3.9, actively released. Used for the execution messages:Meta,TestCase,TestCaseStarted,TestStepFinished,TestStepResult,TestRunStarted/Finished,Hook.gherkin-official(>=29, promoted from a transitive dependency of pytest-bdd to a direct one) — the reference Gherkin parser. It produces thegherkinDocumentandpicklepayloads, which are Messages: emitting Messages ndjson is what that library exists for, so its output is used as it comes rather than round-tripped through another representation that could quietly drop a field it does not model.uv.lockis regenerated, anduv sync --frozenverified against it. Onlycucumber-messagesis genuinely new to the lock.The feature files are parsed a second time, by this package. pytest-bdd parses them with
gherkin-officialtoo but converts the result into dataclasses of its own that do not carry the AST node ids — and those ids are what a pickle refers to and what makes one outline row distinguishable from another. Four small files, once per session.Truthful skips, and per-step results
Appendix F requires that a scenario skipped for an undeclared capability is reported as skipped with the reason and never as passed. pytest, unlike godog, already reports a skip honestly, and Cucumber's
SKIPPEDsays the same thing, so this is the easy part in Python — but it is checked explicitly rather than assumed.Step results come from pytest-bdd's step hooks (
pytest_bdd_after_step,pytest_bdd_step_error,pytest_bdd_step_func_lookup_error) rather than from the scenario's verdict. Marking all eight steps of a scenarioFAILEDbecause the scenario failed would be saying something untrue about the seven that passed and the ones never reached. The failing row of the type-mismatch matrix comes out as:with the assertion carried as a
TestStepResult.exceptionof typeAssertionError, which is what that field is for.Every test case also carries a before- and after-hook
TestStep, with aHookmessage declaring each. pytest runs a scenario in three phases and only the middle one executes Gherkin steps: the capability gate skips during setup, and a provider that fails to shut down fails during teardown. Neither has a pickle step to attach a result to, so without hooks a gated skip would have to borrow the first step's result and a teardown failure would be invisible behind a row of passed steps. Cucumber models exactly this.That also closes a gap worth naming. A consumer derives a test case's outcome as the worst of its steps. A verdict no step accounts for — a strict
xfailthat passes, which pytest fails while every step passed — would be lost on the way out, so it is attached to the after-hook. There is a unit test for it.Scenarios are enumerated at collection and resolved only at the end of the session, unchanged from before and still load-bearing: a scenario skipped by a marker never runs a fixture, so an emitter that learned of a scenario when its fixtures ran would leave it out of the stream entirely.
TckConfigbriefly gainednot_applicable={Capability.X: "why"}for a capability that cannot hold rather than one the provider declines. It is gone. Appendix F now makes that the implementation's call rather than each adopter's — a capability the language's SDK cannot express is refused at configuration time, uniformly, rather than being declared inapplicable by whoever remembers to — and the schema'sdeclarationobject isadditionalProperties: falseoverdeclaredalone, so there was nowhere for the field to go. Python has no such capability today, which is why the removal cost it nothing.Three schema changes since this was opened
All three are in spec#425 and this branch emits against them.
backend.controlApiis required. A provider with no backend still had its flag state manipulated somehow, and which of the two ways that was is the single most important thing a reader needs in order to know what the results are worth. The old shape made the wholebackendblock omissible, which made the one value most worth knowing —in-process, the case the enum exists for, and the one both of this package's own suites use — the one that could never appear.summaryis required, and its issue link is not. A deviation with no prose is a line of tags that tells a reader nothing; a deviation with no filed issue is an honest state to be in, and requiring one encourages filing a placeholder.@large-integersin Java,@numeric-coercionin JavaScript — which is a property of that language's SDK rather than of the provider, and a reader who conflated the two would read a language's limit as a provider's decision. Python refuses nothing today; the field it used to carry for this,not_applicable, is removed above.Verification
Run on WSL Ubuntu, Python 3.10 (the repo's pinned version), against the schema as it stands on
feat/provider-tck-report-schema. CI does not run on this PR:build.ymltriggers only on pull requests targetingmain, and this one targetsfeat/provider-tck, so everything below is local.Re-run in full after the submodule bump to
aa2ad24f: the test suite,ruff,mypy, envelope validation against the report schema, the digest, the message count, the outcome counts and the gated-skip listing. The Cucumber Messages payload schema validation and theuv buildcheck below were done atdfa16586and were not repeated; the bump changes feature-file text and a scenario name, not the shape of the stream.Package test suite.
96 passed, 9 skipped, 2 xfailed.ruff check,ruff format --checkandmypy(whose scope includestests) are all clean.The renamed tag is what actually ran. Every executed
Sourcecarries@numeric-coercionand none carries@strict-numeric-typing, andtck.specRevisionin both envelopes wasaa2ad24f5a14ae2b5756df0b6d23f493f39507e6when this was measured. The pin has since moved to83746217, the assets branch behind open-feature/spec#423, and the envelope follows it.No reserved capability reaches a declaration. No reserved tag appears in
declaration.declaredin either envelope, andtest_a_reserved_capability_cannot_reach_the_declarationasserts it of the emitted envelope for a config that leavescapabilitiesat its default — the "declare everything" case that put one into a published report elsewhere.test_a_reserved_capability_cannot_be_declaredcovers the explicit route for every member ofRESERVED_CAPABILITIESrather than for a list written down beside it.Envelope validation. Both envelopes validate with
jsonschemaas Draft 2020-12 againstconformance-report.schema.json, zero errors, andresults.digestmatches a SHA-256 recomputed over the ndjson bytes:in-memorycontrollable-in-memoryPayload validation. Both streams validate clean — 661 of 661 messages, zero errors — against the published Cucumber Messages JSON schema at tag
v34.2.0(jsonschema/src/*.schema.jsonfromcucumber/messages, resolved locally through areferencingregistry so the relative$refs work). Message census, identical for both suites:Every scenario accounted for. 29
TestCasemessages against 29 scenarios from pytest's own--collect-only, in both suites, with(uri, scenario name, Examples row)distinct across all 29.test_every_collected_scenario_appears_exactly_oncechecks the total against--collect-onlyrather than a number written down beside it, so adding a scenario to the specification cannot leave it passing while the payload loses one.Outcome counts, computed the way a consumer must — worst step status per test case:
in-memorycontrollable-in-memoryPer step, for
in-memory: 220PASSED, 45SKIPPED, 1FAILED. Of the 45, 42 belong to the five gated scenarios (their before-hooks included, which is where the reason is) and three are the steps of the failing scenario that were never reached.Gated skips are truthful. Every scenario carrying a tag absent from
declaration.declaredisSKIPPED, at every step, in both suites — none is reported as passed. Checked against the reason the gate actually gave, so the derivation from the two documents agrees with reality rather than merely being possible:(The first scenario's name changed with the submodule bump too, from "A provider reaching its backend becomes ready"; nothing in this package referred to it by name.)
And the distinction survives: the scenario the generated test suite skips with a plain marker is also
SKIPPED, but carries no undeclared tag, so it is not attributable to a capability.The payload disagrees with the runner, deliberately. pytest exits zero — the one scenario the SDK fails is
xfailed — and the stream reports itFAILED. That is asserted, not just observed.The eleven rows.
Requesting the wrong type returns the code defaultproduces eleven test cases sharing one scenario name, told apart by the second entry of the pickle'sastNodeIds(the id of theTableRowit was compiled from), which resolves in theGherkinDocumentto the cells the feature file wrote:25is theScenarionode all eleven share, which is right: the scenario is one scenario. The rows the tests recover from the stream this way are compared against the three Examples tables read out of the Gherkin by hand, rather than against the parser that produced them.The same holds for rows the capability gate skipped, since row identity comes from the pickle rather than from the run: with
@objectundeclared, all four rows ofRequesting a structured flag as a scalar returns the code defaultare present,SKIPPED, and individually identified.Tags on an Examples block. Still covered. Gherkin lets an Examples block carry its own tags, so two rows of one outline can differ in which capability gates them, and those tags are on neither the scenario, the feature nor the rule. No canonical feature file does this yet, so the test writes its own: with one row of a three-row outline gated, all three appear, the gated one is
SKIPPEDand carries@object, and its two siblings pass.The executed source is present and correct. Every
Sourcemessage'sdatacompares equal to the feature file on disk, and the set ofSourceuris equals the set of uris the test cases name.Cross-platform.
pathliband list-argvsubprocessthroughout. Feature uris are normalised to forward slashes: pytest-bdd builds its relative filename withos.path.join, so on Windows it arrives backslash-separated, and the same string has to appear in theSource, theGherkinDocumentand everyPickleor nothing ties them together — a report emitted on Windows would otherwise not be comparable with one emitted on Linux. There is a test for it. The emitter itself was developed and verified on Linux; the Windows path of that normalisation is covered by the unit test rather than by a Windows run.Packaging.
uv buildproduces a wheel carryingspec_revision.jsonalongside the four feature files, the canonical flag set andcontrol-api.yaml, and declaring the two new requirements.Failure to write still fails the run loudly, verified by pointing
TCK_REPORT_DIRat a path under a regular file. A run that asked for a report and silently did not get one is how a publishing pipeline ends up serving a stale result forever. A scenario that ran and matches no pickle fails the session the same way and names the scenario, because that is the one failure mode this format exists to rule out.Things worth raising, rather than glossing
The capability rollup is gone entirely, not moved. The previous version summarised a verdict per capability. Both defects raised against it — a failed capability with no reason, and a declared-but-untested capability reported green — disappear with it, but so does the summary. A consumer wanting "did
@objectpass" now computes it from the payload: the scenarios carrying that tag, and their statuses. That is more work for the consumer and one fewer thing to disagree with the results. Whether the schema should offer a derived summary is worth deciding deliberately rather than by inheritance.There is still no overall verdict in the envelope.
TestRunFinished.successin the payload isfalsewhen any scenario failed, which is more than the previous version had, but a consumer must open the payload to see it. Worth deciding whether the envelope wants a top-level verdict.The stream is assembled by this package, not by the runner. If pytest-bdd ever emits Messages natively,
messages.pyshould shrink to a shim. Two places where that assembly makes a judgement a native emitter would not have to: the join from a pytest node to a pickle goes through(uri, scenario name, Examples row), because pytest-bdd's parse and this one are separate; and test-case/step ids are synthesised (test-case-7-3) rather than being ids the runner already owns. Both are internally consistent and neither is observable across runs, but they are not the ids cucumber-js would emit.Meta.protocolVersionis read from the installedcucumber-messagesversion, not pinned in code, so it cannot go stale after a dependency bump. It reports the library version rather than a protocol version negotiated with anything.Not done here: CI does not upload the reports as artifacts. That belongs with whatever consumes them, and can follow.