Skip to content

chore: replace test-harness submodule with spec submodule#1359

Open
MridulTailor wants to merge 2 commits intoopen-feature:mainfrom
MridulTailor:chore/replace-test-harness-with-spec-submodule
Open

chore: replace test-harness submodule with spec submodule#1359
MridulTailor wants to merge 2 commits intoopen-feature:mainfrom
MridulTailor:chore/replace-test-harness-with-spec-submodule

Conversation

@MridulTailor
Copy link
Contributor

Replace the test-harness submodule with the spec submodule to remove flagd-related dependencies and use the evaluation.feature gherkin file from the OpenFeature specification.

This PR

This PR replaces the test-harness submodule with the spec submodule to remove flagd-related dependencies from the SDK and use the evaluation.feature gherkin file directly from the OpenFeature specification repository.

Changes Made:

  • Submodules: Removed test-harness submodule and added spec submodule
  • Build scripts: Updated e2e-server and e2e-web scripts in package.json to reference spec/specification/assets/gherkin/evaluation.feature
  • Documentation: Updated CONTRIBUTING.md to reference the spec repository
  • Test implementations: Updated e2e test step definitions in both server and web packages to match the gherkin language changes in the spec:
    • Changed step matcher from 'a provider is registered with cache disabled' to 'a stable provider'
    • Changed step matcher for error scenarios from 'default value' to 'fallback value'
    • Renamed helper function from givenAnOpenfeatureClientIsRegisteredWithCacheDisabled to givenAStableProvider

Related Issues

Fixes #743

Notes

  • All 13 e2e test scenarios are passing for both server and web packages
  • The spec's evaluation.feature file is marked as @deprecated but is still functional and matches our test requirements
  • All unit tests continue to pass (615 tests total: 583 Jest + 32 Angular)

Follow-up Tasks

  • Monitor for updates to the spec repository's gherkin files as they may evolve
  • Consider migrating to evaluation_v2.feature if/when it becomes the recommended testing standard

How to test

Run the e2e tests to verify the integration with the new spec submodule:

# Run server e2e tests
npm run e2e-server

# Run web e2e tests
npm run e2e-web

# Run all e2e tests
npm run e2e

# Run full test suite
npm test

Replace the test-harness submodule with the spec submodule to remove
flagd-related dependencies and use the evaluation.feature gherkin file
from the OpenFeature specification.

Changes:
- Remove test-harness submodule and add spec submodule
- Update package.json scripts to reference spec/specification/assets/gherkin/evaluation.feature
- Update CONTRIBUTING.md documentation links
- Update test step definitions to match spec gherkin language changes:
  - 'a provider is registered with cache disabled' -> 'a stable provider'
  - 'default value' -> 'fallback value' in error scenarios
- Rename helper function givenAnOpenfeatureClientIsRegisteredWithCacheDisabled to givenAStableProvider

All e2e tests passing (13 scenarios in both server and web packages).

Fixes open-feature#743

Signed-off-by: Mridul Tailor <mtailor729@gmail.com>
@MridulTailor MridulTailor requested review from a team as code owners March 1, 2026 23:09
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines the project's testing infrastructure by integrating directly with the OpenFeature specification. It removes an external 'test-harness' dependency, reducing potential for flagd-specific coupling, and ensures that end-to-end tests are driven by the official specification's Gherkin feature file. This change improves consistency and maintainability of the testing suite.

Highlights

  • Submodule Replacement: Replaced the 'test-harness' Git submodule with the 'spec' submodule to align with the OpenFeature specification.
  • Build Script Updates: Modified 'e2e-server' and 'e2e-web' scripts in 'package.json' to reference the 'evaluation.feature' file from the new 'spec' submodule.
  • Documentation Alignment: Updated 'CONTRIBUTING.md' to reflect the new location of the gherkin e2e tests within the 'spec' repository.
  • E2E Test Refactoring: Updated e2e test step definitions in both server and web packages, including changing step matchers and renaming a helper function, to match gherkin language changes in the specification.
Changelog
  • .gitmodules
    • Replaced 'test-harness' submodule entry with 'spec' submodule entry.
  • CONTRIBUTING.md
    • Updated the link to the gherkin e2e tests to point to the 'spec' repository.
  • package.json
    • Modified 'e2e-server' and 'e2e-web' scripts to copy 'evaluation.feature' from the 'spec' submodule instead of 'test-harness'.
  • packages/server/e2e/step-definitions/evaluation.spec.ts
    • Renamed 'givenAnOpenfeatureClientIsRegisteredWithCacheDisabled' function to 'givenAStableProvider'.
    • Updated step matcher from 'a provider is registered with cache disabled' to 'a stable provider'.
    • Changed step matcher for error scenarios from 'default value' to 'fallback value'.
  • packages/web/e2e/step-definitions/evaluation.spec.ts
    • Renamed 'givenAnOpenfeatureClientIsRegisteredWithCacheDisabled' function to 'givenAStableProvider'.
    • Updated step matcher from 'a provider is registered with cache disabled' to 'a stable provider'.
    • Changed step matcher for error scenarios from 'default value' to 'fallback value'.
  • spec
    • Added the 'spec' repository as a Git submodule.
  • test-harness
    • Removed the 'test-harness' repository as a Git submodule.
Activity
  • All 13 e2e test scenarios are passing for both server and web packages.
  • The spec's 'evaluation.feature' file is currently marked as '@deprecated' but remains functional for current test requirements.
  • All unit tests (615 total: 583 Jest + 32 Angular) continue to pass.
  • Follow-up tasks include monitoring updates to the spec repository's gherkin files and considering migration to 'evaluation_v2.feature' in the future.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly replaces the test-harness submodule with the spec submodule, which is a good move to reduce dependencies and align with the OpenFeature specification. The changes are well-documented in the PR description. I've identified a few areas for improvement, mainly related to code duplication in the package.json scripts and some confusing variable names in the e2e tests. My feedback aims to enhance the maintainability and clarity of the codebase.

Comment on lines +13 to 15
"e2e-server": "git submodule update --init --recursive && shx cp spec/specification/assets/gherkin/evaluation.feature packages/server/e2e/features && jest --selectProjects=server-e2e --verbose",
"e2e-web": "git submodule update --init --recursive && shx cp spec/specification/assets/gherkin/evaluation.feature packages/web/e2e/features && jest --selectProjects=web-e2e --verbose",
"e2e": "npm run e2e-server && npm run e2e-web",
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The e2e-server and e2e-web scripts duplicate the git submodule update command and the path to evaluation.feature. This causes the submodule update to run twice when npm run e2e is executed. While the performance impact is likely minimal, this can be improved for better maintainability.

Consider extracting the preparation step into a separate script to centralize the setup logic. For example:

"scripts": {
  ...
  "e2e:prepare": "git submodule update --init --recursive && shx cp spec/specification/assets/gherkin/evaluation.feature packages/server/e2e/features && shx cp spec/specification/assets/gherkin/evaluation.feature packages/web/e2e/features",
  "e2e-server": "npm run e2e:prepare && jest --selectProjects=server-e2e --verbose",
  "e2e-web": "npm run e2e:prepare && jest --selectProjects=web-e2e --verbose",
  "e2e": "npm run e2e:prepare && jest --selectProjects=server-e2e,web-e2e --verbose",
  ...
}

This would make the scripts cleaner, though it's worth noting it changes the behavior of e2e-server and e2e-web to prepare the environment for both test suites.

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.

Replace test-harness submodule with spec submodule

1 participant