Skip to content

test(ffe): add Node offline-provider harness - #8604

Draft
sameerank wants to merge 1 commit into
mainfrom
sameerank/node-core-provider-system-tests
Draft

sameerank wants to merge 1 commit into
mainfrom
sameerank/node-core-provider-system-tests

Conversation

@sameerank

Copy link
Copy Markdown
Contributor

Motivation

Start the dedicated offline-provider harness discussed in openfeature-js-client #469. This is separate from #8267, which tests standalone precomputation helpers without registering a provider.

Changes

  • Add a fresh-process Node adapter that loads the built @datadog/openfeature-node-server/rules-based dependency without importing or initializing the tracer, then registers DatadogCoreProvider through the real OpenFeature SDK.
  • Add four grouped tests: synchronous READY bootstrap with zero HTTP requests; overlapping evaluations of the same flag with different root/dependency values and subjects; server-channel refresh with last-known configuration retention and change events; and explicitly registered exposure hooks with deduplication, late-hook rollback, caller-owned cache retention, and token exclusion.
  • Reuse the shared HTTP mock and existing process-isolation pattern. Add a small portable fixture with provenance and readable expected behavior.
  • Document the endpoint and report coverage under portable configuration feature Pre-build static docker images #562.

Activation And Scope

Keep this PR in draft. Node is missing_feature until a containing Core/Node package dependency update is available in the test build. Other SDKs are incomplete_test_app because they do not implement this adapter. @slow avoids starting unsupported test apps in ordinary runs. No release version is assumed.

The adapter can exercise the packaged Node dependency before dd-trace exports the provider. It does not yet test tracer-owned evaluation hooks, uploaders, or intake delivery. Precomputed snapshot policy coverage and tracer integration are later additions; #8267 remains independent.

For a containing custom Node build, using the repository's Python 3.12 runner:

PYTEST_XDIST_AUTO_NUM_WORKERS=1 TEST_LIBRARY=nodejs ./run.sh PARAMETRIC \
  tests/parametric/test_ffe/test_core_provider.py -F tests/parametric/test_ffe/test_core_provider.py

Local Validation

  • All four Python test methods passed on Node 18.20.8 and 20.20.2, with OpenFeature server SDK 1.19.0. Each run executed five fresh child processes against real SDK artifacts and the shared HTTP mock.
  • Built and packed Core/Node from Allow tailing 0 to be a string in WAF output #469 at d50b38c2e4040946af79ec3d19f6483589a7ce13 (local package versions 3.5.0/2.8.0). These are unreleased local builds, not evidence that published packages contain the provider.
  • Host validation used an isolated unpacked package layout and a copy of dd-trace's package metadata solely as the dependency-resolution anchor. It ran the same test methods and unchanged child adapter, not the full container-backed parametric server or tracer wrapper.
  • Deliberately wrong evaluation values and a no-op exposure hook each failed their regression checks; the original packed artifacts were restored and the cases passed again.
  • Parametric interface documentation checks: 2 passed. ./format.sh --check passed on a clean archive of the committed source, including Python typing/lint/formatting, import policy, manifest/YAML checks, ShellCheck, and both existing Node linter containers. JavaScript syntax checks passed for the new adapter and updated server.
  • Standard self-review and all four repository review lenses completed with no actionable findings.

Exercise synchronous portable bootstrap, overlapping request contexts and dependency telemetry, configuration replacement, and explicit exposure tracking through OpenFeature. Keep activation gated pending a containing Node dependency update.
@github-actions

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

tests/parametric/test_ffe/core-provider-rules-wire.json                 @DataDog/feature-flagging-and-experimentation-sdk
tests/parametric/test_ffe/core-provider-rules-wire.md                   @DataDog/feature-flagging-and-experimentation-sdk
tests/parametric/test_ffe/test_core_provider.py                         @DataDog/feature-flagging-and-experimentation-sdk
utils/build/docker/nodejs/parametric/ffe-core-provider.js               @DataDog/system-tests-reviewers
docs/understand/weblogs/parametric_weblog.md                            @DataDog/system-tests-core
manifests/cpp.yml                                                       @DataDog/system-tests-reviewers
manifests/dotnet.yml                                                    @DataDog/system-tests-reviewers
manifests/golang.yml                                                    @DataDog/system-tests-reviewers
manifests/java.yml                                                      @DataDog/system-tests-reviewers
manifests/nodejs.yml                                                    @DataDog/system-tests-reviewers
manifests/php.yml                                                       @DataDog/system-tests-reviewers
manifests/python.yml                                                    @DataDog/system-tests-reviewers
manifests/ruby.yml                                                      @DataDog/system-tests-reviewers
manifests/rust.yml                                                      @DataDog/system-tests-reviewers
tests/ffe/README.md                                                     @DataDog/feature-flagging-and-experimentation-sdk
utils/build/docker/nodejs/parametric/server.js                          @DataDog/system-tests-reviewers
utils/docker_fixtures/_test_clients/_test_client_parametric.py          @DataDog/system-tests-core

This branch has not been deployed

No deployments
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