Skip to content

Commit f321828

Browse files
authored
fix: no need to copy report in 2 places
1 parent e63573e commit f321828

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

scripts/generate_android_coverage.sh

+2-13
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ LOCAL_TEST_RESULT_PATH="./$MAIN_PROJECT_MODULE/build/outputs/androidTest-results
5050
mkdir -p ./$MAIN_PROJECT_MODULE/build/outputs/code_coverage/connected/
5151
mkdir -p ./$MAIN_PROJECT_MODULE/build/outputs/code_coverage/
5252
mkdir -p ./$MAIN_PROJECT_MODULE/build/outputs/androidTest-results/connected/
53-
# Additional directory for dorny/test-reporter expected paths
5453
mkdir -p ./$MAIN_PROJECT_MODULE/build/outputs/connected/
5554

5655
# Function to check if a file is empty (zero bytes)
@@ -366,17 +365,8 @@ is_valid_junit_xml() {
366365
if [ -f "$LOCAL_TEST_RESULT_PATH" ] && [ -s "$LOCAL_TEST_RESULT_PATH" ]; then
367366
if is_valid_junit_xml "$LOCAL_TEST_RESULT_PATH"; then
368367
echo "✅ Valid JUnit XML test results found! at $LOCAL_TEST_RESULT_PATH "
369-
370-
# Path for the second location expected by dorny/test-reporter
371-
DORNY_TEST_RESULT_PATH="./$MAIN_PROJECT_MODULE/build/outputs/connected/TEST-${APP_PACKAGE}.xml"
372-
373-
# Copy to the second expected path
374-
cp "$LOCAL_TEST_RESULT_PATH" "$DORNY_TEST_RESULT_PATH"
375-
376-
echo "Copied XML results to $DORNY_TEST_RESULT_PATH"
377-
378-
# Make the XML files more compatible with dorny/test-reporter if needed
379-
for XML_PATH in "$LOCAL_TEST_RESULT_PATH" "$DORNY_TEST_RESULT_PATH"; do
368+
369+
for XML_PATH in "$LOCAL_TEST_RESULT_PATH"; do
380370
# Update timestamps if they're missing or malformed
381371
sed -i 's/timestamp="[^"]*"/timestamp="'"$(date -u +"%Y-%m-%dT%H:%M:%S")"'"/g' "$XML_PATH" 2>/dev/null || true
382372

@@ -385,7 +375,6 @@ if [ -f "$LOCAL_TEST_RESULT_PATH" ] && [ -s "$LOCAL_TEST_RESULT_PATH" ]; then
385375
sed -i 's/<testsuite /<testsuite name=\"'"$APP_PACKAGE"'\" hostname="localhost" /g' "$XML_PATH" 2>/dev/null || true
386376
done
387377

388-
echo "✅ XML test results ready for dorny/test-reporter at both expected locations!"
389378
else
390379
echo "⚠️ Retrieved XML is not a valid JUnit test result file."
391380
rm -f "$LOCAL_TEST_RESULT_PATH" # Remove invalid file

0 commit comments

Comments
 (0)