Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df136c49 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "SystemServer coverage: modify log parsing" into main

parents ca266891 7b5ace2c
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -13,7 +13,8 @@ script -q ${COVERAGE_TMP_FOLDER}/atest_log \
  --jacocoagent-path gs://tradefed_test_resources/teams/code_coverage/jacocoagent.jar \
  --jacocoagent-path gs://tradefed_test_resources/teams/code_coverage/jacocoagent.jar \
  --coverage --coverage-toolchain JACOCO'
  --coverage --coverage-toolchain JACOCO'


COVERAGE_COLLECTED=$(rg 'Test Logs have been saved in ' ${COVERAGE_TMP_FOLDER}/atest_log | sed -e 's/^.* //' -e 's/log.*$/log/')
# "Atest results and logs directory: /tmp/path<CR><LF>" -> "/tmp/path"
COVERAGE_COLLECTED=$(rg 'Atest results and logs directory:' ${COVERAGE_TMP_FOLDER}/atest_log | cut -d ':' -f 2 | tr -d '\r' | xargs)


# Link source into the tmp folder
# Link source into the tmp folder
ln -s "${ANDROID_BUILD_TOP}"/packages/modules/Bluetooth/service/src ${COVERAGE_TMP_FOLDER}/com/android/server/bluetooth
ln -s "${ANDROID_BUILD_TOP}"/packages/modules/Bluetooth/service/src ${COVERAGE_TMP_FOLDER}/com/android/server/bluetooth
@@ -30,7 +31,7 @@ rm -rf ${COVERAGE_TMP_FOLDER}/ServiceBluetoothRobo_unzip/com/android/server/blue


# Generate report:
# Generate report:
# You may want to run "m jacoco-cli" if above command failed
# You may want to run "m jacoco-cli" if above command failed
java -jar "${ANDROID_BUILD_TOP}"/out/host/linux-x86/framework/jacoco-cli.jar report "${COVERAGE_COLLECTED}"/invocation_*/inv_*/coverage_*.ec --classfiles ${COVERAGE_TMP_FOLDER}/ServiceBluetoothRobo_unzip --html ${COVERAGE_TMP_FOLDER}/coverage --name coverage.html --sourcefiles ${COVERAGE_TMP_FOLDER}
java -jar "${ANDROID_BUILD_TOP}"/out/host/linux-x86/framework/jacoco-cli.jar report "${COVERAGE_COLLECTED}"/log/invocation_*/inv_*/coverage_*.ec --classfiles ${COVERAGE_TMP_FOLDER}/ServiceBluetoothRobo_unzip --html ${COVERAGE_TMP_FOLDER}/coverage --name coverage.html --sourcefiles ${COVERAGE_TMP_FOLDER}


# Start python server and expose URL
# Start python server and expose URL
printf "Url to connect to the coverage \033[32m http://%s:8000 \033[0m\n" "$(hostname)"
printf "Url to connect to the coverage \033[32m http://%s:8000 \033[0m\n" "$(hostname)"