GODT-1474: Optimising live integration tests

- pkg/pmapi: Reduce max number of retries
- test/features: tweak create mailbox scenarios.
- test/context: change order of clean up steps
- test/context: logger field
- test/context: message preparation per username
- test/context: check that eventID has changed after adding messages
- test/features: make sure we wait 15sec before detecting import duplicates
This commit is contained in:
Jakub
2022-01-04 08:17:54 +01:00
parent d356f306d9
commit 22f427d522
13 changed files with 138 additions and 46 deletions

View File

@ -107,9 +107,12 @@ func New() *TestContext {
smtpLastResponses: make(map[string]*mocks.SMTPResponse),
smtpResponseLocker: &sync.Mutex{},
bddMessageIDsToAPIIDs: make(map[string]string),
logger: logrus.StandardLogger(),
logger: logrus.StandardLogger().WithField("ctx", "scenario"),
}
ctx.logger.Info("New context")
ctx.addCleanup(func() { ctx.logger.Info("Context end") }, "End of context")
// Ensure that the config is cleaned up after the test is over.
ctx.addCleanupChecked(ctx.locations.Clear, "Cleaning bridge config data")
@ -163,5 +166,9 @@ func (ctx *TestContext) GetLastError() error {
return ctx.lastError
}
func (ctx *TestContext) MessagePreparationStarted() { ctx.pmapiController.LockEvents() }
func (ctx *TestContext) MessagePreparationFinished() { ctx.pmapiController.UnlockEvents() }
func (ctx *TestContext) MessagePreparationStarted(username string) {
ctx.pmapiController.LockEvents(username)
}
func (ctx *TestContext) MessagePreparationFinished(username string) {
ctx.pmapiController.UnlockEvents(username)
}