Closed Bug 999550 Opened 10 years ago Closed 10 years ago

Remove reliance on "b2g" key from MarionetteTextTestRunner.__init__

Categories

(Remote Protocol :: Marionette, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla31

People

(Reporter: bsilverberg, Assigned: ato)

References

Details

Attachments

(1 file, 1 obsolete file)

The above mentioned method is checking the value of the 'b2g' key in self.capabilities [1], but this is throwing an exception when run against a b2g28 build (which we need to use when testing gaia v1.3). This line should be changed to no longer reference the 'b2g' key. 'platformName' appears to be available, if that is a suitable substitute.

[1]http://hg.mozilla.org/mozilla-central/file/1d0496e30feb/testing/marionette/client/marionette/runner/base.py#l254
Assignee: nobody → ato
Status: NEW → ASSIGNED
Attachment #8410948 - Flags: feedback?(bob.silverberg)
Comment on attachment 8410948 [details] [diff] [review]
0001-Bug-999550-Make-check-for-B2G-backwards-compatible-w.patch

># HG changeset patch
># User Andreas Tolfsen <ato@mozilla.com>
>
>[PATCH] Bug 999550 - Make check for B2G backwards compatible with Gecko 28 branch. r=mdas
>
>---
> testing/marionette/client/marionette/runner/base.py | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
>diff --git a/testing/marionette/client/marionette/runner/base.py b/testing/marionette/client/marionette/runner/base.py
>index e50641a..5b3732d 100644
>--- a/testing/marionette/client/marionette/runner/base.py
>+++ b/testing/marionette/client/marionette/runner/base.py
>@@ -251,7 +251,11 @@ class MarionetteTextTestRunner(unittest.TextTestRunner):
>         self.b2g_pid = None
>         del kwargs['marionette']
> 
>-        if self.capabilities['device'] != 'desktop' and self.capabilities['b2g']:
>+        # Upper-cased platformName replaces platform, but this is kept so that the
>+        # test runner can be used against older branches.
>+        platform = self.capabilities.get(
>+            "platformName", self.capabilities["platform"]).upper()

This doesn't work on b2g28 as platformName exists and its value is 'ANDROID', so platform ends up being 'ANDROID' not 'B2G'

>+        if self.capabilities["device"] != "desktop" and platform == "B2G":
>             def b2g_pre_run():
>                 dm_type = os.environ.get('DM_TRANS', 'adb')
>                 if dm_type == 'adb':
>-- 
>1.8.3.2
>
Attachment #8410948 - Flags: feedback?(bob.silverberg) → feedback-
Blocks: 1000334
Attachment #8410948 - Attachment is obsolete: true
Attachment #8412633 - Flags: review?(bob.silverberg)
Comment on attachment 8412633 [details] [diff] [review]
0001-Bug-999550-Make-check-for-B2G-backwards-compatible-w.patch

This will work on v1.3
Attachment #8412633 - Flags: review?(bob.silverberg) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/27f06ab08454
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.