Skip to content

test: add PARSE_ERROR and whitespace tests for evaluator ref#361

Open
leakonvalinka wants to merge 2 commits intoopen-feature:mainfrom
open-feature-forking:test/evaluator-ref-fixes
Open

test: add PARSE_ERROR and whitespace tests for evaluator ref#361
leakonvalinka wants to merge 2 commits intoopen-feature:mainfrom
open-feature-forking:test/evaluator-ref-fixes

Conversation

@leakonvalinka
Copy link
Copy Markdown
Member

@leakonvalinka leakonvalinka commented Apr 2, 2026

This PR

Related Issues

see #339

Notes

Follow-up Tasks

How to test

Signed-off-by: Lea Konvalinka <lea.konvalinka@dynatrace.com>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +41 to +43
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"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we differentiate here? I saw that other testcases don't differentiate either.

Signed-off-by: Lea Konvalinka <lea.konvalinka@dynatrace.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant