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

Issue 693659 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Mar 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Feature

Blocked on:
issue 662467

Blocking:
issue 693660



Sign in to add a comment

Upgrade to Robolectric 3.2

Project Member Reported by jbudorick@chromium.org, Feb 17 2017

Issue description

We're on Robolectric 3.0. 3.1 released in June, and 3.2 released in January. Time to upgrade.
 
Blocking: 693660
Cc: mikec...@chromium.org
Owner: ----
Status: Available (was: Assigned)
Pretty sure this is what has to be done...

1. There are some local modifications off of Robolectric-3.0 branch that must be rebased onto Robolectric-3.2

https://chromium.googlesource.com/external/robolectric/+/3.0-chromium

So it will be like...
git rebase --onto robolectric-3.2.2 robolectric-3.0 3.0-chromium
...or something and pray it works.

2. Update src/DEPS to point to the new 3.2-chromium commit

3. Update all the files in third_party/robolectric/BUILD.gn

4. Add the latest android-all.jar. Need to upload to GS bucket and commit sha1 file. Something like...
https://cs.chromium.org/chromium/src/third_party/robolectric/lib/android-all-5.0.0_r2-robolectric-1.jar.sha1

5. Follow these two docs to update some Robolectric APIS. Doesnt look bad.

https://github.com/robolectric/robolectric/wiki/3.0-to-3.1-Upgrade-Guide
https://github.com/robolectric/robolectric/wiki/3.1-to-3.2-Migration-Guide



I think that is it?

Owner: mikec...@chromium.org
Status: Assigned (was: Available)
eh, this doesnt sound to bad actually. Will use this project to perfcrastinate a bit next week.

ASsigning back to myself
Cc: nyquist@chromium.org
Just tried writing a test using robolectric, but realized that the version we have only supports lollipop (I needed LOLLIPOP_MR1 and preferably M).

So I had to fall back to using a normal Android test, which made me a little sad. Would be awesome to port it back to Robolectric at some point.
Blockedon: 662467
Got Robolectric 3.2 building locally. Needs way more changes than I initially thought.

We will need to also add the third_party library Xstream and also update third_party/guava and third_party/accessibility-test-framework libraries.

We will also need Java 1.8 on our bots before we upgrade.

Comment 7 by sanfin@chromium.org, Feb 24 2017

Cc: sanfin@chromium.org
Got all Robolectric suites working on 3.2.2

CL for local changes to third_party/robolectric code:
https://codereview.appspot.com/319410043/

CL for building/syncing newer Robolectric version and test changes:
https://codereview.chromium.org/2710343003
Project Member

Comment 10 by bugdroid1@chromium.org, Mar 16 2017

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

commit 6a5f508e65cf947c6292fe8578868d0fe739f0aa
Author: mikecase <mikecase@chromium.org>
Date: Thu Mar 16 21:30:06 2017

Update Robolectric to 3.2.2

BUG= 693659 

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

[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/DEPS
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/chrome/android/java_sources.gni
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/chrome/android/junit/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperTest.java
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/chrome/android/junit/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerTest.java
[delete] https://crrev.com/93b10af49dc4f680debc7fa2274bd07a55c6492f/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageTestRunner.java
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/chrome/android/junit/src/org/chromium/chrome/browser/payments/AndroidPaymentAppFinderTest.java
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/chrome/android/junit/src/org/chromium/chrome/browser/physicalweb/PwsClientImplTest.java
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/chrome/android/junit/src/org/chromium/chrome/browser/superviseduser/SupervisedUserContentProviderUnitTest.java
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/chrome/android/webapk/shell_apk/junit/src/org/chromium/webapk/shell_apk/MainActivityTest.java
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/chrome/android/webapk/test/src/org/chromium/webapk/test/WebApkTestHelper.java
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/components/variations/android/junit/src/org/chromium/components/variations/firstrun/VariationsSeedFetcherTest.java
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/testing/android/junit/BUILD.gn
[add] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/testing/android/junit/java/src/org/chromium/testing/local/GNManifestFactory.java
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/testing/android/junit/java/src/org/chromium/testing/local/LocalRobolectricTestRunner.java
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/third_party/.gitignore
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/third_party/accessibility_test_framework/BUILD.gn
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/third_party/accessibility_test_framework/README.chromium
[delete] https://crrev.com/93b10af49dc4f680debc7fa2274bd07a55c6492f/third_party/accessibility_test_framework/lib/accessibility-test-framework-1.0.jar.sha1
[add] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/third_party/accessibility_test_framework/lib/accessibility-test-framework-2.1.jar.sha1
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/third_party/guava/BUILD.gn
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/third_party/guava/README.chromium
[delete] https://crrev.com/93b10af49dc4f680debc7fa2274bd07a55c6492f/third_party/guava/lib/guava-18.0.jar.sha1
[add] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/third_party/guava/lib/guava-20.0.jar.sha1
[modify] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/third_party/robolectric/BUILD.gn
[add] https://crrev.com/6a5f508e65cf947c6292fe8578868d0fe739f0aa/third_party/robolectric/lib/android-all-7.1.0_r7-robolectric-0.jar.sha1
[delete] https://crrev.com/93b10af49dc4f680debc7fa2274bd07a55c6492f/third_party/robolectric/lib/json-20080701.jar.sha1
[delete] https://crrev.com/93b10af49dc4f680debc7fa2274bd07a55c6492f/third_party/robolectric/lib/robolectric-2.4-jar-with-dependencies.jar.sha1
[delete] https://crrev.com/93b10af49dc4f680debc7fa2274bd07a55c6492f/third_party/robolectric/lib/tagsoup-1.2.jar.sha1
[delete] https://crrev.com/93b10af49dc4f680debc7fa2274bd07a55c6492f/third_party/robolectric/template_processor/src/org/chromium/testing/robolectric/template/ProcessRobolectricTemplate.java
[delete] https://crrev.com/93b10af49dc4f680debc7fa2274bd07a55c6492f/third_party/robolectric/template_processor/src/org/chromium/testing/robolectric/template/ProcessTemplateArgParser.java
[delete] https://crrev.com/93b10af49dc4f680debc7fa2274bd07a55c6492f/third_party/robolectric/template_processor/src/org/chromium/testing/robolectric/template/TemplateFileInfo.java

Status: Fixed (was: Assigned)
ok, should be fixed assuming CL sticks.

Can now write Robolectric tests with N-MR1 Android code. Also, Robolectric 3.2 has some slick features (like being able to run same test against multiple SDK levels, and more)
I want to resurrect some CLs for android proxy settings and find several android-all jars are missing. Should I file a new issue? 

Sign in to add a comment