Needs review
Project:
Monitoring
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
29 Aug 2016 at 11:42 UTC
Updated:
21 Sep 2016 at 09:27 UTC
Jump to comment: Most recent, Most recent file
From #2788041: Implement Message-ID and Reference in mail header to build per-sensor thread observation at comment #18, we should test monitoring_mail code/funcionality with a real example checking if the thread is created, mails body contain a proper/clickable link to the sensor, ...
We need some help/hints to test it, if anyone has worked with real mail/"manual sending mail test".
- discuss how to test with real mails
- fix where it's needed
- discuss where to create a test checking the "mail body/content UI" (unit/kernel) ?
- improve IS - Proposed resolution
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | real_test_monitoring_mail-2791619-8.patch | 12.86 KB | tduong |
| #8 | interdiff-2791619-5-8.txt | 5.77 KB | tduong |
| #5 | real_test_monitoring_mail-2791619-5.patch | 18.62 KB | tduong |
| #5 | interdiff-2791619-4-5.txt | 5.43 KB | tduong |
| #4 | mobile_thread.png | 106.31 KB | tduong |
Comments
Comment #2
miro_dietikerFirst, "test real mails" is simply SEND it for real and receive it within gmail and if you like some other mail client.
It simply needs to work and threads should show up in the mail client.
Currently it does not.
So first it's about manual testing. And when you made it work, you can think about automated coverage of the identified rules.
Comment #3
tduong commentedFrom comment #22 in the parent issue:
Discussed with @miro_dietiker this morning and a "nice-to-have feature" is to group the messages in a thread per sensor but change the subject to display the new status and a sensor ID (as a short description/quick preview of the mail), but according to different sources.
Gmail API:
(source: https://developers.google.com/gmail/api/guides/threads)
StackExchange:
(source: http://webapps.stackexchange.com/questions/965/how-does-gmail-decide-to-...)
So it looks like it is not possible to change the subject value but appending the new mail in the same thread :/
Comment #4
tduong commentedTrying to work on top of #2788041: Implement Message-ID and Reference in mail header to build per-sensor thread patch #34.
Moved some changes made there trying to keep the scope, so here we can focus improving the UX and improving our mail test handling Gmail threads (for now).
From the feedback in the other issue at comment #31:
We tried to figure out the easiest way to have a sensor mail "failure/success" visible at "first sight/quick visualisation" and we ended up to show the new sensor status as the sender target's phrase (human comprehensible name), but I've noticed that the "senders column" is slightly different between the browser and mobile inbox UI versions:
Browser:

Mobile:

In addition, I thought to put the "status changed" at the top of the body so that it could be visible as trimmed preview mail text when you see the inbox overview.
I've just seen it had too much space between the "short description" and the "sensor result message text":

but yes, just removing a
$body[] = '';was enough.Comment #5
tduong commentedA bug has been found: a result is/is not logged based on status change, but to send a mail we always checked with the second last sensor result which could be/not be outdated (as we store the current result as the "last sensor result" if the status changes).
Added a setter/getter to set the previous result when we want to log the current one, so we don't get the wrong result and don't need to fancy store the previous status to check if a mail needs to be sent.
Test fails --> waiting for the parent issue to be committed.
Comment #6
tduong commentedBtw, with these new setter/getter methods, I've noticed that mails are sent slightly slower than before...
Comment #7
miro_dietikerDrop this completely as it's now part of $result.
I see in this issue now 3 things mixed:
- Missing hook_requirements check
- Bugfix for the status race condition (are the new tests covering the problem identified?)
- Threading with tests
So, yeah i know annoying, but shouldn't we split those scopes?
Comment #8
tduong commentedRemoved some code to the followups:
- hook_requirements: #2800051: Implement hook_requirements() for monitoring_mail recipient
- bugfix: #2800055: Get the correct previous sensor result
Threading part will be improved here, as well as the test/assert methods.
Comment #9
tduong commentedMiro wants to review and test to define the goals of this issue and how we deal with threading.