Add FFE test case for empty targeting key evaluation#6046
Add FFE test case for empty targeting key evaluation#6046leoromanovsky merged 8 commits intomainfrom
Conversation
|
|
Adds a new flag definition and test case to verify that flag evaluation succeeds when targeting key is an empty string. The flag should still match the allocation and return the expected value. This tests that tracers properly handle empty targeting keys during evaluation (separate from exposure event handling).
These libraries have known bugs where their OpenFeature SDKs reject empty targeting keys with a truthiness check: - Java: FFL-1729 (fix pending: open-feature/java-sdk#1807) - Node.js: FFL-1730 (fix: https://github.com/DataDog/openfeature-js-client/pull/new/leo/allow-empty-targeting-key)
3573388 to
f3ce7cf
Compare
- Added test_ffe_of7_empty_targeting_key with @bug decorators for Java (FFL-1729) and Node.js (FFL-1730) - Keeps inline skip in parametrized test as safeguard - Provides visibility in test reporting for known bugs
| ) | ||
|
|
||
| @parametrize("library_env", [{**DEFAULT_ENVVARS}]) | ||
| @bug(context.library == "java", reason="FFL-1729") |
There was a problem hiding this comment.
Could you use manifest ? (ping me if you need any help)
There was a problem hiding this comment.
Sure I didn't know this was undesired; there is a CI test that fails for the other test type.
There was a problem hiding this comment.
nw, we just completed the scope of manifest, and the target is to use them every time it's possible.
| is an empty string. The flag should still match allocations and return | ||
| the expected value, not fail with TARGETING_KEY_MISSING. | ||
|
|
||
| Temporary dedicated test until FFL-1729 (Java) and FFL-1730 (Node.js) are resolved. |
There was a problem hiding this comment.
might be useful to drop in a comment that the bugs are in the OF repositories.
There was a problem hiding this comment.
Just Java; nodejs is ours. Sure doesn't hurt to add but the details are in the JIRAs and I expect this to be a short-lived comment.
Move bug annotations for FFL-1729 (Java) and FFL-1730 (Node.js) from inline @bug decorators to manifest files as requested in code review.
| # Skip OF.7 (empty targeting key) test for libraries with known bugs | ||
| # Java: FFL-1729 - OpenFeature Java SDK rejects empty targeting keys | ||
| # Node.js: FFL-1730 - OpenFeature JS SDK rejects empty targeting keys | ||
| if test_case_file == "test-case-of-7-empty-targeting-key.json": |
There was a problem hiding this comment.
FYI, this does not play nicely with all the downstream process that handles bug follow-up. But I do not have a clean solution to propose, so let's go with it. If I find a nice solution, I'll clean that.
There was a problem hiding this comment.
Yea we end up needing to disable the entire test suite when we find a single corner case bug.
Adds a new flag definition and test case to verify that flag evaluation succeeds when targeting key is an empty string. The flag should still match the allocation and return the expected value.
This tests that tracers properly handle empty targeting keys during evaluation (separate from exposure event handling).
Motivation
SDK Specification
While developing another system test to validate that exposures are being sent for empty targeting keys, found that in Java and NodeJS implementations an empty targeting key was causing evaluations to return the programmatic default.
Changes
Decisions
Why both inline skip AND dedicated test?
This dual approach ensures the bugs are tracked properly while preventing CI failures.
Next Steps
Language: Java
JIRA: FFL-1729
Fix: open-feature/java-sdk#1807
Action: Merge upstream PR, then remove @bug decorator
────────────────────────────────────────
Language: Node.js
JIRA: FFL-1730
Fix: https://github.com/DataDog/openfeature-js-client/pull/new/leo/allow-empty-targeting-key
Action: Merge internal PR, then remove @bug decorator
Once fixes are merged:
Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present