New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 627916 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Make android support test runner work

Project Member Reported by aluo@chromium.org, Jul 13 2016

Issue description

Ran into problems while trying to use the android Junit test runner, where the art couldn't load android.support.test.runner.AndroidJUnitRunner class.  Needed to do following to fix it:

1) update the runner version to 0.5
2) include the exposed-instrumentation-api-publish jar
3) include the junit jar


 
Oh, sorry, this CL is https://codereview.chromium.org/2146713003 is supposed to add the test runner
What exactly are you trying to do?

Note that we already have junit: https://chromium.googlesource.com/external/junit/
which gets DEPSed into chromium: https://codesearch.chromium.org/chromium/src/DEPS?rcl=0&l=453

Comment 3 by aluo@chromium.org, Jul 13 2016

re comment 2: This bug is to make the runner work in Android instrumentation tests use the AndroidJUnitRunner class.  Ran into some issues with using third_party/junit version, that one is pulling in it's own hamcrest version which won't work with espresso tests which uses hamcrest at third_party/hamcrest.  I could update it to use latest version of junit but it will probably break other stuff that depends on the current version.
copied from the CL reply:

Hmm, the reason we don't use AJunitRunner is because we have stuff needed to inherit from BaseInstrumentationTestRunner (e.g. things to work with annotations like @DisableIf)
So I am adding this modified InstrumentationTestRunner (https://codereview.chromium.org/2146713003) to support keeping track of Activity life cycler for Espresso tests

Comment 5 by aluo@chromium.org, Jul 13 2016

re comment 1: I see that this cl added the AndroidJunitRunner: https://codereview.chromium.org/2042533002

I was just going to use that one since it supports espresso tests, so opened this bug to make it actually work on Android.
ya, that's my bad, that CL added the entire package for InstrumentationRegistry, ActivityLifecycleMonitorImpl, ApplicationLifecycleMonitorImpl, ActivityLifecycleMonitorRegistry, ApplicationLifecycleMonitorRegistry, ApplicationStage, and Stage.java
 
AndroidJunitRunner is included but not used, I should figure a way around it (Added CL for a TODO: https://codereview.chromium.org/2147713003)
Project Member

Comment 7 by bugdroid1@chromium.org, Aug 24 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/24da3c36fd807a0003bece9c352567ad637f810e

commit 24da3c36fd807a0003bece9c352567ad637f810e
Author: aluo <aluo@chromium.org>
Date: Wed Aug 24 21:28:23 2016

Add required deps to third_party/android_support_test_runner

BUG= 627916 

Review-Url: https://codereview.chromium.org/2142413004
Cr-Commit-Position: refs/heads/master@{#414150}

[modify] https://crrev.com/24da3c36fd807a0003bece9c352567ad637f810e/build/android/gyp/javac.py
[modify] https://crrev.com/24da3c36fd807a0003bece9c352567ad637f810e/build/config/android/internal_rules.gni
[modify] https://crrev.com/24da3c36fd807a0003bece9c352567ad637f810e/third_party/android_support_test_runner/BUILD.gn
[modify] https://crrev.com/24da3c36fd807a0003bece9c352567ad637f810e/third_party/android_support_test_runner/README.chromium
[add] https://crrev.com/24da3c36fd807a0003bece9c352567ad637f810e/third_party/android_support_test_runner/lib/exposed-instrumentation-api-publish-0.5-no-dep.jar.sha1
[delete] https://crrev.com/090b6f3b15c5b11a304db2c7d61f9ff8672a8f1d/third_party/android_support_test_runner/lib/runner-0.3-release-no-dep.jar.sha1
[add] https://crrev.com/24da3c36fd807a0003bece9c352567ad637f810e/third_party/android_support_test_runner/lib/runner-0.5-release-no-dep.jar.sha1
[modify] https://crrev.com/24da3c36fd807a0003bece9c352567ad637f810e/third_party/espresso/BUILD.gn
[modify] https://crrev.com/24da3c36fd807a0003bece9c352567ad637f810e/third_party/guava/BUILD.gn
[modify] https://crrev.com/24da3c36fd807a0003bece9c352567ad637f810e/third_party/hamcrest/BUILD.gn
[modify] https://crrev.com/24da3c36fd807a0003bece9c352567ad637f810e/third_party/junit/BUILD.gn

Comment 8 by aluo@chromium.org, Sep 13 2016

Status: Fixed (was: Untriaged)

Sign in to add a comment