open-feature / open-feature/flagd-testbed

Add smoke tests for standard JSON Logic operators

Open
#374 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Gherkin
Stars
5
Forks
14
Avg merge
3h 17m
Merged PRs (30d)
13

Description

We test custom operators (fractional, sem_ver, starts_with, ends_with) but have no isolated coverage for standard JSON Logic operators. Adding thin smoke tests would catch regressions during library upgrades.

Approach

  • New files: evaluator/gherkin/jsonlogic-operators.feature + evaluator/flags/jsonlogic-operators-flags.json
  • Tag: @jsonlogic-operators
  • Each flag wraps the operator in if/== to select a variant; assertions are on resolved variant values only
  • One or two cases per operator; not exhaustive

Operators

  • Equality: ==, !=
  • Comparison: >, <, >=, <=
  • Logic: and, or, !, !!
  • Arithmetic: +, -, *, /, %
  • String: cat, substr, in (substring)
  • Array: in (membership)
  • Control: if, missing, missing_some

Coercion cases

  • "1" == 1 (string/number)
  • "2" > 1 (string in comparison)
  • !!"" vs !!"hello" (truthy/falsy)
  • + "3" (unary plus coercion)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing custom-operator coverage, then add the tagged cases in evaluator/gherkin/jsonlogic-operators.feature and matching flags in evaluator/flags/jsonlogic-operators-flags.json. Run the evaluator's Gherkin tests and confirm each listed standard operator, including the coercion cases, resolves to the expected variant values.

Written by the indexing model from the issue text.

Assessment

Domain
testing-qa
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.