Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Issue 27622005: Set is_test_apk=1 for content_browsertests_apk. (Closed)

Created:
7 years, 2 months ago by kjellander_chromium
Modified:
7 years, 1 month ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam
Visibility:
Public.

Description

Set is_test_apk=1 for content_browsertests_apk. Without this set, you won't get the android_tools target built when building only content_browsertests_apk, which is needed in order to run the test on a device. In WebRTC, I'm adding buildbots using that target for building and running content_browsertests in https://codereview.chromium.org/26738003/ I would like to avoid having to specify a separate target in android_all.gyp just to get this build running, and I think all targets should build their necessary dependencies. TEST=local building of content_browsertests_apk + verifying the host_forwarder was built. BUG=305749 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=229632

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -0 lines) Patch
M content/content_tests.gypi View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
kjellander_chromium
Hi, would this be OK to add?
7 years, 2 months ago (2013-10-17 12:26:53 UTC) #1
jochen (gone - plz use gerrit)
lgtm, but please wait for somebody from the android team to double check (maybe bulach ...
7 years, 2 months ago (2013-10-17 22:39:06 UTC) #2
kjellander_chromium
On 2013/10/17 22:39:06, jochen wrote: > lgtm, but please wait for somebody from the android ...
7 years, 2 months ago (2013-10-18 08:46:07 UTC) #3
bulach
lgtm, thanks! just make sure the trybots and FYI bots will be happy, hopefully there ...
7 years, 2 months ago (2013-10-18 09:04:52 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kjellander@chromium.org/27622005/1
7 years, 2 months ago (2013-10-18 19:01:35 UTC) #5
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 2 months ago (2013-10-18 20:23:40 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kjellander@chromium.org/27622005/1
7 years, 2 months ago (2013-10-19 19:17:58 UTC) #7
commit-bot: I haz the power
Change committed as 229632
7 years, 2 months ago (2013-10-19 22:35:20 UTC) #8
wjia(left Chromium)
This CL needs to be reverted since it has caused content_browsertests to fail to run ...
7 years, 2 months ago (2013-10-24 00:38:13 UTC) #9
bulach
hmm... the build 2410 had the same error: http://build.chromium.org/p/tryserver.chromium/builders/android_fyi_dbg_triggered_tests/builds/2410/steps/content_browsertests/logs/stdio it ran Fri Oct 18 15:50:58 ...
7 years, 2 months ago (2013-10-24 12:23:20 UTC) #10
wjia(left Chromium)
Marcus, As you can see from your try job http://build.chromium.org/p/tryserver.chromium/builders/android_fyi_dbg_triggered_tests/builds/2426/steps/content_browsertests/logs/stdio, content_browsertests are running now. But ...
7 years, 2 months ago (2013-10-24 16:39:42 UTC) #11
bulach
there are only 6 references to "is_test_apk" in the codebase: https://code.google.com/p/chromium/codesearch#search/&q=is_test_apk&sq=package:chromium&type=cs I find it hard ...
7 years, 2 months ago (2013-10-24 17:16:36 UTC) #12
wjia(left Chromium)
Please see comment #4: https://codereview.chromium.org/38753003/#msg4 By your try job, I mean build 2426 ( http://build.chromium.org/p/tryserver.chromium/builders/android_fyi_dbg_triggered_tests/builds/2426 ...
7 years, 2 months ago (2013-10-24 17:25:02 UTC) #13
bulach
On 2013/10/24 17:25:02, wjia wrote: > Please see comment #4: https://codereview.chromium.org/38753003/#msg4 > > By your ...
7 years, 2 months ago (2013-10-24 17:40:27 UTC) #14
wjia(left Chromium)
On Thu, Oct 24, 2013 at 10:40 AM, <bulach@chromium.org> wrote: > On 2013/10/24 17:25:02, wjia ...
7 years, 2 months ago (2013-10-24 17:51:44 UTC) #15
frankf
AFAIK, is_test_apk is only used for instrumentation test apks. Comment in java_apk.gyp: is_test_apk - Set ...
7 years, 2 months ago (2013-10-24 18:14:52 UTC) #16
cjhopman
On 2013/10/24 18:14:52, frankf wrote: > AFAIK, is_test_apk is only used for instrumentation test apks. ...
7 years, 2 months ago (2013-10-24 18:41:44 UTC) #17
frankf
On 2013/10/24 18:41:44, cjhopman wrote: > On 2013/10/24 18:14:52, frankf wrote: > > AFAIK, is_test_apk ...
7 years, 2 months ago (2013-10-24 18:53:59 UTC) #18
kjellander_chromium
7 years, 1 month ago (2013-10-25 13:35:54 UTC) #19
Message was sent while issue was closed.
On 2013/10/24 18:53:59, frankf wrote:
> On 2013/10/24 18:41:44, cjhopman wrote:
> > On 2013/10/24 18:14:52, frankf wrote:
> > > AFAIK, is_test_apk is only used for instrumentation test apks. Comment in
> > > java_apk.gyp:
> > > 
> > > is_test_apk - Set to 1 if building a test apk.  This prevents resources
from
> > > dependencies from being re-included.
> > > 
> > > You're using for another purpose though.
> > > 
> > > +cjhopman to verify.
> > 
> > Yes, I think setting is_test_apk has other side effects that you don't want.
> > 
> > While I agree that targets should list (at least) their actual dependencies,
> > it's not actually the case that content_browsertests_apk depends on
> > android_tools. You can build the apk, install it, and send intents to it to
> run
> > tests all without building android_tools. It is actually the user-friendly,
> > test-running scripts that require android_tools. That being said, I had
added
> > the dependency on android_tools for instrumentation tests because I was
> annoyed
> > when I would build a test and then not be able to run it.
> > 
> > If setting is_test_apk is broken for non-instrumentation tests, there are a
> > couple of other options:
> > 
> > 1. Add a new variable to condition the android_tools dependency
> > 2. Add the android_tools dependency directly to the target (and not via the
> > .gypi)
> > 3. Unconditionally depend on android_tools for all APKs
> > 4. Explicitly build android_tools
> > 
> > I don't like (1). (4) is the current state, and it annoys me. I would
probably
> > just say do (3). These targets change so infrequently and are so small that
> > building them when they aren't actually needed (i.e. when you don't want to
> run
> > tests) is not really a big cost (and I think it's a smaller cost than adding
> > more complexity to java_apk.gypi).
> > 
> > As for the test failures, I really, really don't think this could have
caused
> > "Exception: No device available to get the list of tests.", though it's
> possible
> > that it would cause crashes when running the tests.
> 
> Actually, that exception is misleading. It seems flipping that switch is
causing
> crashes related to emma coverage:
> 
> 1800D:  10-23 23:55:58.898   219   456 I ActivityManager: Start proc
> org.chromium.content_browsertests_apk for activity
> org.chromium.content_browsertests_apk/.ContentBrowserTestsActivity: pid=21500
> uid=10068 gids={1006, 3003, 1015}
> 1800D:  10-23 23:55:58.921 21500 21500 I dalvikvm: Could not find method
> com.vladium.emma.rt.RT.r, referenced from method
> org.chromium.content_browsertests_apk.ContentBrowserTestsApplication.$VRi
> 1800D:  10-23 23:55:58.921 21500 21500 W dalvikvm: VFY: unable to resolve
static
> method 1958: Lcom/vladium/emma/rt/RT;.r ([[ZLjava/lang/String;J)V
> 1800D:  10-23 23:55:58.921 21500 21500 D dalvikvm: VFY: replacing opcode 0x71
at
> 0x002b
> 1800D:  10-23 23:55:58.921 21500 21500 W dalvikvm: Exception
> Ljava/lang/NoClassDefFoundError; thrown while initializing
> Lorg/chromium/content_browsertests_apk/ContentBrowserTestsApplication;
> 1800D:  10-23 23:55:58.921 21500 21500 W dalvikvm: Class init failed in
> newInstance call
> (Lorg/chromium/content_browsertests_apk/ContentBrowserTestsApplication;)
> 1800D:  10-23 23:55:58.921 21500 21500 D AndroidRuntime: Shutting down VM
> 1800D:  10-23 23:55:58.921 21500 21500 W dalvikvm: threadid=1: thread exiting
> with uncaught exception (group=0x40a631f8)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: FATAL EXCEPTION: main
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime:
> java.lang.ExceptionInInitializerError
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	at
> java.lang.Class.newInstanceImpl(Native Method)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	at
> java.lang.Class.newInstance(Class.java:1319)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	at
> android.app.Instrumentation.newApplication(Instrumentation.java:957)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	at
> android.app.Instrumentation.newApplication(Instrumentation.java:942)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	at
> android.app.LoadedApk.makeApplication(LoadedApk.java:477)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	at
> android.app.ActivityThread.handleBindApplication(ActivityThread.java:3938)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	at
> android.app.ActivityThread.access$1300(ActivityThread.java:123)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1185)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	at
> android.os.Looper.loop(Looper.java:137)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	at
> android.app.ActivityThread.main(ActivityThread.java:4424)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	at
> java.lang.reflect.Method.invokeNative(Native Method)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	at
> java.lang.reflect.Method.invoke(Method.java:511)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	at
>
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	at
> dalvik.system.NativeStart.main(Native Method)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: Caused by:
> java.lang.NoClassDefFoundError: com.vladium.emma.rt.RT
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	at
>
org.chromium.content_browsertests_apk.ContentBrowserTestsApplication.$VRi(ContentBrowserTestsApplication.java)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	at
>
org.chromium.content_browsertests_apk.ContentBrowserTestsApplication.<clinit>(ContentBrowserTestsApplication.java)
> 1800D:  10-23 23:55:58.921 21500 21500 E AndroidRuntime: 	... 16 more
> 1800D:  10-23 23:55:58.929   219   219 W ActivityManager:   Force finishing
> activity org.chromium.content_browsertests_apk/.ContentBrowserTestsActivity

Thanks all for putting in so much time into debugging this issue. 
I suggest we leave this reverted and add another helper build target instead to
use: https://codereview.chromium.org/43463004/
I'll leave it to you guys to sort out if further actions are desired to improve
the exceptions and/or clarify the effects of the is_test_apk variable, as I
don't think I can contribute so much to those efforts.

Powered by Google App Engine
This is Rietveld 408576698