test(openfeature): add STATIC and SPLIT reason assertions#5506
Draft
leoromanovsky wants to merge 4 commits intomasterfrom
Draft
test(openfeature): add STATIC and SPLIT reason assertions#5506leoromanovsky wants to merge 4 commits intomasterfrom
leoromanovsky wants to merge 4 commits intomasterfrom
Conversation
…on engine spec - Add STATIC reason test context (override path: no rules, 1 split, no shards) - Add SPLIT reason test context (shard-based assignment) - Add MATCH reason assertion to existing resolution details context - All existing ERROR reason tests unchanged
|
👋 Hey @DataDog/ruby-guild, please fill "Change log entry" section in the pull request description. If changes need to be present in CHANGELOG.md you can state it this way **Change log entry**
Yes. A brief summary to be placed into the CHANGELOG.md(possible answers Yes/Yep/Yeah) Or you can opt out like that **Change log entry**
None.(possible answers No/Nope/None) Visited at: 2026-03-26 01:40:24 UTC |
|
✨ Fix all issues with BitsAI or with Cursor
|
- Copy ufc-config.json and 24 evaluation-case JSON files - Files are byte-identical to Go reference fixtures
…Go canonical fixtures - Loop over all 24 evaluation-case JSON files and assert value + reason - Handle known discrepancies: FLAG_NOT_FOUND (ERROR vs DEFAULT), startAt/endAt reason (TARGETING_MATCH vs STATIC), insignificant shard optimization (STATIC vs SPLIT) - 220 fixture test cases passing, existing evaluation_engine_spec.rb untouched
- Add ffe-system-test-data as git submodule at spec/datadog/open_feature/ - Update fixture_spec.rb paths from testdata/ to ffe-system-test-data/ - Remove local testdata/ directory (now sourced from submodule) - Add .github/dependabot.yml for git submodule auto-updates
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.
Motivation
The Ruby
evaluation_engine_spec.rbtests assertERRORandMATCHreason paths, but do not verifySTATICorSPLITreason values. The native evaluator (Rust FFI vialibdatadog) already returns correct reason values, but without test assertions, regressions in the reason contract would go undetected.This is part of a cross-SDK effort to ensure all OpenFeature reason values are covered by tests (see dd-trace-cross-repo planning).
Changes
STATICreason test context: verifies the override path (no rules, 1 split, no shards) returnsreason: 'STATIC'SPLITreason test context: verifies shard-based assignment returnsreason: 'SPLIT'MATCHreason assertion to the existing resolution details context (previously only assertedvalue, notreason)ERRORreason tests remain unchangedDecisions
NativeEvaluator#get_assignmentto returnResolutionDetailswith specific reason values, matching the existing test pattern. This verifies the engine correctly propagates reason values from the evaluator.