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

Linux: test fails, unknown API level #62

Closed
davidvavra opened this issue May 18, 2020 · 8 comments
Closed

Linux: test fails, unknown API level #62

davidvavra opened this issue May 18, 2020 · 8 comments

Comments

@davidvavra
Copy link

Hi,
I'm using your action for automated screenshot tests. Great job! My job runs fine on Mac OS, I recently found out that you also support Linux, which can save us a lot of money. Screenshots tests might be a good use-case for Linux, I don't really need hardware acceleration (Facebook screenshot library only uses emulator to layout views, nothing is shown on the screen).

Here is my configuration:

jobs:
  build:

    runs-on: ubuntu-18.04

    steps:
    - name: Run screenshot tests
      uses: reactivecircus/android-emulator-runner@v2
      with:
        api-level: 27
        arch: x86_64
        profile: pixel
        script: ./gradlew verifyQaDebugAndroidTestScreenshotTest recordQaDebugAndroidTestScreenshotTest --continue

and the test fails with this:

> Task :app:validateSigningDevDebugAndroidTest UP-TO-DATE
> Task :app:packageDevDebugAndroidTest UP-TO-DATE
[PropertyFetcher]: ShellCommandUnresponsiveException getting properties for device emulator-5554: null
[PropertyFetcher]: ShellCommandUnresponsiveException getting properties for device emulator-5554: null

> Task :app:connectedDevDebugAndroidTest
Skipping device 'test(AVD)' for 'app:DEV': Unknown API Level

DEV > : No compatible devices connected.[TestRunner] FAILED 
Found 1 connected device(s), 0 of which were compatible.

Any ideas?

@ychescale9
Copy link
Member

I think you’ve probably read this but in case you haven’t, even you can run the action on Linux VMs and it might work on some system images, you’ll likely run into all sort of issues without hardware acceleration. For example I’ve yet been able to start an API 29 emulator successfully on Linux VMs. It’s not just slow, it doesn’t work. In your case it might be the emulator instance crashing after booting successfully otherwise your script wouldn’t be running at all.

Maybe try lower API levels eg 16, 19, 21. But other than that I really don’t have anything to suggest (or maybe have a look at CirrusCI?). Sorry!

@davidvavra
Copy link
Author

Our minSdk is 23, so I tried it with that and it also doesn't work. I thought that screenshot tests might be a good use-case for Linux, I don't really need fast emulator, it should be only running and accept adb commands. But it can't do even that, so it's not usable for my case. I will keep using the Mac runner and we are thinking about a local Github Actions runner hosted on Mac Mini in our office.

@ychescale9
Copy link
Member

Now I wonder if there are some compatibility issue with the screenshot testing library, as API 23 emulator on Linux should at least start. Maybe I can do some digging, but if you can setup a local GitHub Action runner on with Mac mini that’d be way better!

@davidvavra
Copy link
Author

There is a different error message on API 23:

> Task :app:connectedDevDebugAndroidTest
Unable to install /home/runner/work/jill-android-mobile-application/jill-android-mobile-application/app/build/outputs/apk/dev/debug/app-debug-v0.47.30-1152.apk
com.android.ddmlib.InstallException
	at com.android.ddmlib.Device.installRemotePackage(Device.java:1149)
	at com.android.ddmlib.Device.installPackage(Device.java:973)
	at com.android.ddmlib.Device.installPackage(Device.java:949)
	at com.android.ddmlib.Device.installPackage(Device.java:938)
	at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:126)
	at com.android.builder.internal.testing.SimpleTestRunnable.run(SimpleTestRunnable.java:148)
	at com.android.ide.common.workers.ExecutorServiceAdapter$submit$submission$1.run(ExecutorServiceAdapter.kt:68)
	at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinTask.externalInterruptibleAwaitDone(ForkJoinTask.java:361)
	at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1001)

But it looks like it's not worth to invest more time into this.

@ychescale9
Copy link
Member

Thanks. I’m closing this now. Let me know if you run into other issues😀

@jonnycaley
Copy link

I ran into the same issue. Running on a mac instance (runs-on: macos-latest) did the job for me

@ngaruko
Copy link

ngaruko commented Apr 28, 2021

Got same issue over and over, for our app minSdk is 29 - can't go lower. Switched to macos-latest and it works, but apparently the cost is 10X that of Linux VMs. Job:

test-mac:
    runs-on: macos-latest
    steps:
    - name: checkout
      uses: actions/checkout@v2
    - name: run tests
      uses: reactivecircus/android-emulator-runner@v2
      with:
        api-level: 29
        script: ./gradlew connectedDebugAndroidTest

@ychescale9
Copy link
Member

Yeah this is expected unfortunately 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants