-
Notifications
You must be signed in to change notification settings - Fork 336
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: Integration testing with testcontainers go #1076
base: master
Are you sure you want to change the base?
Conversation
WIP Checkin - most tests passing, but reconnect logic seems flakey
Some other benefits:
|
Pending the changes in #1077, this PR might end up getting reworked such that the following code in func serviceURL() string {
return integration.URL("pulsar", "6650")
}
func serviceURLTLS() string {
return integration.URL("pulsar+ssl", "6651")
}
func webServiceURL() string {
return integration.URL("http", "8080")
}
func webServiceURLTLS() string {
return integration.URL("https", "8443")
} Becomes AdminClient() *pulsaradmin.Client {
return pulsaradmin.NewClient(pulsaradmin.ClientConfig{
WebServiceURL: integration.URL("https", "8443"),
BKWebServiceURL: integration.URL("pulsar", "6650"),
//etc
})
}
AdminClientTLS() *pulsaradmin.Client {
return pulsaradmin.NewClient(pulsaradmin.ClientConfig{
WebServiceURL: integration.URL("http", "8080"),
BKWebServiceURL: integration.URL("pulsar+ssl", "6651"),
//etc
})
} Which would then create the integration container only when one of the helper admin clients is used, while simultaneously dogfooding |
"github.com/stretchr/testify/assert" | ||
|
||
pkgerrors "github.com/pkg/errors" | ||
) | ||
|
||
const ( | ||
serviceURL = "pulsar://localhost:6650" | ||
serviceURLTLS = "pulsar+ssl://localhost:6651" | ||
// serviceURL = "pulsar://localhost:6650" |
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.
Let's remove these instead of commenting out
Motivation
Instead of building a customized container, test using base image and testcontainers-go. This enables manual individual test execution, and will only create the integration container if tests are run which require it.
Modifications
Verifying this change
cd <repo root>/pulsar && go test -v -race ./...
This change is already covered by existing integration tests.
Does this pull request potentially affect one of the following parts:
http: invalid Host header
error (Golang client fails to attach to streams with "http: invalid Host header" with go1.20.6, go1.19.11 moby/moby#45935)Documentation
WIP
Some connection tests are failing, such as the "retry on multipl hostname" or producer connection tests, however it's unclear how these changes would suddenly cause this test to fail, so it's possible these are flakey.
Tasks:
go test -v
and compare against vanilla repo in an attempt to identify tests that are passing, but shouldn't, and determine of the above errors are flakey tests or something different about thetestcontainers-go
environment