Comments (14)
Just for the records, this is the final way I go without color noise
script: |
adb logcat -c
adb logcat *:E &
./gradlew cAT
Thank you !
from android-emulator-runner.
The action supports multi-line script, e.g.
script: |
./gradlew connectedCheck
adb logcat
from android-emulator-runner.
Yes, I tried it
- name: Android Emulator test
uses: ReactiveCircus/[email protected]
with:
api-level: 28
disable-animations: true
arch: x86_64
profile: Nexus 6
script: |
./gradlew cAT
echo ${{ github.workspace }}
ls ${{ github.workspace }} -la
adb logcat -d > ${{ github.workspace }}/owncloudApp/build/reports/androidTests/connected/logcat.txt
- uses: actions/upload-artifact@v2
if: failure()
with:
name: owncloudApp-Espresso-test-report
path: ${{ github.workspace }}/owncloudApp/build/reports/androidTests/connected/*
But when you look into job https://github.com/hannesa2/owncloud-android/pull/5/checks?check_run_id=701706066 you see, the command is fired before the ./gradlew cAT
is finished (when I understood right). --> useless
from android-emulator-runner.
I think the commands you are referring to are just printed at the start of the action but not executed, due to the gradlew cAT command failing and the step finishing early. What happens if you move those commands to a separate if failure() step after the “Android Emulator test” step and before the upload-artifact step?
from android-emulator-runner.
What happens if you move those commands to a separate if failure() step after the “Android Emulator test” step and before the upload-artifact step?
Sorry there is no point doing it, the emulator is killed in step Android Emulator test
any adb
command will not work anymore.
To be honest, I see only a solution in android-emulator-runner to separate processes in multi line scripts. But I'm to dump to do this, I guess @ychescale9 you are the right person !
from android-emulator-runner.
Right now the action will exit with a failure whenever the script throws a non-0 exit code. I guess we could instead cache the error and still have the action execute the rest of the scripts and throws the error at the end. But I think it's much better to just write a custom script to catch the error instead of having the action does this by default which is not the expected behavior for most people.
I just had a another look at your workflow and looks like you can just do the following?
script: |
adb logcat > ${{ github.workspace }}/owncloudApp/build/reports/androidTests/connected/logcat.txt &
./gradlew cAT
from android-emulator-runner.
I guess we could instead cache the error and still have the action execute the rest of the scripts and throws the error at the end.
This is in my point of view the most elegant solution
But I think it's much better to just write a custom script to catch the error
Following this idea how can I use ${{ github.workspace }}
in a shell script ?
script: | adb logcat -d > ${{ github.workspace }}/owncloudApp/build/reports/androidTests/connected/logcat.txt ./gradlew cAT
Sorry, this adb logcat ... must be run after ./gradlew cAT and not before
from android-emulator-runner.
Sorry you need to continuously stream logcat in the background. Updated the snippet above.
from android-emulator-runner.
And if you just do:
adb logcat -c
adb logcat *:E -v color &
./gradlew connectedCheck
You'll be able to see the error logs from logcat since you started running ./gradlew connectedCheck
all from the console log without having to upload and download them.
from android-emulator-runner.
Sorry you need to continuously stream logcat in the background. Updated the snippet above.
That's a smart idea !
script: |
adb logcat > ${{ github.workspace }}/owncloudApp/build/reports/androidTests/connected/logcat.txt &
./gradlew cAT
But it don't upload logcat.txt
I've no clue why
https://github.com/hannesa2/owncloud-android/pull/5/checks?check_run_id=703292637
... now I try the second proposal with direct print to console
from android-emulator-runner.
Btw, this
./gradlew cAT || adb logcat -d > ${{ github.workspace }}/owncloudApp/build/reports/androidTests/connected/logcat.txt
uploads the logcat.txt
but then the job is always successful
from android-emulator-runner.
And if you just do:
adb logcat -c adb logcat *:E -v color & ./gradlew connectedCheck
You'll be able to see the error logs from logcat since you started running
./gradlew connectedCheck
all from the console log without having to upload and download them.
Works ! But the color output is useless
https://github.com/hannesa2/owncloud-android/pull/5/checks?check_run_id=703314765
from android-emulator-runner.
Great! I haven't done adb
for a while and I know there are a lot of things you can do like filtering the logs with tag etc.
from android-emulator-runner.
I'm going to close this issue now. Please feel free to re-open or create another one if you run into other issues 😃
from android-emulator-runner.
Related Issues (20)
- Platform not found
- Cannot get arm64 emulator up and running on ubuntu-latest HOT 4
- UniversalExceptionRaise: (os/kern) failure (5)
- Cannot get arm64-v8a emulator up and running on macos UniversalExceptionRaise: (os/kern) failure (5)
- Job hangs after UI testing is terminated
- Runner action hangs after killing emulator with stop: not implemented HOT 17
- `PANIC: Avd's CPU Architecture 'arm64' is not supported by the QEMU2 emulator on x86_64 host.` HOT 4
- Failed to install split APK(s) HOT 3
- adb cannot connect on ubuntu-latest today HOT 1
- Allow multiline scripts
- Emulator fails to start with `arch: arm64-v8a` + `target: google_apis` running API 34 HOT 6
- Starting a Chrome browser in Android emulator caused abortion HOT 3
- Instrumentation tests are skipped with JUnit 5 HOT 3
- Error changing dalvik-cache ownership : Permission denied
- no devices/emulators found HOT 3
- Feature request: Add setting to stop the action from downloading sdk tools HOT 2
- Isn't there alternative for Bitbucket?
- Error on Ubuntu-24.04
- 16k page size
- adb: device 'emulator-5554' not found HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-emulator-runner.