-
Notifications
You must be signed in to change notification settings - Fork 35
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
Improve local test setup #177
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.
generally lgtm - just a few minor q's and knits
e2e/setup.go
Outdated
func init() { | ||
err := startMinioContainer() | ||
if err != nil { | ||
panic(err) | ||
} | ||
err = startRedisContainer() | ||
if err != nil { | ||
panic(err) | ||
} | ||
} |
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.
knit - using an init pattern like this could make our code super hard to import - at least this library
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.
agree that this sucks... also it could at some point be needed to have new clean instances per test. wanted to talk with you about how to best refactor this.
I didn't see an obvious place where to start these containers. The separation between creating the config (one fct that sets all the config vars) and starting the endpoints makes it hard... because the actual endpoint of the containers are only known after they are started, so we'd need to start them in the "createConfig" function, which feels wrong... perhaps we need yet another function like startDependencyContainers()
or something? And we can call it from the test main function?
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.
On another note though I'm not sure why anyone would want to import this package... do you have anything in mind or just saying in case?
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.
just saying as an in-case - maybe one day we try importing this into node software directly for cross testing framework integration
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.
Agree with you, but want to move on to other things for now and worry about this when it actually becomes a problem (perhaps an obvious refactor will also surface once we have an actual need for this). Added a TODO comment: a9ae57b
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.
LGTM - just very knits
minioEndpoint = strings.TrimPrefix(endpoint, "http://") | ||
return nil | ||
} | ||
|
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.
knit - we document the above function but not this one
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.
e2e/setup.go
Outdated
} | ||
|
||
// startMinioContainer starts a MinIO container and returns the container instance and its endpoint | ||
func startMinioContainer() error { |
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.
knit - startMinIOContainer
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.
Fixes Issue
Fixes #175
at least fixes everything with e2e tests. holesky tests are still not runnable locally until we get that private key stored somewhere.
Changes proposed
Screenshots (Optional)
Note to reviewers