-
Notifications
You must be signed in to change notification settings - Fork 14
github proxy tests #79
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
Conversation
ae7821f
to
630e05a
Compare
This new tests need certificates to be configured in the system and they are always executed. While this is ok to do in travis VMs I'm not sure this should be a requirement in the developer's computer. I would either enable insecure communication for tests so the certs don't need to be installed in the computer or only execute these tests if explicitly asked for. One way to do this is moving the test to a new file and add a build tag on top: // +build proxy
package discovery
func TestProxyMockUps(t *testing.T) {
.... and calling - GO_TAGS=proxy make ci-script Either option is OK for me but I would prefer if tests could be run in my computer without installing certs. @mcarmonaa thoughts? |
@jfontan I like the tags version |
Other way could be just check for the environment variables the CI sets, so if for any reason you want to run those tests you just have to set the variables instead of rebuild the project: if os.Getenv("TRAVIS") == "" {
t.Skip()
} Anyway it's fine for me also the |
@mcarmonaa this one is the easiest :), I will pick it if @jfontan is ok with it |
@lwsanty I believe there is a better way. When setting up the transport to use proxy you can configure https://golang.org/pkg/net/http/#Transport Something like: // SetTransportProxy changes http.DefaultTransport to the one that uses current server as a proxy
func SetTransportProxy() error {
u, err := url.Parse(URL)
if err != nil {
return err
}
http.DefaultTransport = &http.Transport{
Proxy: http.ProxyURL(u),
// Disable HTTP/2.
TLSNextProto: make(map[string]func(authority string, c *tls.Conn) http.RoundTripper),
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
return nil
} |
@jfontan got it! I will check it tomorrow! |
add github proxy + extend discovery and download tests Signed-off-by: lwsanty <lwsanty@gmail.com>
630e05a
to
40875ab
Compare
Signed-off-by: lwsanty <lwsanty@gmail.com>
add github proxy + extend discovery and download tests
Signed-off-by: lwsanty lwsanty@gmail.com