Skip to content

test($evaluators): add gherkin test coverage for $ref resolution edge cases from flagd#1875 #22

@aepfli

Description

@aepfli

Background

flagd#1875 documents inconsistencies in $evaluators/$ref resolution across SDK implementations, including missing Rust support. The flagd-evaluator has a complete implementation (recursive resolution, circular reference detection, parse-time validation for missing refs), but these scenarios are not covered by the shared gherkin test suite.

Missing Test Coverage

1. Basic $ref resolution

A flag using a shared targeting rule from $evaluators should evaluate correctly.

2. Unresolved $ref (missing evaluator)

A $ref pointing to a non-existent evaluator name.
Expected: flag reports an error at state-update time (parse-time validation), not silently at evaluation time.

3. Nested $ref (evaluator referencing another evaluator)

An evaluator that itself contains a $ref.
Expected: resolved recursively.

4. Circular $ref detection

An evaluator that references itself (directly or transitively).
Expected: error reported cleanly, not an infinite loop.

What Needs to Be Done

  1. Add flag definitions to the testbed covering these scenarios
  2. Add @evaluators gherkin scenarios to targeting.feature
  3. Add those scenarios to the evaluator's tests/gherkin_tests.rs

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions