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

Issue 20210002: [Android] Sets up a coverage system for java using EMMA (Closed)

Created:
7 years, 5 months ago by gkanwar1
Modified:
7 years, 4 months ago
CC:
chromium-reviews, craigdh+watch_chromium.org, bulach+watch_chromium.org, yfriedman+watch_chromium.org, ilevy-cc_chromium.org, klundberg+watch_chromium.org, frankf+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Sets up a coverage system for java using EMMA This includes: * Adds emma instrumentation to classes in java and APK build targets. * Adds --coverage_dir flags to instrumentation tests. * Creates a script to take in coverage and metadata directories to produce HTML output. * Changes fyi dbg buildbot configs to build and run tests with coverage enabled. To build with emma coverage, add 'emma_coverage=1' to the GYP_DEFINES environment variable. BUG=255644

Patch Set 1 : #

Total comments: 10

Patch Set 2 : Removes unnecessary option, cleans up some string formatting #

Total comments: 18

Patch Set 3 : Gets code coverage for non-apk java working #

Total comments: 18

Patch Set 4 : Fixes dex/obfuscate actions slightly #

Total comments: 30

Patch Set 5 : Fixes instr.py issues, adds uploading to GS (except for bucket names) #

Total comments: 2

Patch Set 6 : Fixes rmtree call on first build #

Patch Set 7 : Break apart native and java coverage flags for gyp #

Total comments: 20

Patch Set 8 : TEMP: Fixes several issues, adds some debugging statements #

Total comments: 6

Patch Set 9 : Fixes gsutil upload #

Total comments: 9

Patch Set 10 : Cleans up temporary changes, fixes a few more small things #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+646 lines, -99 lines) Patch
M android_webview/android_webview.gyp View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M android_webview/test/shell/AndroidManifest.xml View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M build/android/ant/apk-package.xml View 1 2 3 4 5 2 chunks +40 lines, -14 lines 0 comments Download
M build/android/buildbot/bb_device_steps.py View 1 2 3 4 5 6 7 8 9 7 chunks +57 lines, -7 lines 0 comments Download
M build/android/buildbot/bb_run_bot.py View 1 2 3 4 5 6 7 8 9 4 chunks +10 lines, -4 lines 0 comments Download
M build/android/dex_action.gypi View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
A build/android/generate_emma_html.py View 1 2 3 4 5 6 7 1 chunk +81 lines, -0 lines 0 comments Download
M build/android/gyp/ant.py View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M build/android/gyp/dex.py View 1 2 3 4 5 6 7 8 9 5 chunks +12 lines, -10 lines 0 comments Download
A build/android/gyp/emma_instr.py View 1 2 3 4 5 6 7 1 chunk +185 lines, -0 lines 0 comments Download
A build/android/instr_action.gypi View 1 2 3 4 5 6 7 1 chunk +50 lines, -0 lines 0 comments Download
M build/android/pylib/constants.py View 1 2 3 4 5 6 7 2 chunks +6 lines, -1 line 0 comments Download
M build/android/pylib/instrumentation/test_options.py View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M build/android/pylib/instrumentation/test_runner.py View 1 2 3 4 5 6 7 6 chunks +25 lines, -5 lines 0 comments Download
A build/android/pylib/utils/command_option_parser.py View 1 2 3 4 5 6 7 1 chunk +76 lines, -0 lines 0 comments Download
M build/android/test_runner.py View 1 2 3 4 5 6 7 4 chunks +8 lines, -40 lines 0 comments Download
M build/common.gypi View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -1 line 0 comments Download
M build/java.gypi View 1 2 3 4 5 6 7 5 chunks +42 lines, -8 lines 0 comments Download
M build/java_apk.gypi View 1 2 3 4 5 6 7 6 chunks +31 lines, -5 lines 0 comments Download
M chrome/android/testshell/java/AndroidManifest.xml View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome.gyp View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M content/content.gyp View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M content/content_shell.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M content/public/android/javatests/src/org/chromium/content/common/CleanupReferenceTest.java View 1 2 3 4 5 6 7 8 9 3 chunks +5 lines, -2 lines 3 comments Download
M sync/sync_android.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M ui/ui.gyp View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
gkanwar1
ptal
7 years, 5 months ago (2013-07-25 01:19:54 UTC) #1
frankf
Adding Chris for gyp changes https://codereview.chromium.org/20210002/diff/4001/build/android/pylib/instrumentation/test_runner.py File build/android/pylib/instrumentation/test_runner.py (right): https://codereview.chromium.org/20210002/diff/4001/build/android/pylib/instrumentation/test_runner.py#newcode135 build/android/pylib/instrumentation/test_runner.py:135: def _GetInstrumentationArgs(self, test): where ...
7 years, 5 months ago (2013-07-25 18:53:43 UTC) #2
gkanwar1
Made some fixes, ptal. https://codereview.chromium.org/20210002/diff/4001/build/android/pylib/instrumentation/test_runner.py File build/android/pylib/instrumentation/test_runner.py (right): https://codereview.chromium.org/20210002/diff/4001/build/android/pylib/instrumentation/test_runner.py#newcode135 build/android/pylib/instrumentation/test_runner.py:135: def _GetInstrumentationArgs(self, test): On 2013/07/25 ...
7 years, 5 months ago (2013-07-25 19:06:38 UTC) #3
frankf
https://codereview.chromium.org/20210002/diff/11001/build/android/emma_html_output.py File build/android/emma_html_output.py (right): https://codereview.chromium.org/20210002/diff/11001/build/android/emma_html_output.py#newcode1 build/android/emma_html_output.py:1: #! /usr/bin/env python Rename this to generate_emma_html.py https://codereview.chromium.org/20210002/diff/11001/build/android/emma_html_output.py#newcode46 build/android/emma_html_output.py:46: ...
7 years, 5 months ago (2013-07-25 20:28:19 UTC) #4
gkanwar1
On 2013/07/25 20:28:19, frankf wrote: > https://codereview.chromium.org/20210002/diff/11001/build/android/emma_html_output.py > File build/android/emma_html_output.py (right): > > https://codereview.chromium.org/20210002/diff/11001/build/android/emma_html_output.py#newcode1 > ...
7 years, 5 months ago (2013-07-25 20:33:23 UTC) #5
gkanwar1
Made several changes: * Non-apk java for ContentShell is now covered. Test java is not. ...
7 years, 4 months ago (2013-08-01 02:14:35 UTC) #6
frankf
If it's not expensive, let's just build separate instrumented apks, and enable instrumentation all the ...
7 years, 4 months ago (2013-08-01 19:57:41 UTC) #7
gkanwar1
cjhopman -- I made the changes you recommended (linearizing the actinons, and converting the ant ...
7 years, 4 months ago (2013-08-07 19:24:56 UTC) #8
cjhopman
https://codereview.chromium.org/20210002/diff/40001/build/android/ant/apk-package.xml File build/android/ant/apk-package.xml (right): https://codereview.chromium.org/20210002/diff/40001/build/android/ant/apk-package.xml#newcode89 build/android/ant/apk-package.xml:89: <package-helper> Nit: replace tabs with spaces https://codereview.chromium.org/20210002/diff/40001/build/android/ant/apk-package.xml#newcode91 build/android/ant/apk-package.xml:91: <jarfile ...
7 years, 4 months ago (2013-08-09 18:54:37 UTC) #9
gkanwar1
https://codereview.chromium.org/20210002/diff/40001/build/android/ant/apk-package.xml File build/android/ant/apk-package.xml (right): https://codereview.chromium.org/20210002/diff/40001/build/android/ant/apk-package.xml#newcode89 build/android/ant/apk-package.xml:89: <package-helper> On 2013/08/09 18:54:37, cjhopman wrote: > Nit: replace ...
7 years, 4 months ago (2013-08-09 23:32:53 UTC) #10
cjhopman
https://codereview.chromium.org/20210002/diff/40001/build/android/ant/apk-package.xml File build/android/ant/apk-package.xml (right): https://codereview.chromium.org/20210002/diff/40001/build/android/ant/apk-package.xml#newcode91 build/android/ant/apk-package.xml:91: <jarfile path="${sdk.dir}/tools/lib/emma_device.jar" /> On 2013/08/09 23:32:53, gkanwar1 wrote: > ...
7 years, 4 months ago (2013-08-10 00:11:47 UTC) #11
gkanwar1
This also adds the newly created buckets. I will try testing this by temporary changing ...
7 years, 4 months ago (2013-08-12 18:19:10 UTC) #12
gkanwar1
On 2013/08/12 18:19:10, gkanwar1 wrote: > This also adds the newly created buckets. I will ...
7 years, 4 months ago (2013-08-12 18:23:20 UTC) #13
frankf
https://codereview.chromium.org/20210002/diff/91001/build/android/buildbot/bb_device_steps.py File build/android/buildbot/bb_device_steps.py (right): https://codereview.chromium.org/20210002/diff/91001/build/android/buildbot/bb_device_steps.py#newcode30 build/android/buildbot/bb_device_steps.py:30: COVERAGE_DIR = os.path.join(CHROME_SRC, 'out', 'coverage') Move this to constants.py ...
7 years, 4 months ago (2013-08-13 23:33:38 UTC) #14
gkanwar1
Fixed several things, ptal. https://codereview.chromium.org/20210002/diff/91001/build/android/buildbot/bb_device_steps.py File build/android/buildbot/bb_device_steps.py (right): https://codereview.chromium.org/20210002/diff/91001/build/android/buildbot/bb_device_steps.py#newcode30 build/android/buildbot/bb_device_steps.py:30: COVERAGE_DIR = os.path.join(CHROME_SRC, 'out', 'coverage') ...
7 years, 4 months ago (2013-08-15 19:49:20 UTC) #15
gkanwar1
Adding Marcus for review on the buildbot changes.
7 years, 4 months ago (2013-08-15 19:50:19 UTC) #16
gkanwar1
On 2013/08/15 19:50:19, gkanwar1 wrote: > Adding Marcus for review on the buildbot changes. Looks ...
7 years, 4 months ago (2013-08-15 21:38:12 UTC) #17
cjhopman
https://codereview.chromium.org/20210002/diff/170001/android_webview/android_webview.gyp File android_webview/android_webview.gyp (right): https://codereview.chromium.org/20210002/diff/170001/android_webview/android_webview.gyp#newcode203 android_webview/android_webview.gyp:203: 'emma_should_instrument': 1, Maybe this should default to 1 and ...
7 years, 4 months ago (2013-08-20 15:27:23 UTC) #18
gkanwar1
Coverage generation and uploading is now working. I would wait for the full suite of ...
7 years, 4 months ago (2013-08-20 17:30:13 UTC) #19
bulach
thanks!!! I was writing some comments, but then realized this is just way, way too ...
7 years, 4 months ago (2013-08-20 17:42:34 UTC) #20
gkanwar1
Marcus -- Thanks for the suggestion! I think you're right that breaking this up will ...
7 years, 4 months ago (2013-08-20 17:50:59 UTC) #21
bulach
thanks!! btw, I understand you're time-constrained, and I'm not your host :) but if it ...
7 years, 4 months ago (2013-08-20 18:31:13 UTC) #22
bulach
oh, and finally: don't be blocked on me.. I think all of these changes have ...
7 years, 4 months ago (2013-08-20 18:33:32 UTC) #23
joth
yes I think you can land the .java changes in its own patch https://codereview.chromium.org/20210002/diff/143004/content/public/android/javatests/src/org/chromium/content/common/CleanupReferenceTest.java File ...
7 years, 4 months ago (2013-08-20 18:34:22 UTC) #24
gkanwar1
On 2013/08/20 18:34:22, joth wrote: > yes I think you can land the .java changes ...
7 years, 4 months ago (2013-08-20 20:04:00 UTC) #25
gkanwar1
7 years, 4 months ago (2013-08-24 01:57:28 UTC) #26
On 2013/08/20 20:04:00, gkanwar1 wrote:
> On 2013/08/20 18:34:22, joth wrote:
> > yes I think you can land the .java changes in its own patch
> > 
> >
>
https://codereview.chromium.org/20210002/diff/143004/content/public/android/j...
> > File
> >
>
content/public/android/javatests/src/org/chromium/content/common/CleanupReferenceTest.java
> > (left):
> > 
> >
>
https://codereview.chromium.org/20210002/diff/143004/content/public/android/j...
> >
>
content/public/android/javatests/src/org/chromium/content/common/CleanupReferenceTest.java:57:
> > ReferredObject instance = new ReferredObject();
> > Use AtomicReference here, and then you won't need to make it a member.
> > 
> > (Maybe)
> > 
> > 
> > AtomicReference<ReferredObject> instance =
> >         new AtomicReference<ReferredObject>(new ReferredObject());
> > 
> >
>
https://codereview.chromium.org/20210002/diff/143004/content/public/android/j...
> >
>
content/public/android/javatests/src/org/chromium/content/common/CleanupReferenceTest.java:60:
> > instance = null;
> > instance.set(null);
> > instance = null;
> > 
> >
>
https://codereview.chromium.org/20210002/diff/143004/content/public/android/j...
> >
>
content/public/android/javatests/src/org/chromium/content/common/CleanupReferenceTest.java:61:
> > collectGarbage();
> > Can also try
> > 
> > instance == null
> > AssertTrue(instance == null);   // ensure compiler isn't futzing the
> assignment
> 
> The following CLs exist:
> * Python -- Reviewed by Frank and landed:
> https://codereview.chromium.org/23293006/
> * Small Java changes -- Reviewed by Joth, waiting on trybots to land:
> https://codereview.chromium.org/23253005/#ps6001
> * GYP changes -- Waiting on review from Chris:
> https://codereview.chromium.org/22870021/
> * Buildbot changes -- Not published yet, waiting on GYP changes:
> https://codereview.chromium.org/23345003/
> 
> Looks like the latest patch set in this overall CL passed, and outputted
correct
> coverage data, so we once these get landed everything should be in working
> order!

Closing this meta-patch, since all the pieces have landed.

Powered by Google App Engine
This is Rietveld 408576698