test(GODT-1602): run integration tests against black 🖤

This commit is contained in:
Jakub Cuth
2024-02-19 10:43:35 +00:00
parent 2a1aeb208d
commit 37352d44d2
51 changed files with 525 additions and 271 deletions

View File

@ -23,6 +23,7 @@ import (
"crypto/x509"
"encoding/json"
"fmt"
"net/http"
"net/http/cookiejar"
"os"
"path/filepath"
@ -34,6 +35,7 @@ import (
"github.com/ProtonMail/proton-bridge/v3/internal/bridge"
"github.com/ProtonMail/proton-bridge/v3/internal/constants"
"github.com/ProtonMail/proton-bridge/v3/internal/cookies"
"github.com/ProtonMail/proton-bridge/v3/internal/dialer"
"github.com/ProtonMail/proton-bridge/v3/internal/events"
frontend "github.com/ProtonMail/proton-bridge/v3/internal/frontend/grpc"
"github.com/ProtonMail/proton-bridge/v3/internal/service"
@ -146,6 +148,16 @@ func (t *testCtx) initBridge() (<-chan events.Event, error) {
logrus.SetLevel(logrus.TraceLevel)
}
rt := t.netCtl.NewRoundTripper(&tls.Config{InsecureSkipVerify: true})
if isBlack() {
// GODT-1602 make sure we don't time out test server
t, ok := rt.(*http.Transport)
if !ok {
panic("expecting http.Transport")
}
dialer.SetBasicTransportTimeouts(t)
}
// Create the bridge.
bridge, eventCh, err := bridge.New(
// App stuff
@ -161,7 +173,7 @@ func (t *testCtx) initBridge() (<-chan events.Event, error) {
persister,
useragent.New(),
t.mocks.TLSReporter,
t.netCtl.NewRoundTripper(&tls.Config{InsecureSkipVerify: true}),
rt,
t.mocks.ProxyCtl,
t.mocks.CrashHandler,
t.reporter,