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: loosen test instance interface to support various test frameworks #316 #319

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ekarlso
Copy link
Contributor

@ekarlso ekarlso commented Feb 4, 2025

feat: loosen test instance interface to support various test frameworks (#317)

This PR

Use interface instead of testing.BB since it has private() that blocks use.

Related Issues

Fixes #316

Notes

Follow-up Tasks

How to test

ekarlso added 2 commits February 4, 2025 22:04
…ks (open-feature#317)

Switch to `interface{ Name() string }` since testing.BB has `private` which blocks it from working.

Signed-off-by: ekarlso <[email protected]>
@ekarlso ekarlso requested a review from a team as a code owner February 4, 2025 22:32
@ekarlso ekarlso changed the title feat: loosen test instance interface to support various test frameworks #317 feat: loosen test instance interface to support various test frameworks #316 Feb 4, 2025
Copy link
Member

@thomaspoignant thomaspoignant left a comment

Choose a reason for hiding this comment

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

This looks good to me, my only small concern is that it is not obvious anymore what is the type of test, this is why I think we can name this type as proposed in the comment.

@@ -29,7 +28,7 @@ type TestProvider struct {
}

// UsingFlags sets flags for the scope of a test
func (tp TestProvider) UsingFlags(test *testing.T, flags map[string]memprovider.InMemoryFlag) {
func (tp TestProvider) UsingFlags(test interface{ Name() string }, flags map[string]memprovider.InMemoryFlag) {
Copy link
Member

@thomaspoignant thomaspoignant Feb 5, 2025

Choose a reason for hiding this comment

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

Suggested change
func (tp TestProvider) UsingFlags(test interface{ Name() string }, flags map[string]memprovider.InMemoryFlag) {
type TestFramework = interface{ Name() string }
func (tp TestProvider) UsingFlags(test TestFramework, flags map[string]memprovider.InMemoryFlag) {

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.

[FEATURE] Support for Ginkgo GinkgoT()
2 participants