Skip to content

feat: serial-id-on-exposure precomputed assignment fixture - #36

Open
typotter wants to merge 27 commits into
mainfrom
typo/serial-id-on-exposure
Open

feat: serial-id-on-exposure precomputed assignment fixture#36
typotter wants to merge 27 commits into
mainfrom
typo/serial-id-on-exposure

Conversation

@typotter

Copy link
Copy Markdown
Contributor

Summary

Adds a standalone precomputed fixture that validates serialId forwarding
on exposure events. Intended as a demonstration piece for contributors to
the FLEX integration test suite.

What it tests

  • One flag carries serialId: 340132, one does not
  • Both evaluations succeed with TARGETING_MATCH
  • expectedEmissions.exposures: 2
  • expectedEvents subset matcher asserts at least one exposure carries
    serial_id: 340132

Stacked on

Depends on PR #33 (precomputed fixture corpus + schema conventions).

leoromanovsky and others added 26 commits June 2, 2026 19:01
Cover edge cases: empty response, all-silent (doLog=false), multiple
reasons, deep nested objects, type mismatch for all types, duplicate
evaluation dedup, falsy values, large flag sets, special chars in keys,
and null variation values.
Mark duplicate-evaluation, null-variation-value, and
type-mismatch-all-types as skip for web SDK due to
aggregator dedup, null handling, and numeric type differences.
- integer-precision-native-only: validates native SDKs preserve integers
  outside JS safe integer range; skipForSdks=["web"]
- context-switch-toggles-flag: sequence fixture verifying re-fetch on
  context change between pro (all-types) and free (defaults) configs
…r yet, will re-add when test_precomputed_sequence is implemented
… names

- precomputed/ → precomputed-assignments/ (all cases + README)
- result.variant → result.variantKey in all evaluation entries
- result.error → result.errorCode in all evaluation entries
- skipForSdksReason → skipReason at case, evaluation, and matcher levels
- README: update path refs + add precomputed-assignments schema table
- defaults-and-emission-gates: flutter.fixture.unknown errorCode
  flagNotFound → typeMismatch. The flag key exists; the variationType is
  unrecognized. flagNotFound is semantically wrong and masks SDK bugs that
  distinguish the two failure modes.
- precomputed-assignments/README.md: document expectedEvents subset-match
  contract. Each entry must match at least one event; unmatched events are
  allowed. Clarify skipForSdks on matchers relaxes assertions, not counts.
- type-mismatch-all-types: note in description that int-as-float is
  SDK-implementation-dependent. SDKs with implicit int→float promotion
  (Java, Swift, Dart) will not return typeMismatch. Evaluation-level skips
  for those platforms should be added after verification.
- large-flag-set: expand from 20 to 50 flags and update description.
  The fixture's stated purpose is truncation/parser stress testing; 20 flags
  did not stress-test parsers meaningfully.
…loat

Web-incompatible evaluation (integer-as-float) now uses evaluation-level
skipForSdks instead of skipping the whole fixture. The other 4 type-mismatch
evaluations now run on web. Count override reduces flagevaluationEvents from
5 to 4 for web.
Updated README to clarify the structure and content of precomputed assignment fixtures, including details on expected emissions and evaluation context.
Keep both precomputed-assignments/ and regex-conformance/ directory sections.
Keep both the Precomputed Assignment Fixtures and Targeting Regex Conformance
file format sections.
…ures' into typo/additional-precomputed-fixtures
…rialId

The DatadogProvider/openfeature-browser does not include serialId from
the precomputed assignment in the /api/v2/exposures payload. The exposure
count assertion (2 events) still holds; only the serial_id field check
is relaxed for web via skipForSdks.
- Remove flagevaluationRequests from expectedEmissions (un-assertable due to batching)
- Rename result → expected_result in evaluations
- Restructure skipForSdks+skipReason → skip array of {sdk, reason} objects
- Rename large-flag-set → multi-flag-set
- Add null object evaluation to falsy-values fixture
- Add expectedEvents bullet and skip/field-naming docs to precomputed README
- Update main README schema table
typeMismatch → TYPE_MISMATCH
flagNotFound → FLAG_NOT_FOUND

Aligns fixture error codes with the OpenFeature specification canonical
form. IPC services should normalize SDK-internal casing before returning
results to the test runner.
Remove serial-id-on-exposure.json from this PR. It will be submitted
as a standalone demonstration fixture in a follow-up PR.
Validates that the serialId field from the precomputed assignment
response is forwarded as serial_id on the exposure event payload.

One flag carries serialId, one does not. The expectedEvents matcher
asserts that at least one of the two exposures carries serial_id:
340132 (subset match).
@typotter
typotter requested a review from a team as a code owner August 25, 2026 22:37
@typotter
typotter requested review from dd-oleksii and greghuels and removed request for a team August 25, 2026 22:37
"variationValue": true,
"reason": "TARGETING_MATCH",
"doLog": true,
"serialId": 340132

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

minor: we should add a test with serialId: 0 to make sure it's not treated as absent one

@typotter
typotter force-pushed the typo/additional-precomputed-fixtures branch from b49847a to c364bfe Compare September 9, 2026 05:35
Base automatically changed from typo/additional-precomputed-fixtures to main September 9, 2026 05:37
Validates serialId forwarding on exposure events. Covers present
serialId, absent serialId, serialId of 0 (must not be treated as
absent), and null serialId. Updated to FLEX schema conventions.

Moved to emissions/ subdirectory. Removes stale flat fixture files
superseded by PR 33's directory restructure.
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.

3 participants