Closed Bug 1181020 Opened 4 years ago Closed 4 years ago

Update Robotium to latest version to support RecyclerView

Categories

(Firefox for Android :: Testing, defect)

x86
Unspecified
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 48
Tracking Status
firefox48 --- fixed

People

(Reporter: jonalmeida, Assigned: gbrown)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

The current (5.4.1) version of Robotium includes updated support for RecyclerViews (e.g. clickInRecyclerView, clickLongInRecyclerView). When updating our appropriate views, consider updating robocop as well to support testing for this as well.

See: https://code.google.com/p/robotium/

(If Project Hosting is closed when you're looking at this) See here: https://github.com/RobotiumTech/robotium
Blocks: 1158303
See Also: → 988295
It'd be good to write the robotium upgrade process down into a wiki somewhere, or write a script to do it for us (unclear where it should be kept though).
Jonathan, since I assume you're doing this :P, I'd recommend taking a look at the dupe, bug 988295 – there's a WIP patch on upgrading robotium to an older version.

Then, like that bug, I'd recommend getting it compiling locally, pushing it to try, and seeing what errors come up.
See Also: 988295
Sounds like a plan!
Assignee: nobody → jalmeida
Bug 1181020 - Update Robocop to latest version to support RecyclerView. r=mcomella

Only contains updated version in gradle. Mainly for try testing.
Attachment #8630867 - Flags: review?(michael.l.comella)
Comment on attachment 8630867 [details]
MozReview Request: Bug 1181020 - Update Robocop to latest version to support RecyclerView. r=mcomella

https://reviewboard.mozilla.org/r/12805/#review11519

Does gradle download this dependency automatically (i.e. you don't need to include the updated binary)?

Also, assuming there will be errors from this change, won't this break other users' local robocop builds if they run with gradle?
Attachment #8630867 - Flags: review?(michael.l.comella)
https://reviewboard.mozilla.org/r/12805/#review11519

> Does gradle download this dependency automatically (i.e. you don't need to include the updated binary)?

Gradle downloads the jar before building to resolve all unknown dependencies.

> Also, assuming there will be errors from this change, won't this break other users' local robocop builds if they run with gradle?

In gbrown's attempt, he was trying to switch robotium packages (com.jayway -> com.robotium). Here, we're staying with the same package but just updating the version. I ran this as a try build as well, and it looks all green: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f3e082c5a86c

Anything else you can recommend I try (no pun intended)?
It sounds like your change is fine for gradle, but I think you should also update the robotium jar in build/mobile/robocop. I doubt that the try run will use the gradle changes. (You could check on that by trying to access a new robotium feature in a test, in a try push. See if the test can access something like Solo.Config.commandLogging, or one of the new RecyclerView features.)

If I'm wrong and the gradle change is effective on try, then we probably don't need the robotium jar in build/mobile/robocop, and it should be removed.
(In reply to Geoff Brown [:gbrown] from comment #9)
> It sounds like your change is fine for gradle, but I think you should also
> update the robotium jar in build/mobile/robocop. I doubt that the try run
> will use the gradle changes. (You could check on that by trying to access a
> new robotium feature in a test, in a try push. See if the test can access
> something like Solo.Config.commandLogging, or one of the new RecyclerView
> features.)
> 
> If I'm wrong and the gradle change is effective on try, then we probably
> don't need the robotium jar in build/mobile/robocop, and it should be
> removed.

That's a good suggestion. I'm going to try that now!
Comment on attachment 8630867 [details]
MozReview Request: Bug 1181020 - Update Robocop to latest version to support RecyclerView. r=mcomella

Bug 1181020 - Update Robocop to latest version to support RecyclerView. r=mcomella

 - Removed old robotium jar in replace for the newer one.
 - Newer robotium has packaging changes which were updated in all tests.
 - Updated in build.gradle and makefile.
Attachment #8630867 - Flags: review?(michael.l.comella)
https://reviewboard.mozilla.org/r/12805/#review11761

::: build/mobile/robocop/FennecNativeActions.java:370
(Diff revision 2)
> -        mInstr.sendCharacterSync(keyCode);
> +        mSolo.sendKey(keyCode);

Instead of using Instrumentation.sendCharacterSync to send the menu click. I've changed this to use Solo.sendKey with seems to work better.

See: https://treeherder.mozilla.org/#/jobs?repo=try&revision=55a6c1478aa4

(Spinning another build with more tests than only Robocop for safety, but this change mainly affects Robocop tests)

::: build/mobile/robocop/FennecNativeActions.java:26
(Diff revision 2)
> -import com.jayway.android.robotium.solo.Solo;
> +import com.robotium.solo.Solo;

I bit the bullet and decided to change our package as well instead of using the currently maintained one which was for backward compatibility.

::: mobile/android/tests/browser/robocop/BaseTest.java
(Diff revision 2)
> -import android.content.Intent;

Also removed unused imports since I was touching the imports of those files.
https://reviewboard.mozilla.org/r/12805/#review11761

> Instead of using Instrumentation.sendCharacterSync to send the menu click. I've changed this to use Solo.sendKey with seems to work better.
> 
> See: https://treeherder.mozilla.org/#/jobs?repo=try&revision=55a6c1478aa4
> 
> (Spinning another build with more tests than only Robocop for safety, but this change mainly affects Robocop tests)

Solo.sendKey likely wouldn't exist if Instrumentation.sendCharacterSync worked well so wfm. :)

> Also removed unused imports since I was touching the imports of those files.

Good cleanup, but it's good to do that in a separate commit so the changes are easier to parse.
Comment on attachment 8630867 [details]
MozReview Request: Bug 1181020 - Update Robocop to latest version to support RecyclerView. r=mcomella

https://reviewboard.mozilla.org/r/12805/#review11911

Seems reasonable to me.

nit: fwiw, I think this would be easier to parse as several separate commits (but I'm biased - I love micro-commits), e.g. if the commits were:

1) Remove unused imports
2) Upgrade robotium jar to version x.x.x
3) Change Solo imports to ...

I'd be able to read the commit title, skim the commit, and not have to be so thorough about, "Should this be here? Does this make sense?" The things that don't make sense will jump right out to me, specific to each commit, given the title.
Attachment #8630867 - Flags: review?(michael.l.comella) → review+
https://reviewboard.mozilla.org/r/12805/#review11911

Makes sense, will do so future reviews!
https://reviewboard.mozilla.org/r/12805/#review11761

> Solo.sendKey likely wouldn't exist if Instrumentation.sendCharacterSync worked well so wfm. :)

I saw that in robotium source, but I have no idea why this correctly clicks on the view, but directly with Instrumentation it doesn't.. :S
Builds on try (see comment 15).
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/7c44c0343564
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 42
No instances of that failure on 120 retriggers post-backout. Bug 1184749 (which predates these failures) does look interesting, though.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: Firefox 42 → ---
I told Jonathan I'd take this from him. Not high pri though so if you want it done sooner, ping or feel free to take it.
Assignee: jalmeida → michael.l.comella
Not actively working on this – let's get back to it when we need it.
Assignee: michael.l.comella → nobody
This is very much like the previously reviewed patch, but now updates to robotium 5.5.4. 

Looking good on try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=a9b0c5634cb3.
Attachment #8735500 - Flags: review?(michael.l.comella)
Assignee: nobody → gbrown
Component: General → Testing
Comment on attachment 8735500 [details] [diff] [review]
update to robotium 5.5.4

Review of attachment 8735500 [details] [diff] [review]:
-----------------------------------------------------------------

Nice docs cleanup! :)
Attachment #8735500 - Flags: review?(michael.l.comella) → review+
See Also: → 1244906
The backout was for failures on the tc(Unit) job:

13:42:35     INFO -  /home/worker/workspace/build/src/mach gradle \
13:42:35     INFO -  		app:assembleAutomationDebug app:assembleAutomationDebugAndroidTest -x lint
13:42:40     INFO -  Parallel execution is an incubating feature.
13:42:54     INFO -  FAILURE: Build failed with an exception.
13:42:54     INFO -  * What went wrong:
13:42:54     INFO -  A problem occurred configuring project ':app'.
13:42:54     INFO -  > Failed to notify project evaluation listener.
13:42:54     INFO -     > Could not resolve all dependencies for configuration ':app:_localOldDebugAndroidTestCompile'.
13:42:54     INFO -        > Could not find com.jayway.android.robotium:robotium-solo:5.5.4.
13:42:54     INFO -          Searched in the following locations:
13:42:54     INFO -              file:/home/worker/workspace/build/src/jcentral/com/jayway/android/robotium/robotium-solo/5.5.4/robotium-solo-5.5.4.pom
13:42:54     INFO -              file:/home/worker/workspace/build/src/jcentral/com/jayway/android/robotium/robotium-solo/5.5.4/robotium-solo-5.5.4.jar
13:42:54     INFO -              file:/home/worker/workspace/build/src/android-sdk-linux/extras/android/m2repository/com/jayway/android/robotium/robotium-solo/5.5.4/robotium-solo-5.5.4.pom
13:42:54     INFO -              file:/home/worker/workspace/build/src/android-sdk-linux/extras/android/m2repository/com/jayway/android/robotium/robotium-solo/5.5.4/robotium-solo-5.5.4.jar
13:42:54     INFO -              file:/home/worker/workspace/build/src/android-sdk-linux/extras/google/m2repository/com/jayway/android/robotium/robotium-solo/5.5.4/robotium-solo-5.5.4.pom
13:42:54     INFO -              file:/home/worker/workspace/build/src/android-sdk-linux/extras/google/m2repository/com/jayway/android/robotium/robotium-solo/5.5.4/robotium-solo-5.5.4.jar
13:42:54     INFO -          Required by:
13:42:54     INFO -              src:app:unspecified
13:42:54     INFO -     > Task with name 'spoonLocalDebugAndroidTest' not found in project ':app'.
13:42:54     INFO -  * Try:
13:42:54     INFO -  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
13:42:54     INFO -  BUILD FAILED


I note that the tc(Deps) job was successful and shows:

14:06:32     INFO -  Download http://localhost:8081/nexus/content/repositories/central/com/jayway/android/robotium/robotium-solo/5.5.4/robotium-solo-5.5.4.pom
14:06:32     INFO -  Download http://localhost:8081/nexus/content/repositories/central/com/jayway/android/robotium/robotium/5.5.4/robotium-5.5.4.pom
14:06:32     INFO -  Download http://localhost:8081/nexus/content/repositories/central/com/jayway/android/robotium/robotium-solo/5.5.4/robotium-solo-5.5.4.jar


:nalexander -- Do you know what's happening here / how to fix this?
Flags: needinfo?(nalexander)
Flags: needinfo?(gbrown)
> :nalexander -- Do you know what's happening here / how to fix this?

Yes.  The Unit task pulls Gradle dependencies using tooltool.  The Deps task produced new dependencies, but the tooltool manifest needs to be bumped to use them.  This is very new but documented at https://gecko.readthedocs.org/en/latest/build/buildsystem/toolchains.html#firefox-for-android-with-gradle.  Specifically, you want to upload the updated jcentral.tar.xz [1] to tooltool and use it in the three manifests [3].  Then push to try.

There are hard problems stopping making this automatic; basically, we can't service buildbot jobs without this tooltool business, which needs to be manual for security reasons.  Sigh.

[1] https://queue.taskcluster.net/v1/task/ElO1zRnGQiuTIgG_d8_KEw/runs/0/artifacts/public%2Fbuild%2Fjcentral.tar.xz

[2 https://dxr.mozilla.org/mozilla-central/search?q=jcentral+path%3Areleng.manifest&redirect=true&case=false
Flags: needinfo?(nalexander)
Summary: Update Robocop to latest version to support RecyclerView → Update Robotium to latest version to support RecyclerView
https://hg.mozilla.org/mozilla-central/rev/ef6a15d8cf47
Status: REOPENED → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
You need to log in before you can comment on or make changes to this bug.