test: add PARSE_ERROR and whitespace tests for evaluator ref#361
test: add PARSE_ERROR and whitespace tests for evaluator ref#361leakonvalinka wants to merge 2 commits intoopen-feature:mainfrom
Conversation
Signed-off-by: Lea Konvalinka <lea.konvalinka@dynatrace.com>
There was a problem hiding this comment.
Code Review
This pull request adds test cases for evaluator references ($ref) in flag definitions, covering whitespace variations and error handling for nonexistent references. The changes include new flag configurations in evaluator-refs.json and corresponding Gherkin scenarios in targeting.feature. Feedback was provided to improve the nonexistent evaluator test by using a unique evaluation default value, which ensures the test accurately verifies that the system falls back to the evaluation default rather than the flag's default variant during a parse error.
| Given a String-flag with key "ref-to-nonexistent-evaluator-flag" and a default value "fallback" | ||
| When the flag was evaluated with details | ||
| Then the resolved details value should be "fallback" |
There was a problem hiding this comment.
To ensure the test correctly verifies that the evaluator falls back to the evaluation default value (as required by the OpenFeature specification for a PARSE_ERROR) rather than the flag's defaultVariant, it is better to use a unique value for the default in the evaluation call. Currently, both the flag's defaultVariant (in evaluator-refs.json) and the evaluation default are set to "fallback", making it impossible to distinguish which one is being returned.
Given a String-flag with key "ref-to-nonexistent-evaluator-flag" and a default value "evaluation-default"
When the flag was evaluated with details
Then the resolved details value should be "evaluation-default"
There was a problem hiding this comment.
Should we differentiate here? I saw that other testcases don't differentiate either.
Signed-off-by: Lea Konvalinka <lea.konvalinka@dynatrace.com>
This PR
Related Issues
see #339
Notes
Follow-up Tasks
How to test