Closed
Bug 779664
Opened 13 years ago
Closed 13 years ago
moztest needs tests
Categories
(Testing :: Mozbase, defect)
Testing
Mozbase
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: k0scist, Assigned: mihneadb)
References
Details
Attachments
(1 file, 1 obsolete file)
4.64 KB,
patch
|
k0scist
:
review+
|
Details | Diff | Splinter Review |
oh the irony. moztest needs some tests for its results and output
capabilities. A good first round should mostly be tests illustrating
the API and smoke-testing it
Assignee | ||
Updated•13 years ago
|
QA Contact: mbalaur
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → mbalaur
Assignee | ||
Comment 1•13 years ago
|
||
I had to improve some of the code in results.py, thanks to the tests.
Attachment #648570 -
Flags: feedback?(jhammel)
Reporter | ||
Comment 2•13 years ago
|
||
Comment on attachment 648570 [details] [diff] [review]
some first tests + required mods
Its great to see tests! You'll also need to make a manifest for it (see the other tests directories) and add this to the root test-manifest.ini. Other than that, looks good.
+ self.hostname == other.hostname and
+ self.arch == other.arch and
+ self.env == other.env and
+ self.os == other.os and
+ self.os_version == other.os_version
I'd rather see a TestContext class variable, e.g. `keys` with these values and then a comparison e.g
isinstance(other, TestContext) and not [i for i in keys if getattr(self, i) == getattr(other, i)]
This way, one can add keys without having to change in multiple places. I'm not sure how to fix hash exactly, but maybe
attrs = [getattr(self, i) for i in self.keys]
return hash(tuple([(isinstance(i, dict) and tuple(i.items()) or i) for i in attrs]))
Not wonderful, but I'm not sure if there is a standard way to hash standard mutable types in python, though if we need it it can be done
+ self.assertTrue(math.fabs(duration - t.duration) < 1)
Good enough, I guess.
Attachment #648570 -
Flags: feedback?(jhammel) → feedback+
Reporter | ||
Comment 3•13 years ago
|
||
sorry, meant:
not [i for i in keys if getattr(self, i) != getattr(other, i)]
Oh boolean logic!
Assignee | ||
Comment 4•13 years ago
|
||
Attachment #648570 -
Attachment is obsolete: true
Attachment #648790 -
Flags: review?(jhammel)
Reporter | ||
Comment 5•13 years ago
|
||
Comment on attachment 648790 [details] [diff] [review]
fix according to feedback
Looks good to me!
Attachment #648790 -
Flags: review?(jhammel) → review+
Assignee | ||
Comment 6•13 years ago
|
||
https://github.com/mozilla/mozbase/commit/314213e674dce74be27701b8cf4194f36d0ac020
https://github.com/mozilla/mozbase/commit/9c285755cd1ff427029e10a3f3f1f3625832aa73
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•