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

2
go.mod
View File

@ -5,7 +5,7 @@ go 1.18
require (
github.com/0xAX/notificator v0.0.0-20220220101646-ee9b8921e557
github.com/Masterminds/semver/v3 v3.1.1
github.com/ProtonMail/gluon v0.13.1-0.20221028114835-a78b54c5c915
github.com/ProtonMail/gluon v0.13.1-0.20221028134250-6f1323d05b17
github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a
github.com/ProtonMail/go-rfc5322 v0.11.0
github.com/ProtonMail/gopenpgp/v2 v2.4.10

4
go.sum
View File

@ -28,8 +28,8 @@ github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf h1:yc9daCCYUefEs
github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf/go.mod h1:o0ESU9p83twszAU8LBeJKFAAMX14tISa0yk4Oo5TOqo=
github.com/ProtonMail/docker-credential-helpers v1.1.0 h1:+kvUIpwWcbtP3WFv5sSvkFn/XLzSqPOB5AAthuk9xPk=
github.com/ProtonMail/docker-credential-helpers v1.1.0/go.mod h1:mK0aBveCxhnQ756AmaTfXMZDeULvheYVhF/MWMErN5g=
github.com/ProtonMail/gluon v0.13.1-0.20221028114835-a78b54c5c915 h1:xC1NyMu4DAcJeitcn2xoA8PeMOyX/U140dwyoFLa/u4=
github.com/ProtonMail/gluon v0.13.1-0.20221028114835-a78b54c5c915/go.mod h1:XW/gcr4jErc5bX5yMqkUq3U+AucC2QZHJ5L231k3Nw4=
github.com/ProtonMail/gluon v0.13.1-0.20221028134250-6f1323d05b17 h1:OIHW1fyvfqdk5b4PELItaPE0SVtg+nvA/ebtf893YTM=
github.com/ProtonMail/gluon v0.13.1-0.20221028134250-6f1323d05b17/go.mod h1:XW/gcr4jErc5bX5yMqkUq3U+AucC2QZHJ5L231k3Nw4=
github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a h1:D+aZah+k14Gn6kmL7eKxoo/4Dr/lK3ChBcwce2+SQP4=
github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a/go.mod h1:oTGdE7/DlWIr23G0IKW3OXK9wZ5Hw1GGiaJFccTvZi4=
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo=

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 {