Needs work
Project:
Simplenews
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Dec 2011 at 14:13 UTC
Updated:
18 Oct 2015 at 05:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
berdirOk, the attached patch adds tests for the first and last point of the above list. Incremental improvements is probably the best way forward here.
The "performance test" does send a newsletter to 100 recipients and then calculates the used time. Locally, cached took around 2,5s while non-cached took around 4s. This is with a very simple body, so this is actually the base. It can be assumed that non-cached gets slower and slower, the more complex your body is, while cached stays relatively constant as it need to do the build only once.
I'll upload a second version of the patch, which prints the time as fails to see them on the testbot.
More importantly, the patch fixes a number of bugs:
- The cached source class is wrong in the hook implementation, which leads to a fatal error when trying to send the test. Fixed and confirmed through the tests
- The build:body:$format cache was not written properly, causing it to be re-generated always. Not directly tested, as this is kinda tricky.
Changes:
- Removed the $accounts argument from simplenews_add_node_to_spool(). It wasn't actually used anymore.
- There is now a SimplenewsSourceInterface::getPlainFooter() method and the getBody() and getFooter() methods are supposed to return the correct content based getFormat(). What they actually already did, it just hadn't been called like this nor documented. Fixed and tested.
- That plaintext footer is now also appended to the plaintext version, which is generated if the format is html.
Comment #3
berdirLooks like the test source implementation can't lie in the test file...
Comment #4
berdirJust noticed another bug, the build isn't internally cached. This is bad because it's used like 4 times during a single mail.
Comment #6
berdir- build is now properly cached (only per mail, outside of the cache handling)
- Refactored and fixed plaintext/html handling
- Removed a unused function, left-over from an earlier source implementation (poor kitten)
Comment #7
berdirCommited, back to active for the remaining test cases.
Comment #7.0
berdirUpdated issue summary.
Comment #8
miro_dietikerTagging as test candidate.
Comment #9
berdirComment #10
corvus_ch commentedComment #11
berdirIts enough if we add 3 subscribers, we don't need more.
Incorrect indentation.
You can add a $this->pass('Exception thrown when invalid source implementation is configured').
The comment should probably be updated say what we are actually testing: that the test source was used and not the default one.
Should actually be !$interfaces || ... .
Because if it does not implement any interfaces at all, it is wrong as well.
Comment #12
berdirOh, and the as discussed, a bit of documentation would be nice of the spool and source defgroups.
Comment #12.0
berdirUpdated issue summary.
Comment #14
corvus_ch commented