Closed
Bug 868375
Opened 13 years ago
Closed 13 years ago
Change the assertions.js module so that Assert is the base class instead of Expect
Categories
(Testing Graveyard :: Mozmill, defect)
Testing Graveyard
Mozmill
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: daniela.p98911, Assigned: daniela.p98911)
References
Details
(Whiteboard: [mozmill-2.0][ateamtrack: p=mozmill q=2013q2 m=4])
Attachments
(2 files, 4 obsolete files)
|
3.85 KB,
text/plain
|
Details | |
|
11.68 KB,
patch
|
whimboo
:
review+
|
Details | Diff | Splinter Review |
This is based on bug 791634 comment #6.
The Assert class in assertions.js module has to be the base one so that we can move the code from utils.waitFor to the assertions module. Also, if Assert is the base class, in Expect we will catch the assertions exceptions.
| Assignee | ||
Updated•13 years ago
|
Whiteboard: [mozmill-2.0?]
Comment 1•13 years ago
|
||
As said, we should do this first for our assertion module in mozmill-tests to verify it works as expected.
Updated•13 years ago
|
Whiteboard: [mozmill-2.0?] → [mozmill-2.0?][sprint2013-32]
Updated•13 years ago
|
Assignee: nobody → andreea.matei
Updated•13 years ago
|
Status: NEW → ASSIGNED
Updated•13 years ago
|
Assignee: andreea.matei → nobody
Status: ASSIGNED → NEW
Updated•13 years ago
|
Whiteboard: [mozmill-2.0?][sprint2013-32] → [mozmill-2.0?]
| Assignee | ||
Comment 2•13 years ago
|
||
Reports:
With changes to assert:
Linux:
http://mozmill-crowd.blargon7.com/#/functional/report/f2d3b6136b11cb7b6708636cff6a6e5d
MAC:
http://mozmill-crowd.blargon7.com/#/functional/report/f2d3b6136b11cb7b6708636cff695c9b
Clean no changes at all:
Linux:
http://mozmill-crowd.blargon7.com/#/functional/report/f2d3b6136b11cb7b6708636cff695580
MAC:
http://mozmill-crowd.blargon7.com/#/functional/report/f2d3b6136b11cb7b6708636cff694a1f
Comment 3•13 years ago
|
||
Comment on attachment 763524 [details] [diff] [review]
patch v1.0
Review of attachment 763524 [details] [diff] [review]:
-----------------------------------------------------------------
Looks nearly ok, just a missed line.
::: mozmill/mozmill/extension/resource/modules/assertions.js
@@ -537,5 @@
> -var Assert = function () {}
> -
> -Assert.prototype = new Expect();
> -
> -Assert.prototype.AssertionError = AssertionError;
Where did this line went to? We still need the object attached to the Assert class.
Attachment #763524 -
Flags: review?(hskupin) → review-
| Assignee | ||
Comment 4•13 years ago
|
||
Modified patch based on review.
Reports are:
Linux:
http://mozmill-crowd.blargon7.com/#/functional/report/f2d3b6136b11cb7b6708636cff852289
MAC:
http://mozmill-crowd.blargon7.com/#/functional/report/f2d3b6136b11cb7b6708636cff86831d
Attachment #763524 -
Attachment is obsolete: true
Attachment #764050 -
Flags: review?(hskupin)
Comment 5•13 years ago
|
||
Comment on attachment 764050 [details] [diff] [review]
patch v1.1
Review of attachment 764050 [details] [diff] [review]:
-----------------------------------------------------------------
::: mozmill/mozmill/extension/resource/modules/assertions.js
@@ +571,1 @@
> Assert.prototype.AssertionError = AssertionError;
Please put this directly into the prototype definition of the Assert class. If AssertionError needs to be moved up before any other class, I would even support that for clarity.
Attachment #764050 -
Flags: review?(hskupin) → review-
| Assignee | ||
Comment 6•13 years ago
|
||
Modified patch based on review.
Reports are below. I will also attach the log file with console output for checking the assert.AssertionError works the same now.
Linux:
http://mozmill-crowd.blargon7.com/#/functional/report/f2d3b6136b11cb7b6708636cffdc3eb2
MAC:
http://mozmill-crowd.blargon7.com/#/functional/report/f2d3b6136b11cb7b6708636cffdcde03
Attachment #764050 -
Attachment is obsolete: true
Attachment #764720 -
Flags: review?(hskupin)
| Assignee | ||
Comment 7•13 years ago
|
||
This is a log file where I have dumped assert.AssertionError (before and after the change) and also modified controller/contextmenu.js mutt test to fail to compare if it works the same in both cases
Comment 8•13 years ago
|
||
(In reply to Daniela Petrovici from comment #7)
> This is a log file where I have dumped assert.AssertionError (before and
> after the change) and also modified controller/contextmenu.js mutt test to
> fail to compare if it works the same in both cases
This is not what you want to test. What you really want is to catch such an exception and check that it's of type assert.AssertionError.
| Assignee | ||
Comment 9•13 years ago
|
||
Comment on attachment 764720 [details] [diff] [review]
patch v1.2
Testing now based on the previous comment
Attachment #764720 -
Flags: review?(hskupin)
| Assignee | ||
Comment 10•13 years ago
|
||
(In reply to Henrik Skupin (:whimboo) from comment #8)
> This is not what you want to test. What you really want is to catch such an
> exception and check that it's of type assert.AssertionError.
I used try-catch and caught an error from assert.equal and dumped ex instanceof assert.AssertionError. It shows true.
I also tried dumping the constructor.name for the exception and this change did not affect anything.
Also, the mutt tests are still working properly, including the mutt test for assertions
Attachment #764720 -
Attachment is obsolete: true
Attachment #764737 -
Flags: review?(hskupin)
Comment 11•13 years ago
|
||
Comment on attachment 764737 [details] [diff] [review]
patch v1.3
Review of attachment 764737 [details] [diff] [review]:
-----------------------------------------------------------------
One last thing to do, then we should be good in getting this landed.
::: mozmill/mozmill/extension/resource/modules/assertions.js
@@ +251,5 @@
>
> /**
> + * Error object thrown by the Assert class
> + */
> + AssertionError: AssertionError,
This is an attribute on the prototype, so it should be located before any getters, setter, and methods.
Attachment #764737 -
Flags: review?(hskupin) → review-
| Assignee | ||
Comment 12•13 years ago
|
||
Modified patch based on review
Attachment #764737 -
Attachment is obsolete: true
Attachment #765855 -
Flags: review?(hskupin)
Updated•13 years ago
|
Attachment #765855 -
Flags: review?(hskupin) → review+
Comment 13•13 years ago
|
||
Landed on master:
https://github.com/mozilla/mozmill/commit/df77fa4b82c54340777fe55bd5bac90b06f85f86
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [mozmill-2.0?] → [mozmill-2.0][ateamtrack: p=mozmill q=2013q2 m=4]
Updated•10 years ago
|
Product: Testing → Testing Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•