Skip to content

Commit d7cd04c

Browse files
committed
Adding checkpoints to measure elapsed time in the Drone test
Mainly for profiling reasons, not to be merged. Signed-off-by: Philipp Hasper <vcs@hasper.info>
1 parent 3fb0c26 commit d7cd04c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scripts/runCombinedTest.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ DRONE_PULL_REQUEST=$1
88
LOG_USERNAME=$2
99
LOG_PASSWORD=$3
1010
DRONE_BUILD_NUMBER=$4
11+
_CP=$SECONDS; checkpoint() { echo "=== +$(($SECONDS - $_CP))s === $*"; _CP=$SECONDS; }
1112

1213
function upload_logcat() {
1314
log_filename="${DRONE_PULL_REQUEST}_logcat.txt.xz"
@@ -21,14 +22,20 @@ function upload_logcat() {
2122

2223
scripts/deleteOldComments.sh "master" "IT" "$DRONE_PULL_REQUEST"
2324

25+
checkpoint "assembleGplayDebugAndroidTest"
2426
./gradlew assembleGplayDebugAndroidTest
2527

28+
checkpoint "Waiting for emulator"
2629
scripts/wait_for_emulator.sh || exit 1
2730

31+
checkpoint "installGplayDebugAndroidTest"
2832
./gradlew installGplayDebugAndroidTest
33+
34+
checkpoint "Waiting for server"
2935
scripts/wait_for_server.sh "server" || exit 1
3036

3137
# clear logcat and start saving it to file
38+
checkpoint "createGplayDebugCoverageReport"
3239
adb logcat -c
3340
adb logcat > logcat.txt &
3441
LOGCAT_PID=$!
@@ -37,6 +44,7 @@ LOGCAT_PID=$!
3744
-Dorg.gradle.jvmargs="--add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.nio.channels=ALL-UNNAMED --add-exports java.base/sun.nio.ch=ALL-UNNAMED"
3845

3946
stat=$?
47+
checkpoint "Tests finished (exit code: $stat)"
4048
# stop saving logcat
4149
kill $LOGCAT_PID
4250

0 commit comments

Comments
 (0)