Skip to content

Commit f70e2df

Browse files
committed
Fix syntax error
1 parent b8fb2a7 commit f70e2df

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/sonarqube.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ jobs:
4444
./gradlew assembleDebug --stacktrace
4545
4646
# 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
4850
echo "Some tests failed, but continuing to check for coverage data..."
4951
# Even if tests fail, JaCoCo should generate a report with partial coverage
5052
# from the tests that did pass
51-
}
53+
fi
5254
5355
# Check if the report was generated with content
5456
if [ -f build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml ]; then
@@ -192,9 +194,11 @@ jobs:
192194
./gradlew assembleDebugAndroidTest
193195
194196
# 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
196200
echo "Some instrumented tests failed, but continuing to check for coverage data..."
197-
}
201+
fi
198202
199203
# Create directory for coverage files
200204
mkdir -p build/outputs/code_coverage/debugAndroidTest/connected/
@@ -217,9 +221,11 @@ jobs:
217221
find build -name "*.ec" -o -name "*.exec"
218222
219223
# Run the JaCoCo report task
220-
./gradlew jacocoAndroidTestReport || {
224+
./gradlew jacocoAndroidTestReport
225+
REPORT_RESULT=$?
226+
if [ $REPORT_RESULT -ne 0 ]; then
221227
echo "Failed to generate Android test coverage report, but continuing..."
222-
}
228+
fi
223229
224230
# Check if the Android test report was generated with content
225231
if [ -f build/reports/jacoco/jacocoAndroidTestReport/jacocoAndroidTestReport.xml ]; then

0 commit comments

Comments
 (0)