Skip to content

refactor: centralize test fixtures via ffe-system-test-data submodule#225

Draft
leoromanovsky wants to merge 1 commit into
mainfrom
leo.romanovsky/centralize-ffe-fixtures
Draft

refactor: centralize test fixtures via ffe-system-test-data submodule#225
leoromanovsky wants to merge 1 commit into
mainfrom
leo.romanovsky/centralize-ffe-fixtures

Conversation

@leoromanovsky
Copy link
Copy Markdown
Collaborator

Motivation

The Node.js SDK currently maintains its own copy of UFC evaluation fixtures in packages/node-server/test/data/. This creates drift when fixtures are updated across SDKs. The ffe-system-test-data repo provides a single source of truth for UFC evaluation test cases shared across all Datadog OpenFeature SDKs.

Changes

  • Added ffe-system-test-data as a git submodule at packages/node-server/test/ffe-system-test-data
  • Updated flags-v1.spec.ts to read ufc-config.json and evaluation-cases/ from the submodule instead of data/flags-v1.json and data/tests/
  • Updated provider.spec.ts to read config from submodule
  • Removed the UniversalFlagConfigurationV1Response wrapper — the shared config uses the unwrapped UniversalFlagConfigurationV1 format directly
  • Deleted all local fixture copies (packages/node-server/test/data/)
  • Added dependabot entry for gitsubmodule ecosystem to get automatic update PRs

Decisions

  • The shared fixtures use a universal schema without variant or flagMetadata fields. The test code uses optional chaining (testCase.result.flagMetadata?.doLog) so missing fields are handled gracefully — exposure assertions are simply skipped for shared fixtures.
  • The shared test-flag-that-does-not-exist.json uses DEFAULT reason (Go convention) but Node.js returns ERROR with FLAG_NOT_FOUND. Since the current test code on main does not assert reason, this difference is benign. The reason fix branch will add the appropriate override.
  • Test count increased from ~100 to 251 due to additional evaluation cases in the shared fixtures (e.g., boolean-false-assignment, falsy-value-assignments, microsecond-date-flag).

Note: The submodule currently points at the leo.romanovsky/add-canonical-fixtures branch commit since fixtures have not been merged to main in ffe-system-test-data yet. Once that PR merges, update the submodule pointer with git submodule update --remote.

- Add ffe-system-test-data as git submodule at packages/node-server/test/
- Update flags-v1.spec.ts to read ufc-config.json from submodule
- Update provider.spec.ts to read config from submodule
- Remove UniversalFlagConfigurationV1Response wrapper (shared config is unwrapped)
- Delete old local test fixtures (packages/node-server/test/data/)
- Add dependabot gitsubmodule entry for automatic updates
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