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

Issue 2819983002: (Reland) Expose resources in Robolectric/JUnit tests. (Closed)

Created:
3 years, 8 months ago by mikecase (-- gone --)
Modified:
3 years, 8 months ago
Reviewers:
nyquist, jbudorick
CC:
agrieve+watch_chromium.org, chromium-reviews, jbudorick+watch_chromium.org, mikecase+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

(Reland) Expose resources in Robolectric/JUnit tests. Will let people use Android resources in Robolectric tests. To use, specify package_name GN variable in junit_binary targets with your apps package name. This change will also (basically) require that you use the generated wrappers from out_dir/bin/run_<suite name> to run the tests since GN will be generating many arguments to pass along to the test runner. BUG=693573 Review-Url: https://codereview.chromium.org/2819983002 Cr-Commit-Position: refs/heads/master@{#464973} Committed: https://chromium.googlesource.com/chromium/src/+/30bba37e58b51483b1ec77bc3f697deb8e4033c1

Patch Set 1 #

Patch Set 2 : Fix #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+201 lines, -91 lines) Patch
M build/android/gyp/create_test_runner_script.py View 3 chunks +16 lines, -0 lines 0 comments Download
M build/android/gyp/write_build_config.py View 2 chunks +3 lines, -1 line 0 comments Download
M build/android/pylib/junit/junit_test_instance.py View 3 chunks +20 lines, -0 lines 0 comments Download
M build/android/pylib/local/machine/local_machine_junit_test_run.py View 1 4 chunks +47 lines, -16 lines 1 comment Download
M build/android/test_runner.py View 1 chunk +15 lines, -0 lines 0 comments Download
M build/android/test_runner.pydeps View 1 chunk +1 line, -0 lines 0 comments Download
M build/config/android/internal_rules.gni View 2 chunks +31 lines, -1 line 0 comments Download
M build/config/android/rules.gni View 3 chunks +18 lines, -0 lines 0 comments Download
M chrome/android/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java View 5 chunks +1 line, -56 lines 0 comments Download
M testing/android/OWNERS View 1 chunk +1 line, -0 lines 0 comments Download
M testing/android/junit/java/src/org/chromium/testing/local/GNManifestFactory.java View 1 chunk +40 lines, -11 lines 0 comments Download
M testing/android/junit/java/src/org/chromium/testing/local/LocalRobolectricTestRunner.java View 2 chunks +5 lines, -1 line 0 comments Download
M third_party/robolectric/README.chromium View 1 chunk +1 line, -5 lines 0 comments Download

Messages

Total messages: 14 (5 generated)
mikecase (-- gone --)
Had to revert this since one of the bots didn't have all of the resource_zips ...
3 years, 8 months ago (2017-04-14 23:12:07 UTC) #2
mikecase (-- gone --)
Also, revert CL: https://codereview.chromium.org/2819593002
3 years, 8 months ago (2017-04-14 23:12:34 UTC) #3
mikecase (-- gone --)
Added some info to commit desc. Still just a one-line-change reland.
3 years, 8 months ago (2017-04-17 17:47:23 UTC) #5
jbudorick
lgtm
3 years, 8 months ago (2017-04-17 17:48:23 UTC) #6
nyquist
lgtm But I guess jbudorick should look at the one line change. but that part ...
3 years, 8 months ago (2017-04-17 17:48:50 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2819983002/20001
3 years, 8 months ago (2017-04-17 18:03:59 UTC) #9
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/src/+/30bba37e58b51483b1ec77bc3f697deb8e4033c1
3 years, 8 months ago (2017-04-17 19:22:20 UTC) #12
alexmos
A revert of this CL (patchset #2 id:20001) has been created in https://codereview.chromium.org/2824863002/ by alexmos@chromium.org. ...
3 years, 8 months ago (2017-04-17 21:29:53 UTC) #13
mikecase (-- gone --)
3 years, 8 months ago (2017-04-17 21:34:12 UTC) #14
Message was sent while issue was closed.
On 2017/04/17 at 21:29:53, alexmos wrote:
> A revert of this CL (patchset #2 id:20001) has been created in
https://codereview.chromium.org/2824863002/ by alexmos@chromium.org.
> 
> The reason for reverting is: Appears to be breaking chrome_junit_tests:
https://build.chromium.org/p/chromium.linux/builders/Android%20Tests/builds/4...

> 
> Stack trace from failed tests:
> android.content.res.Resources$NotFoundException: Resource ID #0x7f0a0153
> 	at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:190)
> 	at android.content.res.Resources.getDimensionPixelSize(Resources.java:667)
> 	at
org.chromium.chrome.browser.suggestions.TileGroup.<init>(TileGroup.java:192)
> 	at
org.chromium.chrome.browser.suggestions.TileGroupTest.testReceiveNewTilesWithoutChanges(TileGroupTest.java:110)
> 	at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> 	at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> 	at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:52)
> 	at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> 	at
org.robolectric.RobolectricTestRunner$HelperTestRunner$1.evaluate(RobolectricTestRunner.java:515)
> 	at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
> 	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
> 	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
> 	at
org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:316)
> 	at
org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:236)
> 	at
org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:41)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> 	at
org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:176)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> 	at
org.chromium.testing.local.GtestComputer$GtestSuiteRunner.run(GtestComputer.java:46)
> 	at org.junit.runners.Suite.runChild(Suite.java:128)
> 	at org.junit.runners.Suite.runChild(Suite.java:27)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> 	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
> 	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
> 	at org.chromium.testing.local.JunitTestMain.main(JunitTestMain.java:105)
> .

guessing issue is that maybe script that zips the builds for the Android bot
trys to be smart and only zips what it thinks it needs. Maybe I need to add the
resource zips as data_deps or to the .isolate files? Unsure

Powered by Google App Engine
This is Rietveld 408576698