-
Notifications
You must be signed in to change notification settings - Fork 14
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: improving SDK e2e test strategy #71
feat: improving SDK e2e test strategy #71
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fully support the idea. Beside the benefits for our own SDKs, this also should enhance DevExp providing some nice way for developers to facilitate the testing of their FF logic
I dont want us to build a "flagd" in each SDK - but I think what you're proposing (a simple in memory provider) per SDK makes sense. Indeed, as @thisthat points out, similar things have been implemented by OTel (such as the in-memory metrics exporters) and they fulfill similar roles (unit testing, etc). I have highlighted a few additional requirements I think would be necessary to make this fully usable. I hope they make sense. |
@thisthat & @toddbaert thank you for the feedback I have implemented a POC implementation of the proposed InMemory provider in go-sdk - open-feature/go-sdk#192 |
After looking at @Kavindu-Dodan 's go implementation, I agree we should do this in all SDKs. |
@Kavindu-Dodan I think it's a good idea to actually add the exported in-memory provider as a spec requirement. What do you think? I think it would be a good testing utility even for consumers. We could add it as a new section, or maybe some kind of appendix. |
I think this is a good idea. Adding an appendix section with extra details and recommendations will benefit the community Opened a spec pr - open-feature/spec#199 |
Agree too. The only thing I'm not convinced about is whether flags for the in-memory provider should be set statically at initialization only or a mutable interface would be more helpful in practice. For example, it might be helpful for some tests to allow the provider to change the resolution of a flag without having to set a whole new provider. Think cascading flag overrides for tests, where a flag is set for a whole test class and another at the method level, while keeping the previous one. |
I think the in-memory provider can be easily expanded if we see the need. For example, the provider constructor can accept flag storage that can be mutated independently. However, I am not sure whether we must define this through OFEP itself 🤔 |
I wonder if we could use this to automagically build out a support feature matrix and update a readme. Basically, if there are e2e tests for events, it's supported by the SDK. Definitely out of scope of this OFEP, but the idea may be worth exploring. |
If I have to do this, I would rather create an OpenFeature GitHub action 🤔 Reason is, there is a considerable effort to do this in each language (Check feature completeness -> Update readme -> Create Git PR ) |
Just to clarify, does this mean that the in-memory provider will be included in the SDK, or part of the repository. The latter would be my preference. This is something that we can accomplish without tying it directly into the same package and publishing the provider separately, but we do retain atomic changes. That way no one has to unnecessarily install the in-memory provider code unless they actually wanted to use an in-memory provider (which I can't think of many cases that actually makes sense in production). |
I see your point, and I'd like to come to a consensus on this before accepting/merging this OFEP. I tend to think it would be better to actually include it in the SDK. Here are my reasons why:
|
Thank you for feedback @tcarrio & @toddbaert I think a dedicated artifact/binary release brings more maintenance effort. And I updated the OFEP to emphasize the |
ec965bc
to
3a22ad6
Compare
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Co-authored-by: Justin Abrahms <justin@abrah.ms> Signed-off-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com> Signed-off-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com> Signed-off-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com> Signed-off-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com> Signed-off-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
Co-authored-by: Justin Abrahms <justin@abrah.ms> Signed-off-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com> Signed-off-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
2f7c045
to
a6cd175
Compare
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Updated status to If there is no further feedback, or objections on the proposal, this OFPE will be merged on next Tuesday (25th July) |
This PR
Propose to improve OpenFeature SDK e2e test strategy by decoupling tests from flagd and introducing a self-contained provider built into SDK implementation
Feel free to comment, propose or approve the ofep based on your experience
Current dependency issue
Proposed change
Update
Note - While this OFEP is being reviewed, I will attempt to create a POC implementation of the proposed provider in one of the SDK I maintain.