GODT-2181(test): Linter fixes

This commit is contained in:
James Houlahan
2022-12-13 13:29:58 +01:00
parent 87ce5a6d82
commit 2ca9ca3cb6
6 changed files with 36 additions and 13 deletions

View File

@ -156,8 +156,8 @@ func (t *testCtx) replace(value string) string {
})
// Replace [addr:EMAIL] with a unique address for the email EMAIL.
value = regexp.MustCompile(`\[addr:(\w+)\]`).ReplaceAllStringFunc(value, func(match string) string {
email := regexp.MustCompile(`\[addr:(\w+)\]`).FindStringSubmatch(match)[1]
value = regexp.MustCompile(`\[alias:(\w+)\]`).ReplaceAllStringFunc(value, func(match string) string {
email := regexp.MustCompile(`\[alias:(\w+)\]`).FindStringSubmatch(match)[1]
// Create a new address if it doesn't exist yet.
if _, ok := t.addrUUIDByName[email]; !ok {
@ -176,6 +176,8 @@ func (t *testCtx) replace(value string) string {
}
func (t *testCtx) beforeStep(st *godog.Step) {
logrus.Debugf("Running step: %s", st.Text)
t.callsLock.Lock()
defer t.callsLock.Unlock()
@ -186,6 +188,10 @@ func (t *testCtx) beforeStep(st *godog.Step) {
t.errors = append(t.errors, nil)
}
func (t *testCtx) afterStep(st *godog.Step, status godog.StepResultStatus) {
logrus.Debugf("Finished step (%v): %s", status, st.Text)
}
func (t *testCtx) getName(wantUserID string) string {
for name, userID := range t.userIDByName {
if userID == wantUserID {