Skip to content

Commit

Permalink
feat: Update test harness with metadata assertions #1467 (#289)
Browse files Browse the repository at this point in the history
## This PR
Adds gherkin test to verify that flag evaluations provide metadata

### Related Issues

Part of #1467
([https://github.com/open-feature/flagd/issues/1467](https://github.com/open-feature/flagd/issues/1467))

### Follow-up Tasks
Implement steps of the gherkin file in the repositories, and add test
data according to the issue

---------

Signed-off-by: christian.lutnik <christian.lutnik@dynatrace.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Simon Schrottner <simon.schrottner@dynatrace.com>
  • Loading branch information
3 people authored Jan 27, 2025
1 parent 6c673d7 commit 5b07065
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions specification/assets/gherkin/metadata.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@Metadata
Feature: Metadata

Background:
Given a stable provider

Scenario: Returns metadata
Given a Boolean-flag with key "metadata-flag" and a default value "true"
When the flag was evaluated with details
Then the resolved metadata should contain
| key | metadata_type | value |
| string | String | 1.0.2 |
| integer | Integer | 2 |
| float | Float | 0.1 |
| boolean | Boolean | true |

Scenario Outline: Returns no metadata
Given a <flag_type>-flag with key "<key>" and a default value "<default_value>"
When the flag was evaluated with details
Then the resolved metadata is empty

Examples: Flags
| key | flag_type | default_value |
| boolean-flag | Boolean | true |
| integer-flag | Integer | 23 |
| float-flag | Float | 2.3 |
| string-flag | String | value |

0 comments on commit 5b07065

Please sign in to comment.