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

test: Add test emulators to Travis CI configuration #696

Closed
wants to merge 2 commits into from

Conversation

gaurivn
Copy link
Member

@gaurivn gaurivn commented Apr 19, 2020

Description

Added test emulators to Travis CI configuration.

Fixes #168

Type of Change:

Delete irrelevant options.

  • Code

Code/Quality Assurance Only

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update (software upgrade on readme file)
  • New feature (non-breaking change which adds functionality pre-approved by mentors)

How Has This Been Tested?

Describe the tests you ran to verify your changes. Provide instructions or GIFs so we can reproduce. List any relevant details for your test.

Checklist:

Delete irrelevant options.

  • My PR follows the style guidelines of this project
  • I have performed a self-review of my own code or materials
  • I have commented my code or provided relevant documentation, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Code/Quality Assurance Only

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been published in downstream modules

atm1504
atm1504 previously approved these changes Apr 22, 2020
Copy link

@atm1504 atm1504 left a comment

Choose a reason for hiding this comment

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

LGTM. Good Work : )

@atm1504
Copy link

atm1504 commented Apr 22, 2020

@gaurivn can you please try to fix the Travis build error. Else everything looks good to me.

@gaurivn
Copy link
Member Author

gaurivn commented Apr 22, 2020

Thank you @atm1504 , actually in my first commit, I had included test. The build error I got was that no test.ini file exists in $HOME/.android/avd. I searched, couldn't find how to create the test.ini file, so I replaced test with the name of an emulator (whose .avd and .ini files exist in my $HOME/.android/avd) but again I am getting error in travis that that .ini file cannot be found. Please help me solve this issue, how to go about creating the test.ini file.

@gaurivn
Copy link
Member Author

gaurivn commented Apr 30, 2020

@isabelcosta , can you please help me solve the travis build error, in the first commit I had written correctly with 'test' and Travis build gives error saying that test.ini file didn't exist in my $HOME/.android/avd and I checked it wasn't there.

So just to confirm again, I committed a second time, with my emulator (Nexus 5 full name - exactly how it was in the .ini files at $HOME/.android/avd) and still Travis Build says the files does not exist.

Can you please tell me how to create the test.ini file, I tried searching but couldn't find.

@isabelcosta
Copy link
Member

🤔 at this moment I am not sure what the problem is, so I will call out help here @annabauza @foongminwong and on Zulip @gaurivn

@devansh-299
Copy link

devansh-299 commented May 1, 2020

@gaurivn
The problem is most probably because you havent't specified the emulator level under components. Also before running the script you need to initialise the virtual running environment which can be done as - echo no | android create avd --force -n test -t android-<your emulator level> --abi <your abi level>

@gaurivn
Copy link
Member Author

gaurivn commented May 1, 2020

Thank you so much @isabelcosta 🙏

@gaurivn
Copy link
Member Author

gaurivn commented May 1, 2020

@devansh-299 , thank you, in my first commit, I had written properly with test but it came test.ini file not there in $HOME/.android/avd. So I checked there, since my Nexus 5 emulator.ini file was there so I simply changed from test to Nexus 5...... in 2nd commit. Though the .ini file existed at the same location for Nexus 5, Travis shows it cannot find the same.

I will change it back to first commit and also rename my Nexus 5 .... .ini file to test.ini, that idea never occurred to me before, keeping in mind the points you said.

@gaurivn
Copy link
Member Author

gaurivn commented May 1, 2020

@devansh-299 , please find the screenshot attached below, grateful if you could comment on it, if I've to make more changes. I added android-30 (my emulator level) too afterwards.
Screenshot from 2020-05-01 18-23-50

.travis.yml Outdated
@@ -6,12 +6,18 @@ android:
- tools
- build-tools-28.0.3
- android-28
- android-30

Choose a reason for hiding this comment

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

I would suggest you to use some lower level of Emulator as it may lead to compatibility issues

Copy link
Member Author

@gaurivn gaurivn May 2, 2020

Choose a reason for hiding this comment

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

I installed Pixel 3a emulator android-28, and removed the android-30 line, that would do.

Choose a reason for hiding this comment

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

@gaurivn this has nothing to do with your the emulator on your system. Here you are just specifying emulator specifications that would run on Docker on Travis' servers. I hope this explanation helps :)

.travis.yml Outdated
@@ -6,12 +6,18 @@ android:
- tools
- build-tools-28.0.3
- android-28
- android-30
- sys-img-x86-android-27

Choose a reason for hiding this comment

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

Since most android devices are based on arm processors, please use sys-img-armeabi-v7a-android-<your emulator level>

Copy link
Member Author

Choose a reason for hiding this comment

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

Since my emulator level, the one present currently in .travis.yml, and the one suggested in the comment linked to issue #168 - 131 is x86 I used that. Please let me know if I still have to change it to armeabi-v7a.

Choose a reason for hiding this comment

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

You should change it as the x86 abi image is invalid Error: Invalid --abi x86 for the selected target is occurring, you can checkout this from here

Copy link
Member Author

Choose a reason for hiding this comment

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

I had seen the error but before that when I ran with x86 the error was a kernel qemu file missing following which I read an answer on Travis Build working only till 27, that's why I didn't change it. I will change to to armeabi-v7a.

Copy link
Member Author

Choose a reason for hiding this comment

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

$ echo no | android create avd --force -n test -t android-27 --abi armeabi-v7a Valid ABIs: no ABIs. Error: Invalid --abi armeabi-v7a for the selected target. The command "echo no | android create avd --force -n test -t android-27 --abi armeabi-v7a" failed and exited with 1 during .
The emulator whose ini file I renamed to test.ini has the following specs.
android27pixelspecs

before_install:
- yes | ${ANDROID_HOME}/tools/bin/sdkmanager "platforms;android-28"
- emulator -avd test -no-audio -no-window &

Choose a reason for hiding this comment

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

Please move 13, 14 lines below 16 line as currently, this is trying to initiate the emulator before creating the virtual environment

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

.travis.yml Outdated
before_script:
- echo no | android create avd --force -n test -t android-30 --abi x86
Copy link

@devansh-299 devansh-299 May 1, 2020

Choose a reason for hiding this comment

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

please replace the abi level here with the suggested one

@isabelcosta
Copy link
Member

@devansh-299 thank you so much for your review here 🙌

@gaurivn
Copy link
Member Author

gaurivn commented May 2, 2020

@devansh-299 , thank you very much for the review, will need your help later on. I got the error that kernel-qemu file is missing, I'll try solving that and use armeabi-v7a.

@@ -5,13 +5,17 @@ android:
- platform-tools
- tools
- build-tools-28.0.3
- android-28

Choose a reason for hiding this comment

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

Also, you have to specify the API level and the emulator level, so please do not delete -android-<level>. You need to specify for both of these separately, so you will have to add these lines
-android-<your_API_level>
-android-<your_emulator_level>
I hope this helps :)

Copy link
Member Author

@gaurivn gaurivn May 2, 2020

Choose a reason for hiding this comment

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

- android-28
- android-27
Okay will add back.

@devansh-299
Copy link

@gaurivn Error: Invalid --abi armeabi-v7a for the selected target. seems to be a common error, see this StackOverflow thread. Here's one .travis.yml script that worked for me, maybe you can use this
ss

@gaurivn
Copy link
Member Author

gaurivn commented May 2, 2020

Thank you @devansh-299 , I'll make changes according to the script you provided. In case that doesn't work, then I'll follow the stack overflow one.

@devansh-299
Copy link

@gaurivn @isabelcosta @anitab-org/coding-team the problem with the .travis.yml has been fixed but build is failing as the code is failing tests just added, see the report here. I think separate PRs should be addressed to fix the build issues

@devansh-299
Copy link

@gaurivn please squash the commits

@gaurivn
Copy link
Member Author

gaurivn commented May 3, 2020

@devansh-299 , I was thinking of committing again by adding google_apis-google-21 etc. to see if it works. Do you suggest I try again, changing android-22 to the one I said or do I squash all the commits made so far

@gaurivn
Copy link
Member Author

gaurivn commented May 3, 2020

@gaurivn please squash the commits

Done

@isabelcosta
Copy link
Member

@gaurivn @isabelcosta @anitab-org/coding-team the problem with the .travis.yml has been fixed but build is failing as the code is failing tests just added, see the report here. I think separate PRs should be addressed to fix the build issues

Thank you so much @devansh-299 for helping @gaurivn in this PR 🙌
What do you propose then, should we hold on this PR and have a separate issue/PR to fix the tests, then merge and then see if Travis CI build for this test emulators PR passes. If all good then merge this one?

@devansh-299
Copy link

@gaurivn @isabelcosta @anitab-org/coding-team the problem with the .travis.yml has been fixed but build is failing as the code is failing tests just added, see the report here. I think separate PRs should be addressed to fix the build issues

Thank you so much @devansh-299 for helping @gaurivn in this PR raised_hands
What do you propose then, should we hold on this PR and have a separate issue/PR to fix the tests, then merge and then see if Travis CI build for this test emulators PR passes. If all good then merge this one?

Welcome, @isabelcosta :)
Yes, I think we can refer to the test results from this PR to fix the build failures with new PRs and then merge this PR. @anitab-org/coding-team should we go with this approach?

@Hyper-Matrix
Copy link
Contributor

@devansh-299 agreed

@isabelcosta
Copy link
Member

@anitab-org/coding-team @devansh-299 can anyone here create the issues for fixing the tests that are failing? I am not sure which tests are failing, and I am low on bandwidth for this

@devansh-299
Copy link

devansh-299 commented May 8, 2020

@anitab-org/coding-team @devansh-299 can anyone here create the issues for fixing the tests that are failing? I am not sure which tests are failing, and I am low on bandwidth for this

@isabelcosta sure! I will work on this

@devansh-299 devansh-299 added Status: On Hold Issue or PR needs more info, a discussion, a review or approval from a Maintainer/Code Owner. Type: Testing UI Tests, Integration Tests, Travis CI, etc. labels May 9, 2020
@menina763 menina763 added the Category: Coding Changes to code base or refactored code that doesn't fix a bug. label May 27, 2020
@isabelcosta
Copy link
Member

@gaurivn are you interested in continuing this issue?
If yes, could you please change this PR to make the tests run on GitHub actions? If not, please let me know so I can close this. I was thinking of creating a new issue to make this using GH actions, but if you can do this here, I don't mind if you do this here. What do you think?

@gaurivn
Copy link
Member Author

gaurivn commented Dec 13, 2020

@gaurivn are you interested in continuing this issue?
If yes, could you please change this PR to make the tests run on GitHub actions? If not, please let me know so I can close this. I was thinking of creating a new issue to make this using GH actions, but if you can do this here, I don't mind if you do this here. What do you think?

@isabelcosta, I won't be able to continue this issue for the time being, pls feel free to close this PR.

@isabelcosta
Copy link
Member

@isabelcosta, I won't be able to continue this issue for the time being, pls feel free to close this PR.

@gaurivn no problem! thank you for letting me know 🤗
I will close it then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Status: On Hold Issue or PR needs more info, a discussion, a review or approval from a Maintainer/Code Owner. Type: Testing UI Tests, Integration Tests, Travis CI, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add run UI test step to GitHub Action
6 participants