Closed
Bug 279150
Opened 20 years ago
Closed 19 years ago
RSS/Atom parsers should have unit tests
Categories
(MailNews Core :: Feed Reader, enhancement)
MailNews Core
Feed Reader
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: sayrer, Assigned: sayrer)
References
Details
Attachments
(8 files, 3 obsolete files)
41.58 KB,
patch
|
Details | Diff | Splinter Review | |
41.58 KB,
patch
|
Details | Diff | Splinter Review | |
17.07 KB,
patch
|
Details | Diff | Splinter Review | |
530 bytes,
patch
|
Details | Diff | Splinter Review | |
1.01 KB,
patch
|
mscott
:
review+
|
Details | Diff | Splinter Review |
5.00 KB,
patch
|
mscott
:
review+
|
Details | Diff | Splinter Review |
4.14 KB,
patch
|
Bienvenu
:
superreview+
|
Details | Diff | Splinter Review |
5.60 KB,
text/plain
|
Details |
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; rv:1.7.3) Gecko/20040913 Firefox/0.10
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; rv:1.7.3) Gecko/20040913 Firefox/0.10
It's my experience that the only way to deal with variations in RSS feeds is to
have a large amount of unit tests. I've asked around a little, and have gotten
donations of a couple huge unit test libraries. Plus, there's the brand new
RSS1.1, which has unit tests in the public domain.
Right now, Feed.js is structured in a way that makes it difficult to test the
parsers. I was thinking that the parsers could be moved out of Feed, and into
their own classes. That way, they could be fed test feeds from xpcshell. Thoughts?
I'm up for doing this.
Reproducible: Always
Steps to Reproduce:
Assignee | ||
Updated•20 years ago
|
Hardware: Macintosh → All
Assignee | ||
Comment 1•20 years ago
|
||
couldn't figure out the CVS incantation to let me add new file w/ anon access.
For use with the following patch.
Attachment #172058 -
Flags: review+
Assignee | ||
Comment 2•20 years ago
|
||
Right now, the parsing code is very tied up with the download code. This patch
makes it possible to unit test the parsers from the command line (I have
hundreds of test files ready to add...).
Attachment #172059 -
Flags: review+
Comment 3•20 years ago
|
||
Comment on attachment 172058 [details]
FeedParser.js -- new file
I think you meant to make these question marks not plusses since your asking
for a review
Attachment #172058 -
Flags: review+ → review?(mscott)
Updated•20 years ago
|
Attachment #172059 -
Flags: review+ → review?(mscott)
Assignee | ||
Comment 4•20 years ago
|
||
(In reply to comment #3)
> (From update of attachment 172058 [details] [edit])
> I think you meant to make these question marks not plusses since your asking
> for a review
>
Oops. Yes, that's what I meant.
Knowing is half the battle. I'm surprised it let me do that...
Comment 5•20 years ago
|
||
robert, did you make this patch from a 1.0 branch or from the mozilla trunk.
That effects what I should do with this change since the parser is slighty
different in the two places.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Target Milestone: --- → Thunderbird1.1
Assignee | ||
Comment 6•20 years ago
|
||
(In reply to comment #5)
> robert, did you make this patch from a 1.0 branch or from the mozilla trunk.
> That effects what I should do with this change since the parser is slighty
> different in the two places.
I made it against the trunk.
Version: unspecified → Trunk
Comment 7•20 years ago
|
||
You might want to take a look at the changes I made to your original patch.
While I was here I did a lot of general cleanup / code re-organization that was
unrelated to what you were trying to do.
You can now create a Feed parser instance by doing something like the
following:
// create a feed parser which will parse the feed for us
var parser = new FeedParser();
this.itemsToStore = parser.parseFeed(this, this.request.responseText,
this.request.responseXML, this.request.channel.URI);
Updated•20 years ago
|
Attachment #172058 -
Attachment is obsolete: true
Attachment #172059 -
Attachment is obsolete: true
Updated•20 years ago
|
Attachment #172059 -
Flags: review?(mscott)
Updated•20 years ago
|
Attachment #172058 -
Flags: review?(mscott)
Comment 8•20 years ago
|
||
I just checked my patch in.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment 9•20 years ago
|
||
Comment 10•20 years ago
|
||
Assignee | ||
Comment 11•20 years ago
|
||
(In reply to comment #7)
>
> You can now create a Feed parser instance by doing something like the
> following...
OK, how would you like the unit tests structured? It would be great if you could point me at some part
of the tree that's structured the way you'd prefer to do this. I saw that /js/ has a unit test approach, but
I'm not sure that's appropriate.
Comment 12•20 years ago
|
||
Assignee | ||
Comment 13•20 years ago
|
||
Did you mean to close this? The parsers don't have unit tests yet :).
Attachment #174168 -
Flags: review?(mscott)
Assignee | ||
Updated•20 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 14•20 years ago
|
||
the trunk is giving every message an id of <undefined> right now.
Assignee | ||
Updated•20 years ago
|
Attachment #174299 -
Flags: review?(mscott)
Updated•20 years ago
|
Attachment #174299 -
Flags: review?(mscott) → review+
Assignee | ||
Comment 15•20 years ago
|
||
http://intertwingly.net/blog/index.atom uses relative references. This patch
makes that work.
Assignee | ||
Updated•20 years ago
|
Attachment #174168 -
Attachment is obsolete: true
Attachment #174311 -
Flags: review?(mscott)
Assignee | ||
Updated•20 years ago
|
Attachment #174168 -
Flags: review?(mscott)
Comment 16•20 years ago
|
||
Comment on attachment 174311 [details] [diff] [review]
Make Atom links use xml:base, change commenting style
i checked this in
Attachment #174311 -
Flags: review?(mscott) → review+
Assignee | ||
Updated•19 years ago
|
Assignee: mscott → sayrer
Status: REOPENED → NEW
Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 17•19 years ago
|
||
Change to '*' on the license block so xpcshell can load the file. sr bienvenu as mscott is on vacation.
Attachment #205566 -
Flags: superreview?(bienvenu)
Assignee | ||
Comment 18•19 years ago
|
||
Got a test harness set up, but XPCShell is acting strange with DOM classes. See bug319968.
Depends on: 319968
Updated•19 years ago
|
Attachment #205566 -
Flags: superreview?(bienvenu) → superreview+
Assignee | ||
Comment 19•19 years ago
|
||
This file is setup code for use with jsDriver.pl, the JS unit testing script. It scans a directory full of XML files that lead with a comment like this:
<!--
Description: dc:date is the date of the entry
Expect: feed.items[0].date = '2005-12-07T14:48:03-05:00'
-->
That way the test code can eval() the Expect: value to see if it's correct, and you don't actually have to write test js files for the parser.
Assignee | ||
Updated•19 years ago
|
Target Milestone: Thunderbird1.1 → Thunderbird2.0
Assignee | ||
Comment 20•19 years ago
|
||
related bug 320967: add tests for content:encoded in all feed formats.
Assignee | ||
Comment 21•19 years ago
|
||
related bug 324179: make sure we don't match elements at the wrong nesting level
Assignee | ||
Comment 22•19 years ago
|
||
the new toolkit feedparser has ~150 unit tests. We should move Thunderbird to that ASAP.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago → 19 years ago
Resolution: --- → WONTFIX
Updated•18 years ago
|
Target Milestone: Thunderbird2.0 → ---
You need to log in
before you can comment on or make changes to this bug.
Description
•