Skip to content

Commit 4752a08

Browse files
authored
Collect and attach android logcat log for tests execution. (#154)
1 parent 413cc47 commit 4752a08

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/OCV-PR-4.x-Android-Test.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,15 @@ jobs:
9191
working-directory: ${{ github.workspace }}/build
9292
- name: Touch device
9393
run: |
94+
${{ env.ANDROID_HOME }}/platform-tools/adb kill-server
95+
${{ env.ANDROID_HOME }}/platform-tools/adb start-server
9496
${{ env.ANDROID_HOME }}/platform-tools/adb devices
9597
${{ env.ANDROID_HOME }}/platform-tools/adb shell cat /proc/cpuinfo
98+
- name: Start adb logging
99+
run: |
100+
rm -f android_logcat.log
101+
${{ env.ANDROID_HOME }}/platform-tools/adb logcat -c
102+
nohup ${{ env.ANDROID_HOME }}/platform-tools/adb logcat 2>&1 | tee android_logcat.log &
96103
- name: Test Java
97104
timeout-minutes: 60
98105
id: java-test
@@ -101,10 +108,15 @@ jobs:
101108
${{ env.ANDROID_HOME }}/platform-tools/adb uninstall org.opencv.tests || 0
102109
./gradlew -i tests_module:connectedAndroidTest
103110
working-directory: ${{ github.workspace }}/build/android_test
111+
- name: Stop adb logging
112+
run: ${{ env.ANDROID_HOME }}/platform-tools/adb kill-server
113+
if: ${{ always() }}
104114
- name: Save Unit Test Results
105115
timeout-minutes: 5
106116
if: ${{ always() }}
107117
uses: actions/upload-artifact@v4
108118
with:
109119
name: android-junit-html
110-
path: ${{ github.workspace }}/build/android_test/tests_module/build/reports/androidTests/connected/
120+
path: |
121+
${{ github.workspace }}/build/android_test/tests_module/build/reports/androidTests/connected/
122+
${{ github.workspace }}/android_logcat.log

0 commit comments

Comments
 (0)