Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis: Run with Google Play Services for Voice Recognition #611

Closed
wants to merge 5 commits into from

Conversation

FlorianSW
Copy link
Member

Getting the Voice recognition running is only possible, if at least one
handler handles the RecognitionService.SERVICE_INTERFACE intent. The
easiest way to achive this is to run the instrumented test on an emulator
which actually has the Google Play services installed.

This commit changes the travis-ci configuration so that the emulator
started has the Play services installed. It also adds some extras, which
are already pre-installed, but accoridng to the travis documentation[1]
should be explicitly mentioned to ensure build stability. However, for the
current build they don't change anything. The extras are namely:

extra-android-support
extra-google-google_play_services
extra-google-m2repository
extra-android-m2repository

[1]
https://docs.travis-ci.com/user/languages/android/#Pre-installed-components

Getting the Voice recognition running is only possible, if at least one
handler handles the RecognitionService.SERVICE_INTERFACE intent. The
easiest way to achive this is to run the instrumented test on an emulator
which actually has the Google Play services installed.

This commit changes the travis-ci configuration so that the emulator
started has the Play services installed. It also adds some extras, which
are already pre-installed, but accoridng to the travis documentation[1]
should be explicitly mentioned to ensure build stability. However, for the
current build they don't change anything. The extras are namely:

extra-android-support
extra-google-google_play_services
extra-google-m2repository
extra-android-m2repository

For some reason, also the -no-audio switch does not work anymore, however,
currently there's no need to completely disable audio in our build and
test.

[1]
https://docs.travis-ci.com/user/languages/android/#Pre-installed-components

Signed-off-by: Florian <[email protected]>
.travis.yml Outdated
- addon-google_apis-google-22 # Google play services
- sys-img-armeabi-v7a-google_apis-22

licenses:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"By default, Travis CI will accept all the requested licenses, but it is also possible to define a white list of licenses to be accepted, as shown in the following example:"
from https://docs.travis-ci.com/user/languages/android/#Pre-installed-components

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, we most likely do not need the license list. I'll remove it, once I'm sure, that the build succeeds :)

@FlorianSW
Copy link
Member Author

Ok, I've no idea why the build is failing. On my fork I tested a variety of different solutions and suggestions I found, which may or may not fix this issue, however, the build is always failing. Does someone has an idea?

If not, I'll probably open an issue at https://github.com/travis-ci/travis-ci to ask, why the build on a non-google-apis including image works fine, however, an installtion on an image including google-apis fails.

@FlorianSW FlorianSW closed this Jan 7, 2018
@FlorianSW FlorianSW reopened this Jan 7, 2018
@mueller-ma
Copy link
Member

I have read (couldnt find a source) that google doesnt release google-free abi of recent android version anymore, so they should always do the voice check.
Do you want to give it a try to use matrix to run tests on api 22 and 27?

.travis.yml Outdated
- ADB_INSTALL_TIMEOUT=8
matrix:
- ANDROID_TARGET=android-22 ANDROID_ABI=armeabi-v7a
- ANDROID_TARGET=android-27 ANDROID_ABI=armeabi-v7a
Copy link
Member Author

@FlorianSW FlorianSW Jan 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, should be x86, as armeabi-v7a is not available for this api :/

@mueller-ma
Copy link
Member

mueller-ma commented Jan 8, 2018

When I understand it correctly, travis uses "cookbooks" as template for ci builds. Android has the max api 25: https://github.com/travis-ci/travis-cookbooks/blob/master/community-cookbooks/android-sdk/CHANGELOG.md

@FlorianSW
Copy link
Member Author

Hmm, ok, just a question (I'm not sure if my answer "yes", is correct): Can I simply install the sys-image with sdkmanager? Then no sys-img would be installed with android-components.

@mueller-ma
Copy link
Member

Yes, should work.

@codecov-io
Copy link

codecov-io commented Jan 8, 2018

Codecov Report

Merging #611 into master will increase coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #611      +/-   ##
==========================================
+ Coverage    31.8%   31.86%   +0.06%     
==========================================
  Files          64       64              
  Lines        4855     4855              
  Branches      655      655              
==========================================
+ Hits         1544     1547       +3     
+ Misses       3093     3089       -4     
- Partials      218      219       +1
Impacted Files Coverage Δ
.../org/openhab/habdroid/ui/OpenHABWidgetAdapter.java 42.2% <0%> (+0.55%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 57168b6...35c9cad. Read the comment docs.

@mueller-ma
Copy link
Member

I opened an issue for Api 25+
travis-ci/travis-cookbooks#965

android-27 can not be run on travis, as there's no arm abi anymore, and
x86 requires KVM support, which is not possible in travis containers atm,
see travis-ci/travis-ci#1419

Use latest android image provided by travis (which has an arm abi),
android-25, and also does not have a non-google-apis image anymore.

Signed-off-by: Florian <[email protected]>
@FlorianSW FlorianSW force-pushed the travis/voice_test branch 3 times, most recently from da3b388 to bfc06bb Compare January 9, 2018 19:23
@mueller-ma mueller-ma added the automation Everything related to Bots label Jan 13, 2018
@mueller-ma
Copy link
Member

Closing due to conflicts introduced by #801

@mueller-ma mueller-ma closed this Mar 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation Everything related to Bots
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants