Other: Add FEATURE_TEST_LOG_IMAP env variable

When set will log IMAP commands during feature tests.

This patch also updates Gluon to the latest version.
This commit is contained in:
Leander Beernaert
2022-10-28 15:44:32 +02:00
committed by James Houlahan
parent f1160a11af
commit 29dcd5450f
3 changed files with 15 additions and 5 deletions

View File

@ -22,8 +22,11 @@ import (
"crypto/tls"
"fmt"
"net/http/cookiejar"
"os"
"time"
"github.com/sirupsen/logrus"
"github.com/ProtonMail/proton-bridge/v2/internal/bridge"
"github.com/ProtonMail/proton-bridge/v2/internal/cookies"
"github.com/ProtonMail/proton-bridge/v2/internal/events"
@ -68,6 +71,13 @@ func (t *testCtx) startBridge() error {
return err
}
var logIMAP bool
if len(os.Getenv("FEATURE_TEST_LOG_IMAP")) != 0 {
logrus.SetLevel(logrus.TraceLevel)
logIMAP = true
}
// Create the bridge.
bridge, eventCh, err := bridge.New(
// App stuff
@ -86,8 +96,8 @@ func (t *testCtx) startBridge() error {
t.mocks.ProxyCtl,
// Logging stuff
false,
false,
logIMAP,
logIMAP,
false,
)
if err != nil {