@@ -44,11 +44,13 @@ jobs:
44
44
./gradlew assembleDebug --stacktrace
45
45
46
46
# Run tests with coverage - allow test failures
47
- ./gradlew testDebugUnitTest jacocoTestReport --stacktrace || {
47
+ ./gradlew testDebugUnitTest jacocoTestReport --stacktrace
48
+ TEST_RESULT=$?
49
+ if [ $TEST_RESULT -ne 0 ]; then
48
50
echo "Some tests failed, but continuing to check for coverage data..."
49
51
# Even if tests fail, JaCoCo should generate a report with partial coverage
50
52
# from the tests that did pass
51
- }
53
+ fi
52
54
53
55
# Check if the report was generated with content
54
56
if [ -f build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml ]; then
@@ -192,9 +194,11 @@ jobs:
192
194
./gradlew assembleDebugAndroidTest
193
195
194
196
# Run only a single test class with coverage explicitly enabled
195
- adb shell am instrument -w -e coverage true -e class tests.database.DatabaseInitializationTest io.split.android.android_client.test/androidx.test.runner.AndroidJUnitRunner || {
197
+ adb shell am instrument -w -e coverage true -e class tests.database.DatabaseInitializationTest io.split.android.android_client.test/androidx.test.runner.AndroidJUnitRunner
198
+ TEST_RESULT=$?
199
+ if [ $TEST_RESULT -ne 0 ]; then
196
200
echo "Some instrumented tests failed, but continuing to check for coverage data..."
197
- }
201
+ fi
198
202
199
203
# Create directory for coverage files
200
204
mkdir -p build/outputs/code_coverage/debugAndroidTest/connected/
@@ -217,9 +221,11 @@ jobs:
217
221
find build -name "*.ec" -o -name "*.exec"
218
222
219
223
# Run the JaCoCo report task
220
- ./gradlew jacocoAndroidTestReport || {
224
+ ./gradlew jacocoAndroidTestReport
225
+ REPORT_RESULT=$?
226
+ if [ $REPORT_RESULT -ne 0 ]; then
221
227
echo "Failed to generate Android test coverage report, but continuing..."
222
- }
228
+ fi
223
229
224
230
# Check if the Android test report was generated with content
225
231
if [ -f build/reports/jacoco/jacocoAndroidTestReport/jacocoAndroidTestReport.xml ]; then
0 commit comments