Repository navigation
test: run the specification fixtures through the provider - #21
Merged
Merged
Conversation
Add the openfeature-provider-specification fixtures as a submodule at specification/ and run every case through the real provider and the OpenFeature SDK, against the fake feature flags server, inside the normal pytest run. The run fails if no fixtures are found. CI checks out submodules, the sdist explicitly excludes specification/, and CONTRIBUTING.md covers cloning with submodules and updating them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Where a fixture expects an error but states no reason, the runner now asserts the reason is ERROR, as the SDK passes a returned error through unchanged. A malformed fixture file or case now fails collection with an error naming the file and case, not a bare KeyError. Move reset_the_sdk into conftest.py so the provider and fixture tests share one copy, and stop the runner's evaluate step shadowing the test's case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lourens-octopus
force-pushed
the
lourens/bmbb-1548/spec-tests
branch
from
November 25, 2026 01:45
8f667e8 to
a271217
Compare
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.
Resolves BMBB-1548.
What
Runs every case in the shared openfeature-provider-specification fixtures through the real provider and the OpenFeature SDK, inside the normal
pytestrun. All 71 cases pass. No evaluator or provider changes were needed.specification/, pinned to the spec repo's head (0f49852).tests/specification_fixtures.pyloads every case fromspecification/Fixtures/*.jsonand names each<fixture file> - <case description>. It raises during collection if no fixtures are found, so a missing submodule fails the whole run.targetingKeybecomes the SDK's targeting key, and anullattribute is passed as present with aNonevalue.run_fixture_case(case, evaluate)takes the evaluate step as a parameter, as ts'srunSpecificationFixtures(evaluate)does. It asserts the value and the error code, and the reason only where the fixture states one.tests/test_specification_fixtures.pyserves each fixture'sresponsefrom the fake feature flags server added in feat: fetch manifest on init and evaluate value #20 (with aContentHashheader), registers the provider withset_provider_and_wait, evaluates through an SDK client and shuts the SDK down afterwards. That covers the HTTP decode, the SDK's context merge and error handling, and the provider's boolean wiring.test-pythonjob checks out submodules.specification/out of the sdist and the wheel.source-excludemakes that explicit.--recurse-submodules, updating the submodule, and fixing failures in the evaluator or provider rather than the runner.Testing
uv run pytest,ruff check,ruff format --check,mypyanduv lock --checkpass.specification/.🤖 Generated with Claude Code