Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: in-memory provider for sdk testing #192

Merged

Conversation

Kavindu-Dodan
Copy link
Contributor

@Kavindu-Dodan Kavindu-Dodan commented Jul 7, 2023

This PR

Is related to OFEP open-feature/ofep#71 and shows the feasibility of an in-memory provider

Features

  • Provider is constructed with map of pre-defined flags [1]
  • Supports context evaluations based on callbacks [2]

[1] - open-feature/ofep#71
[2] - https://github.com/open-feature/go-sdk/pull/192/files#diff-1e56a5f9a72a9694aeb6f3510e8a2e02359c3cbdb9bd5c906219e30756d857efR181

@codecov
Copy link

codecov bot commented Jul 11, 2023

Codecov Report

Merging #192 (94bec17) into main (2bc3c38) will decrease coverage by 0.36%.
The diff coverage is 76.33%.

@@            Coverage Diff             @@
##             main     #192      +/-   ##
==========================================
- Coverage   78.99%   78.63%   -0.36%     
==========================================
  Files           9       10       +1     
  Lines        1076     1203     +127     
==========================================
+ Hits          850      946      +96     
- Misses        204      230      +26     
- Partials       22       27       +5     
Files Changed Coverage Δ
pkg/openfeature/memprovider/in_memory_provider.go 75.59% <75.59%> (ø)
pkg/openfeature/event_executor.go 98.71% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Kavindu-Dodan Kavindu-Dodan marked this pull request as ready for review July 12, 2023 18:29
@Kavindu-Dodan Kavindu-Dodan requested a review from a team as a code owner July 12, 2023 18:29
@Kavindu-Dodan Kavindu-Dodan changed the title feat: basic in-memory provider feat: in-memory provider for sdk testing Jul 12, 2023
@Kavindu-Dodan Kavindu-Dodan force-pushed the feat/in-memory-provider-for-testing branch from 0459d87 to f9f4b29 Compare July 12, 2023 19:58
e2e/common_test.go Outdated Show resolved Hide resolved
e2e/common_test.go Outdated Show resolved Hide resolved
Copy link
Member

@toddbaert toddbaert left a comment

Choose a reason for hiding this comment

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

This is very straightforward. It's pretty much convinced me we should do this everywhere.

@beeme1mr
Copy link
Member

Perhaps we should add the e2e folder to the Codecov ignore list.

Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
@Kavindu-Dodan Kavindu-Dodan force-pushed the feat/in-memory-provider-for-testing branch from a8c2838 to b2d2084 Compare July 21, 2023 17:04
@Kavindu-Dodan
Copy link
Contributor Author

Perhaps we should add the e2e folder to the Codecov ignore list.

For this PR, coverage complaint is on newly added in-memory providers. Some of the error paths are not covered with tests but IMO these are not essential (ex:- testing errors for each flag type)

@beeme1mr beeme1mr merged commit 366674f into open-feature:main Jul 28, 2023
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.

4 participants