Closed Bug 875921 Opened 13 years ago Closed 11 years ago

skip_if_b2g is broken on Marionette client

Categories

(Remote Protocol :: Marionette, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1108714

People

(Reporter: mbu, Unassigned)

Details

(Whiteboard: [runner][affects=b2g])

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.160 Safari/537.22 Steps to reproduce: I put the decorator @skip_if_b2g, above of my class declaration. When I launch unit tests from Marionette client, with the option --type=browser Actual results: The test class with the decorator 'skip_if_b2g' is also skipped Expected results: With the option --type=browser, the tests should not be skipped.
Status: UNCONFIRMED → NEW
Ever confirmed: true
For this bug, i think there is a problem of scope for the decorator. When debugging, i realize that the condition to skip the class ( if not hasattr(self.marionette, 'b2g') or not self.marionette.b2g ) could never work because, on the top of a class, we can't get the attribute of marionette object, at this time of the execution. So, i put the function "skip_if_b2g" in runtests.py to get type value and check if type contain b2g value. This is just a proposition, maybe i miss something in the runner for getting the value type option on the top of a test class.
Attachment #756205 - Flags: review?(mdas)
I'm thinking about this one, there might be a better way around it. Also, the way it currently detects if it's a b2g instance or not is not through the CLI, it checks by connecting to marionette and verifies it. We can do that in a class decorator, by instantiating the class, then checking its marionette session, then either returning the instance or throwing an error... but that's in theory.
Yep, i'll thinking of that. The difficulties is the scope when we decorate a class .. I'll try to find a better way. This way (attachment) are not very pretty, but it seems to work..
Comment on attachment 756205 [details] [diff] [review] fix skip_if_b2g decorator on runner Review of attachment 756205 [details] [diff] [review]: ----------------------------------------------------------------- I'm going to punt on this review until the alternative is investigated
Attachment #756205 - Flags: review?(mdas)
Whiteboard: [runner]
Whiteboard: [runner] → [runner][affects=b2g]
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: