-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Update Evaluation Definitions (#394)
<!-- Please use this template for your pull request. --> <!-- Please use the sections that you need and delete other sections --> ## This PR <!-- add the description of the PR here --> This pull request introduces several changes to the `OpenFeature.E2ETests` project, focusing on enhancing configuration and refactoring the step definitions for better state management and code clarity. The most important changes include updates to the VS Code configuration files, refactoring of the `BaseStepDefinitions` and `EvaluationStepDefinitions` classes, and enhancements to the feature flag evaluation logic. Configuration updates: * [`.vscode/extensions.json`](diffhunk://#diff-c16655a98a3ee89a7636a59c59a72b0e93649e3a1e947327cfc43a1336b4e912R1-R6): Added recommendations for the `cucumberopen.cucumber-official` and `ms-dotnettools.csdevkit` extensions. * [`.vscode/settings.json`](diffhunk://#diff-a5de3e5871ffcc383a2294845bd3df25d3eeff6c29ad46e3a396577c413bf357R1-R22): Enabled file nesting, added patterns for feature files, and excluded compilation results and other unnecessary files. Refactoring step definitions: * [`test/OpenFeature.E2ETests/Steps/BaseStepDefinitions.cs`](diffhunk://#diff-d602b805929d1f2c0a4e819949274cd996296363676f8f59efd1b2997845f46aL13-R80): Refactored to use a shared `State` class for managing feature flag state and evaluation results, replacing internal variables with properties of the `State` class. * [`test/OpenFeature.E2ETests/Steps/EvaluationStepDefinitions.cs`](diffhunk://#diff-9ca6e89533e4b3f7a2deaf8de6d6f07a80b7eab2afa6f2e8bfc682b9ca60dc6bL1-R167): Refactored to inherit from `BaseStepDefinitions`, using the shared `State` class for managing state and results, and converting synchronous methods to asynchronous. Enhancements to feature flag evaluation: * [`test/OpenFeature.E2ETests/Steps/BaseStepDefinitions.cs`](diffhunk://#diff-d602b805929d1f2c0a4e819949274cd996296363676f8f59efd1b2997845f46aL13-R80): Improved the flag evaluation logic by encapsulating flag properties in a `FlagState` class and updating the evaluation methods to use this new structure. * [`test/OpenFeature.E2ETests/Steps/BaseStepDefinitions.cs`](diffhunk://#diff-d602b805929d1f2c0a4e819949274cd996296363676f8f59efd1b2997845f46aR104-R158): Added new flag variants and context-aware flag evaluation logic to handle more complex scenarios. ### Related Issues <!-- add here the GitHub issue that this PR resolves if applicable --> Fixes #391 --------- Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
- Loading branch information
Showing
11 changed files
with
418 additions
and
399 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"recommendations": [ | ||
"cucumberopen.cucumber-official", | ||
"ms-dotnettools.csdevkit" | ||
] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"explorer.fileNesting.enabled": true, | ||
"explorer.fileNesting.patterns": { | ||
// shows *.feature.cs files as nested items | ||
"*.feature": "${capture}.feature.cs" | ||
}, | ||
"files.exclude": { | ||
// excludes compilation result | ||
"**/obj/": true, | ||
"**/bin/": true, | ||
"BenchmarkDotNet.Artifacts/": true, | ||
".idea/": true | ||
}, | ||
"cucumber.glue": [ | ||
// sets the location of the step definition classes | ||
"test/OpenFeature.E2ETests/Steps/*.cs" | ||
], | ||
"cucumber.features": [ | ||
// sets the location of the feature files | ||
"test/OpenFeature.E2ETests/Features/*.feature" | ||
] | ||
} |
This file contains 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
Oops, something went wrong.