Closed Bug 1179143 Opened 9 years ago Closed 9 years ago

Have a way to detect android_version for marionette-webapi tests

Categories

(Remote Protocol :: Marionette, defect)

defect
Not set
normal

Tracking

(firefox43 fixed)

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: hsinyi, Assigned: jdai)

References

Details

Attachments

(2 files, 2 obsolete files)

As [1], it's useful if there's a way to detect android_version in manifest of marionette-webapi tests

[1] https://dxr.mozilla.org/mozilla-central/source/dom/media/tests/mochitest/mochitest.ini#3
This feels like something it would make sense to return as part of the capabilities when you start a new session.
mochitest [1] and xpcshell [2] supports detecting android_version in manifest, maybe marionette-webapi tests can use the same way (I am not sure).

[1] https://dxr.mozilla.org/mozilla-central/source/testing/mochitest/runtestsremote.py#493-499
[2] https://dxr.mozilla.org/mozilla-central/source/testing/xpcshell/remotexpcshelltests.py#215-218
(In reply to Edgar Chen [:edgar][:echen] from comment #2)
> mochitest [1] and xpcshell [2] supports detecting android_version in
> manifest, maybe marionette-webapi tests can use the same way (I am not sure).

Okay, so you can already sort of do that through calling executeScript with something like `return runEmulatorCmd(["getprop", "ro.build.version.sdk"])` I should think.
It works on my local machine. Due to bug 1188330, I will provide a try link when TC marionette-webapi fixed.
(In reply to John Dai[:johnz][:jdai] from comment #4)
> Created attachment 8653296 [details] [diff] [review]
> Detect android_version for marionette-webapi tests.
> 
> It works on my local machine. Due to bug 1188330, I will provide a try link
> when TC marionette-webapi fixed.

(Y)
Assignee: nobody → jdai
Attachment #8653296 - Attachment description: Detect android_version for marionette-webapi tests. → Part1: Detect android_version for marionette-webapi tests.
Attachment #8653296 - Attachment description: Part1: Detect android_version for marionette-webapi tests. → Part 1: Detect android_version for marionette-webapi tests.
Attachment #8653296 - Flags: review?(ato)
Attachment #8653390 - Attachment description: Update testcase to apply android_version filter. → Part 2: Update testcase to apply android_version filter.
Attachment #8653390 - Flags: review?(echen)
Comment on attachment 8653296 [details] [diff] [review]
Part 1: Detect android_version for marionette-webapi tests.

Review of attachment 8653296 [details] [diff] [review]:
-----------------------------------------------------------------

Looks mostly good to me.  Although please consider using MozReview next time.

::: testing/marionette/client/marionette/runner/base.py
@@ +795,5 @@
> +            # can be conditional on android_version.
> +            androidVersion = dm.shellCheckOutput(['getprop', 'ro.build.version.sdk'])
> +            self.logger.info(
> +                "Android sdk version '%s'; will use this to filter manifests" %
> +                str(androidVersion))

Coercing to string is implicit
Attachment #8653296 - Flags: review?(ato) → review+
Comment on attachment 8653390 [details] [diff] [review]
Part 2: Update testcase to apply android_version filter.

Review of attachment 8653390 [details] [diff] [review]:
-----------------------------------------------------------------

Nice, thank you.
Attachment #8653390 - Flags: review?(echen) → review+
(In reply to Andreas Tolfsen (:ato) from comment #8)
> Comment on attachment 8653296 [details] [diff] [review]
> Part 1: Detect android_version for marionette-webapi tests.
> 
> Review of attachment 8653296 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Looks mostly good to me.  Although please consider using MozReview next time.
> 

Okay, I will, thanks for the review.

> ::: testing/marionette/client/marionette/runner/base.py
> @@ +795,5 @@
> > +            # can be conditional on android_version.
> > +            androidVersion = dm.shellCheckOutput(['getprop', 'ro.build.version.sdk'])
> > +            self.logger.info(
> > +                "Android sdk version '%s'; will use this to filter manifests" %
> > +                str(androidVersion))
> 
> Coercing to string is implicit

Will do.
Attachment #8653390 - Attachment is obsolete: true
Attachment #8658029 - Flags: review+
Keywords: checkin-needed
Blocks: 1203037
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.