refactor: centralize test fixtures via ffe-system-test-data submodule#225
Draft
leoromanovsky wants to merge 1 commit into
Draft
refactor: centralize test fixtures via ffe-system-test-data submodule#225leoromanovsky wants to merge 1 commit into
leoromanovsky wants to merge 1 commit into
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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. Theffe-system-test-datarepo provides a single source of truth for UFC evaluation test cases shared across all Datadog OpenFeature SDKs.Changes
ffe-system-test-dataas a git submodule atpackages/node-server/test/ffe-system-test-dataflags-v1.spec.tsto readufc-config.jsonandevaluation-cases/from the submodule instead ofdata/flags-v1.jsonanddata/tests/provider.spec.tsto read config from submoduleUniversalFlagConfigurationV1Responsewrapper — the shared config uses the unwrappedUniversalFlagConfigurationV1format directlypackages/node-server/test/data/)dependabotentry forgitsubmoduleecosystem to get automatic update PRsDecisions
variantorflagMetadatafields. The test code uses optional chaining (testCase.result.flagMetadata?.doLog) so missing fields are handled gracefully — exposure assertions are simply skipped for shared fixtures.test-flag-that-does-not-exist.jsonusesDEFAULTreason (Go convention) but Node.js returnsERRORwithFLAG_NOT_FOUND. Since the current test code on main does not assertreason, this difference is benign. The reason fix branch will add the appropriate override.boolean-false-assignment,falsy-value-assignments,microsecond-date-flag).Note: The submodule currently points at the
leo.romanovsky/add-canonical-fixturesbranch commit since fixtures have not been merged tomaininffe-system-test-datayet. Once that PR merges, update the submodule pointer withgit submodule update --remote.