From 012be603117ab6777caae2bcb8c78f6929e613be Mon Sep 17 00:00:00 2001 From: James Houlahan Date: Wed, 17 Jun 2020 15:29:32 +0200 Subject: [PATCH] test: remove time checks --- Changelog.md | 27 ++++++++++--------- test/features/smtp/send/bcc.feature | 8 +++--- test/features/smtp/send/html.feature | 16 +++++------ test/features/smtp/send/html_att.feature | 8 +++--- test/features/smtp/send/plain.feature | 28 ++++++++++---------- test/features/smtp/send/plain_att.feature | 12 ++++----- test/features/smtp/send/same_message.feature | 10 +++---- test/store_checks_test.go | 9 ------- 8 files changed, 55 insertions(+), 63 deletions(-) diff --git a/Changelog.md b/Changelog.md index 6782c128..c05617bb 100644 --- a/Changelog.md +++ b/Changelog.md @@ -15,24 +15,25 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/) * GODT-308 Better user error message when request is canceled. * GODT-312 Validate recipient emails in send before asking for their public keys. * GODT-368 Bump docker-credential-helpers version. -* GODT-280 Migrate to gopenpgp v2 - * `Unlock()` call on pmapi-client unlocks both User keys and Address keys - * Salt is available via `AuthSalt()` method +* GODT-280 Migrate to gopenpgp v2: + * `Unlock()` call on pmapi-client unlocks both User keys and Address keys. + * Salt is available via `AuthSalt()` method. +* GODT-394 Don't check SMTP message send time in integration tests. ### Fixed * GODT-356 Fix crash when removing account while mail client is fetching messages (regression from GODT-204). * GODT-390 Don't logout user if AuthRefresh fails because internet was off. -* GODT-358 Bad timeouts with Alternative Routing +* GODT-358 Bad timeouts with Alternative Routing. * GODT-363 Drafts are not deleted when already created on webapp. -* GODT-390 Don't logout user if AuthRefresh fails because internet was off -* GODT-341 Fixed flaky unittest for Store synchronization cooldown -* Crash when failing to match necessary html element -* Crash in message.combineParts when copying nil slice -* Handle double charset better by using local ParseMediaType instead of mime.ParseMediaType -* Don't remove log dir -* GODT-422 Fix element not found (avoid listing credentials, prefer getting) -* GODT-404 Don't keep connections to proxy servers alive if user disables DoH -* Ensure DoH is used at startup to load users for the initial auth +* GODT-390 Don't logout user if AuthRefresh fails because internet was off. +* GODT-341 Fixed flaky unittest for Store synchronization cooldown. +* Crash when failing to match necessary html element. +* Crash in message.combineParts when copying nil slice. +* Handle double charset better by using local ParseMediaType instead of mime.ParseMediaType. +* Don't remove log dir. +* GODT-422 Fix element not found (avoid listing credentials, prefer getting). +* GODT-404 Don't keep connections to proxy servers alive if user disables DoH. +* Ensure DoH is used at startup to load users for the initial auth. ## [v1.2.7] Donghai-hotfix - beta (2020-05-07) diff --git a/test/features/smtp/send/bcc.feature b/test/features/smtp/send/bcc.feature index d06bdd95..ce7348ec 100644 --- a/test/features/smtp/send/bcc.feature +++ b/test/features/smtp/send/bcc.feature @@ -15,8 +15,8 @@ Feature: SMTP with bcc """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | bridgetest@protonmail.com | hello | + | from | to | subject | + | [userAddress] | bridgetest@protonmail.com | hello | And message is sent with API call: """ { @@ -50,8 +50,8 @@ Feature: SMTP with bcc """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | | hello | + | from | to | subject | + | [userAddress] | | hello | And message is sent with API call: """ { diff --git a/test/features/smtp/send/html.feature b/test/features/smtp/send/html.feature index 389b4200..e85fcb77 100644 --- a/test/features/smtp/send/html.feature +++ b/test/features/smtp/send/html.feature @@ -20,8 +20,8 @@ Feature: SMTP sending of HTML messages """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | pm.bridge.qa@gmail.com | HTML text external | + | from | to | subject | + | [userAddress] | pm.bridge.qa@gmail.com | HTML text external | And message is sent with API call: """ { @@ -95,8 +95,8 @@ Feature: SMTP sending of HTML messages """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | pm.bridge.qa@gmail.com | Html Inline External | + | from | to | subject | + | [userAddress] | pm.bridge.qa@gmail.com | Html Inline External | And message is sent with API call: """ { @@ -184,8 +184,8 @@ Feature: SMTP sending of HTML messages """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | bridgetest@protonmail.com | Html Inline Alternative Internal | + | from | to | subject | + | [userAddress] | bridgetest@protonmail.com | Html Inline Alternative Internal | And message is sent with API call: """ { @@ -273,8 +273,8 @@ Feature: SMTP sending of HTML messages """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | pm.bridge.qa@gmail.com | Html Inline Alternative External | + | from | to | subject | + | [userAddress] | pm.bridge.qa@gmail.com | Html Inline Alternative External | And message is sent with API call: """ { diff --git a/test/features/smtp/send/html_att.feature b/test/features/smtp/send/html_att.feature index 1f0de2a5..7111154b 100644 --- a/test/features/smtp/send/html_att.feature +++ b/test/features/smtp/send/html_att.feature @@ -39,8 +39,8 @@ Feature: SMTP sending of HTML messages with attachments """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | bridgetest@protonmail.com | HTML with attachment internal | + | from | to | subject | + | [userAddress] | bridgetest@protonmail.com | HTML with attachment internal | And message is sent with API call: """ { @@ -98,8 +98,8 @@ Feature: SMTP sending of HTML messages with attachments """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | pm.bridge.qa@gmail.com | HTML with attachment external PGP | + | from | to | subject | + | [userAddress] | pm.bridge.qa@gmail.com | HTML with attachment external PGP | And message is sent with API call: """ { diff --git a/test/features/smtp/send/plain.feature b/test/features/smtp/send/plain.feature index 259a3bf3..09f58934 100644 --- a/test/features/smtp/send/plain.feature +++ b/test/features/smtp/send/plain.feature @@ -14,8 +14,8 @@ Feature: SMTP sending of plain messages """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | bridgetest@protonmail.com | | + | from | to | subject | + | [userAddress] | bridgetest@protonmail.com | | And message is sent with API call: """ { @@ -48,8 +48,8 @@ Feature: SMTP sending of plain messages """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | pm.bridge.qa@gmail.com | | + | from | to | subject | + | [userAddress] | pm.bridge.qa@gmail.com | | And message is sent with API call: """ { @@ -85,8 +85,8 @@ Feature: SMTP sending of plain messages """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | bridgetest@protonmail.com | Plain text internal | + | from | to | subject | + | [userAddress] | bridgetest@protonmail.com | Plain text internal | And message is sent with API call: """ { @@ -122,8 +122,8 @@ Feature: SMTP sending of plain messages """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | pm.bridge.qa@gmail.com | Plain text external | + | from | to | subject | + | [userAddress] | pm.bridge.qa@gmail.com | Plain text external | And message is sent with API call: """ { @@ -159,8 +159,8 @@ Feature: SMTP sending of plain messages """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | pm.bridge.qa@gmail.com | Plain text no charset external | + | from | to | subject | + | [userAddress] | pm.bridge.qa@gmail.com | Plain text no charset external | And message is sent with API call: """ { @@ -199,8 +199,8 @@ Feature: SMTP sending of plain messages """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | pm.bridge.qa@gmail.com | Plain text no charset external | + | from | to | subject | + | [userAddress] | pm.bridge.qa@gmail.com | Plain text no charset external | And message is sent with API call: """ { @@ -234,8 +234,8 @@ Feature: SMTP sending of plain messages """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | pm.bridge.qa@gmail.com | Plain, no charset, no content, external | + | from | to | subject | + | [userAddress] | pm.bridge.qa@gmail.com | Plain, no charset, no content, external | And message is sent with API call: """ { diff --git a/test/features/smtp/send/plain_att.feature b/test/features/smtp/send/plain_att.feature index a9093b78..e0c21fda 100644 --- a/test/features/smtp/send/plain_att.feature +++ b/test/features/smtp/send/plain_att.feature @@ -39,8 +39,8 @@ Feature: SMTP sending of plain messages with attachments """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | bridgetest@protonmail.com | Plain with attachment | + | from | to | subject | + | [userAddress] | bridgetest@protonmail.com | Plain with attachment | And message is sent with API call: """ { @@ -98,8 +98,8 @@ Feature: SMTP sending of plain messages with attachments """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | pm.bridge.qa@gmail.com | Plain with attachment external | + | from | to | subject | + | [userAddress] | pm.bridge.qa@gmail.com | Plain with attachment external | And message is sent with API call: """ { @@ -158,8 +158,8 @@ Feature: SMTP sending of plain messages with attachments """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | cc | subject | - | now | [userAddress] | pm.bridge.qa@gmail.com | bridgeqa@seznam.cz | Plain with attachment external PGP and external CC | + | from | to | cc | subject | + | [userAddress] | pm.bridge.qa@gmail.com | bridgeqa@seznam.cz | Plain with attachment external PGP and external CC | And message is sent with API call: """ { diff --git a/test/features/smtp/send/same_message.feature b/test/features/smtp/send/same_message.feature index 031a2995..47f14fb2 100644 --- a/test/features/smtp/send/same_message.feature +++ b/test/features/smtp/send/same_message.feature @@ -25,8 +25,8 @@ Feature: SMTP sending the same message twice """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | bridgetest@protonmail.com | Hello | + | from | to | subject | + | [userAddress] | bridgetest@protonmail.com | Hello | Scenario: Slight change means different message and is sent twice When SMTP client sends message @@ -40,6 +40,6 @@ Feature: SMTP sending the same message twice """ Then SMTP response is "OK" And mailbox "Sent" for "user" has messages - | time | from | to | subject | - | now | [userAddress] | bridgetest@protonmail.com | Hello | - | now | [userAddress] | bridgetest@protonmail.com | Hello. | + | from | to | subject | + | [userAddress] | bridgetest@protonmail.com | Hello | + | [userAddress] | bridgetest@protonmail.com | Hello. | diff --git a/test/store_checks_test.go b/test/store_checks_test.go index dfb4d94d..f90ea344 100644 --- a/test/store_checks_test.go +++ b/test/store_checks_test.go @@ -172,15 +172,6 @@ func messagesContainsMessageRow(account *accounts.TestAccount, allMessages []*pm matches := true for n, cell := range row.Cells { switch head[n].Value { - case "time": - switch cell.Value { - case "now": - if (time.Now().Unix() - message.Time) > 5 { - matches = false - } - default: - return false, fmt.Errorf("unexpected time value: %s", cell.Value) - } case "from": address := ctx.EnsureAddress(account.Username(), cell.Value) if !areAddressesSame(message.Sender.Address, address) {