feat(BRIDGE-119): added support for Feature Flags

This commit is contained in:
Atanas Janeshliev
2024-08-07 17:04:54 +02:00
parent 3d53bf7477
commit e290cd308b
11 changed files with 377 additions and 1 deletions

View File

@ -149,6 +149,11 @@ func (t *testCtx) initBridge() (<-chan events.Event, error) {
}
rt := t.netCtl.NewRoundTripper(&tls.Config{InsecureSkipVerify: true})
// We store the round tripper in the testing context so we can cancel the connection
// when we're turning it down/up
t.rt = &rt
if isBlack() {
// GODT-1602 make sure we don't time out test server
t, ok := rt.(*http.Transport)

View File

@ -21,6 +21,7 @@ import (
"context"
"fmt"
"net"
"net/http"
"net/smtp"
"net/url"
"regexp"
@ -164,6 +165,8 @@ type testCtx struct {
imapServerStarted bool
smtpServerStarted bool
rt *http.RoundTripper
}
type imapClient struct {

View File

@ -59,11 +59,19 @@ func (s *scenario) itFailsWithError(wantErr string) error {
func (s *scenario) internetIsTurnedOff() error {
s.t.netCtl.SetCanDial(false)
t, ok := (*s.t.rt).(*http.Transport)
if ok {
t.CloseIdleConnections()
}
return nil
}
func (s *scenario) internetIsTurnedOn() error {
s.t.netCtl.SetCanDial(true)
t, ok := (*s.t.rt).(*http.Transport)
if ok {
t.CloseIdleConnections()
}
return nil
}