Closed
Bug 758392
Opened 13 years ago
Closed 13 years ago
Enforce test type in Robotium tests
Categories
(Testing :: Mochitest, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla16
People
(Reporter: bnicholson, Assigned: bnicholson)
References
Details
Attachments
(1 file, 1 obsolete file)
|
33.43 KB,
patch
|
gbrown
:
review+
|
Details | Diff | Splinter Review |
Currently, every test is required to call setTestType() to initialize the asserter. This is error-prone if someone (like me) forgets to add this call to their test class. We can enforce this by making an abstract method that all test cases must implement.
Attachment #626974 -
Flags: review?(gbrown)
| Assignee | ||
Updated•13 years ago
|
Component: General → Mochitest
Product: Fennec Native → Testing
QA Contact: general → mochitest
Comment 1•13 years ago
|
||
Comment on attachment 626974 [details] [diff] [review]
Create abstract getTestType() method in BaseTest
Review of attachment 626974 [details] [diff] [review]:
-----------------------------------------------------------------
Looks fine. I think it's a good idea.
jmaher -- any concerns?
Attachment #626974 -
Flags: review?(gbrown)
Attachment #626974 -
Flags: review+
Attachment #626974 -
Flags: feedback?(jmaher)
Comment 2•13 years ago
|
||
Comment on attachment 626974 [details] [diff] [review]
Create abstract getTestType() method in BaseTest
Review of attachment 626974 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks. Wasn't thinking too much when I created the talos|mochitest types originally, this is much cleaner.
Attachment #626974 -
Flags: feedback?(jmaher) → feedback+
| Assignee | ||
Comment 3•13 years ago
|
||
Comment 4•13 years ago
|
||
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/b7ad724a8f7e - took me a long time and 10 retriggers to decide it had, but it broke roboprovider.
Comment 5•13 years ago
|
||
I'm not sure what went wrong exactly, but here's a thought: testBrowerProviderPerf is *not* derived from BaseTest, so I think getTestType() will never be called...and that ought to break something. There may be other tests that don't derive from BaseTest - worth checking.
| Assignee | ||
Comment 6•13 years ago
|
||
(In reply to Geoff Brown [:gbrown] from comment #5)
> I'm not sure what went wrong exactly, but here's a thought:
> testBrowerProviderPerf is *not* derived from BaseTest, so I think
> getTestType() will never be called...and that ought to break something.
> There may be other tests that don't derive from BaseTest - worth checking.
The patch also makes the same changes to ContentProviderTest.java.in, which testBrowserProviderPerf does inherit from. I pushed to try without the content provider tests (https://tbpl.mozilla.org/?tree=Try&rev=1c59b35b7d71), and it passed...so there's definitely something wrong, but it's not clear what.
Here's the part I removed to make it pass try: http://pastebin.mozilla.org/1652147
Comment 7•13 years ago
|
||
I updated the original patch for bitrot and debugged. I found the problem with ContentProviderTest: its base class, AndroidTestCase, contains testAndroidTestCaseSetUpProperly which causes a 2nd call to setUp / tearDown. The second setUp calls setLogFile a second time, which deletes the old log file, clobbering test results. Solution: guard the mAsserter code to ensure it is only called once.
Attachment #626974 -
Attachment is obsolete: true
Attachment #635932 -
Flags: review+
Comment 8•13 years ago
|
||
Try run pending: https://tbpl.mozilla.org/?tree=Try&rev=9f42d540f794
| Assignee | ||
Comment 9•13 years ago
|
||
ContentProviderTest extends BaseTest after bug 750753, so that makes things easier. I removed the parts specific to ContentProviderTest.
Try results here: https://tbpl.mozilla.org/?tree=Try&rev=8ac722481c91
http://hg.mozilla.org/integration/mozilla-inbound/rev/829b0fa41e2e
Comment 10•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
You need to log in
before you can comment on or make changes to this bug.
Description
•