Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions .github/workflows/build-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,19 @@ jobs:
run: make test

# Enable hardware virtualisation - speeds up emulator
# TODO FixMe
# - name: Enable KVM
# run: |
# echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
# sudo udevadm control --reload-rules
# sudo udevadm trigger --name-match=kvm
#
# - name: Integration Test
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: 29
# arch: x86_64
# working-directory: ./client
# script: make integration-test
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: Integration Test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
arch: x86_64
working-directory: ./client
script: make integration-test

- name: Decode Keystore
if: inputs.publish
Expand Down
11 changes: 10 additions & 1 deletion client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,13 @@ test:

.PHONY: integration-test
integration-test:
./gradlew connectedDebugAndroidTest
#./gradlew connectedDebugAndroidTest -Pandroid.experimental.androidTest.useUnifiedTestPlatform=false --no-daemon --info
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This commented-out line appears to be from a previous implementation. To improve code clarity and maintainability, it's best to remove unused, commented-out code.

./gradlew assembleDebug assembleDebugAndroidTest
adb install -t app/build/outputs/apk/debug/app-debug.apk
adb install -t app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk
#adb shell am instrument -w -e no-window true com.jackpf.locationhistory.client.test/androidx.test.runner.AndroidJUnitRunner
adb shell am instrument -w com.jackpf.locationhistory.client.test/androidx.test.runner.AndroidJUnitRunner \
| tee /dev/tty \
| grep -v "INSTRUMENTATION_STATUS" \
| grep -q "OK ("

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class MainActivityTest {
public void activityLaunches() {
try (ActivityScenario<MainActivity> scenario = ActivityScenario.launch(MainActivity.class)) {
scenario.onActivity(activity ->
assertEquals(MainActivity.class, activity.getClass())
assertEquals(MainActivity.class, activity.getClass())
);
}
}
Expand All @@ -27,4 +27,12 @@ public void activityReachesResumedState() {
assertEquals(Lifecycle.State.RESUMED, scenario.getState());
}
}

// @Test
// public void activityReachesResumedStatef() {
// try (ActivityScenario<MainActivity> scenario = ActivityScenario.launch(MainActivity.class)) {
// assertEquals(Lifecycle.State.RESUMED, scenario.getState());
// assertEquals(1, 2);
// }
// }
}
6 changes: 5 additions & 1 deletion client/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.nonTransitiveRClass=true
# Give ADB more time to connect (5 mins)
android.adbOptions.timeOutInMs=300000
# Increase the UTP gRPC timeout
android.experimental.androidTest.numInstallationRetries=3