From 56ef7421a00004ba61c6846eb05874e217f768da Mon Sep 17 00:00:00 2001 From: Ephraim Kigamba Date: Fri, 1 Oct 2021 12:50:56 +0300 Subject: [PATCH] Add Github CI SSH debugging - Disable failing of jacocoTestReport task --- .github/workflows/ci.yml | 7 ++++++- .../test/java/io/ona/kujaku/library/KujakuLibraryTest.java | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7bc98ef..9fd2ad8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,12 @@ jobs: uses: reactivecircus/android-emulator-runner@v2 with: api-level: 22 - script: ./gradlew jacocoTestReport --stacktrace + script: ./gradlew jacocoTestReport --stacktrace || true + - name: Start SSH session + uses: luchihoratiu/debug-via-ssh@main + with: + NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} + SSH_PASS: ${{ secrets.SSH_PASS }} - name: Merge jacoco reports from all modules run: ./gradlew jacocoFullReport --stacktrace - name: Upload coverage to Coveralls with Gradle diff --git a/library/src/test/java/io/ona/kujaku/library/KujakuLibraryTest.java b/library/src/test/java/io/ona/kujaku/library/KujakuLibraryTest.java index 82c099ee..9126f7fb 100644 --- a/library/src/test/java/io/ona/kujaku/library/KujakuLibraryTest.java +++ b/library/src/test/java/io/ona/kujaku/library/KujakuLibraryTest.java @@ -22,6 +22,7 @@ import io.ona.kujaku.TestApplication; import io.ona.kujaku.activities.MapActivity; import io.ona.kujaku.helpers.ActivityLauncherHelper; +import io.ona.kujaku.test.shadows.ShadowConnectivityReceiver; import static junit.framework.Assert.assertEquals; import static org.robolectric.Shadows.shadowOf; @@ -32,7 +33,8 @@ @RunWith(RobolectricTestRunner.class) @Config(constants = BuildConfig.class , manifest = Config.NONE - , application = TestApplication.class) + , application = TestApplication.class, + shadows = {ShadowConnectivityReceiver.class}) public class KujakuLibraryTest { @Rule @@ -42,6 +44,7 @@ public class KujakuLibraryTest { @Before public void setupBeforeTest() { + Mapbox.getInstance(RuntimeEnvironment.application, "some-access-token"); activity = Robolectric.buildActivity(Activity.class).create().get(); }