From e1473559fa9547ec07c1e4aea4f3c67c264413c0 Mon Sep 17 00:00:00 2001 From: jontayler Date: Mon, 27 Sep 2021 20:53:16 -0400 Subject: [PATCH 1/7] First attempt to restore the test. --- .../android/stardroid/test/DynamicStarMapActivityTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/androidTest/java/com/google/android/stardroid/test/DynamicStarMapActivityTest.java b/app/src/androidTest/java/com/google/android/stardroid/test/DynamicStarMapActivityTest.java index b795d4167..3d4884d3b 100644 --- a/app/src/androidTest/java/com/google/android/stardroid/test/DynamicStarMapActivityTest.java +++ b/app/src/androidTest/java/com/google/android/stardroid/test/DynamicStarMapActivityTest.java @@ -79,7 +79,7 @@ public void disableCalibrationDialog() { private static final String TAG = "STARTEST"; - //@Test + @Test public void testSkyMapTouchControlsShowAndThenGo() throws Exception { // Wait for initial controls to go away. This is bad. // Perhaps use idling resources? From 478342e9541eaec343675147c2b63f10783280da Mon Sep 17 00:00:00 2001 From: jontayler Date: Tue, 28 Sep 2021 09:31:30 -0400 Subject: [PATCH 2/7] Longshot attempt to see some device logs when it crashes. --- .github/workflows/android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 2ea7bc2da..e0441f102 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -47,4 +47,4 @@ jobs: target: ${{ matrix.target }} arch: x86_64 profile: Nexus 6 - script: ./gradlew connectedGmsDebugAndroidTest -x lint --stacktrace + script: adb logcat & ./gradlew connectedGmsDebugAndroidTest -x lint --stacktrace From 402d6a128acbdd015e10bada3be15905580022f6 Mon Sep 17 00:00:00 2001 From: jontayler Date: Tue, 28 Sep 2021 10:16:17 -0400 Subject: [PATCH 3/7] Isolate the failing test. --- .github/workflows/android.yml | 10 +++++++++- .../stardroid/test/SplashScreenActivityTest.java | 6 +++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index e0441f102..74a728d40 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -47,4 +47,12 @@ jobs: target: ${{ matrix.target }} arch: x86_64 profile: Nexus 6 - script: adb logcat & ./gradlew connectedGmsDebugAndroidTest -x lint --stacktrace + script: adb logcat | grep Stardroid & ./gradlew connectedGmsDebugAndroidTest -x lint --stacktrace + + - run: ls + - run: ls app/build/reports/androidTests/connected/flavors/gms + - name: Grab logs + uses: actions/upload-artifact@v2 + with: + name: output-log-file + path: app/build/reports/androidTests/connected/flavors/gms/index.html diff --git a/app/src/androidTest/java/com/google/android/stardroid/test/SplashScreenActivityTest.java b/app/src/androidTest/java/com/google/android/stardroid/test/SplashScreenActivityTest.java index 7f2a4dcc2..ca644b508 100644 --- a/app/src/androidTest/java/com/google/android/stardroid/test/SplashScreenActivityTest.java +++ b/app/src/androidTest/java/com/google/android/stardroid/test/SplashScreenActivityTest.java @@ -57,7 +57,7 @@ protected void after() { @Rule public RuleChain chain = RuleChain.outerRule(preferenceCleanerRule).around(testRule); - @Test + //@Test public void showsWhatsNewAfterTandCs_newUser() throws InterruptedException { onView(withId(R.id.eula_box_text)).inRoot(isDialog()).check(matches(isDisplayed())); onView(withId(android.R.id.button1)).inRoot(isDialog()).perform(click()); @@ -69,7 +69,7 @@ public void showsWhatsNewAfterTandCs_newUser() throws InterruptedException { onView(withId(R.id.whats_new_box_text)).check(matches(isDisplayed())); } - @Test + //@Test public void showNoAcceptTandCs() throws InterruptedException { Log.d("TESTTEST", "Doing test"); onView(withId(R.id.eula_box_text)).inRoot(isDialog()).check(matches(isDisplayed())); @@ -80,7 +80,7 @@ public void showNoAcceptTandCs() throws InterruptedException { assertThat(testRule.getScenario().getState(), equalTo(Lifecycle.State.DESTROYED)); } - @Test + //@Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); From 7d30ed0d67cf81b051a404ddd19bcb4ad38724a4 Mon Sep 17 00:00:00 2001 From: jontayler Date: Tue, 28 Sep 2021 10:17:15 -0400 Subject: [PATCH 4/7] Fix indentation. --- .github/workflows/android.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 74a728d40..0762378dd 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -52,7 +52,7 @@ jobs: - run: ls - run: ls app/build/reports/androidTests/connected/flavors/gms - name: Grab logs - uses: actions/upload-artifact@v2 - with: - name: output-log-file - path: app/build/reports/androidTests/connected/flavors/gms/index.html + uses: actions/upload-artifact@v2 + with: + name: output-log-file + path: app/build/reports/androidTests/connected/flavors/gms/index.html From e93598fafcd194f2c31c6dfc9c85cc110b618d74 Mon Sep 17 00:00:00 2001 From: jontayler Date: Tue, 28 Sep 2021 15:15:20 -0400 Subject: [PATCH 5/7] enable one line at a time --- .../android/stardroid/test/DynamicStarMapActivityTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/androidTest/java/com/google/android/stardroid/test/DynamicStarMapActivityTest.java b/app/src/androidTest/java/com/google/android/stardroid/test/DynamicStarMapActivityTest.java index 3d4884d3b..32ca358b1 100644 --- a/app/src/androidTest/java/com/google/android/stardroid/test/DynamicStarMapActivityTest.java +++ b/app/src/androidTest/java/com/google/android/stardroid/test/DynamicStarMapActivityTest.java @@ -84,7 +84,7 @@ public void testSkyMapTouchControlsShowAndThenGo() throws Exception { // Wait for initial controls to go away. This is bad. // Perhaps use idling resources? Log.w(TAG, "Waiting...."); - Thread.sleep(FullscreenControlsManager.INITIALLY_SHOW_CONTROLS_FOR_MILLIS * 2); + /*Thread.sleep(FullscreenControlsManager.INITIALLY_SHOW_CONTROLS_FOR_MILLIS * 2); Log.w(TAG, "Click"); onView(withId(R.id.skyrenderer_view)).check(matches(isDisplayed())); onView(withId(R.id.main_sky_view_root)).perform(click()); @@ -97,5 +97,7 @@ public void testSkyMapTouchControlsShowAndThenGo() throws Exception { onView(withId(R.id.main_sky_view_root)).perform(click()); Thread.sleep(100); onView(withId(R.id.layer_buttons_control)).check(matches(not(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))); + + */ } } From af9701547904227ff435e62958e1e415de7eb3f3 Mon Sep 17 00:00:00 2001 From: jontayler Date: Tue, 28 Sep 2021 17:36:29 -0400 Subject: [PATCH 6/7] Might be trying to start the activity twice? --- .../android/stardroid/test/DynamicStarMapActivityTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/androidTest/java/com/google/android/stardroid/test/DynamicStarMapActivityTest.java b/app/src/androidTest/java/com/google/android/stardroid/test/DynamicStarMapActivityTest.java index 32ca358b1..980f33993 100644 --- a/app/src/androidTest/java/com/google/android/stardroid/test/DynamicStarMapActivityTest.java +++ b/app/src/androidTest/java/com/google/android/stardroid/test/DynamicStarMapActivityTest.java @@ -54,8 +54,7 @@ protected void after() { private SetupRule firstRule = new SetupRule(); - @Rule - public ActivityScenarioRule testRule = + private ActivityScenarioRule testRule = new ActivityScenarioRule(DynamicStarMapActivity.class); @Rule @@ -97,7 +96,7 @@ public void testSkyMapTouchControlsShowAndThenGo() throws Exception { onView(withId(R.id.main_sky_view_root)).perform(click()); Thread.sleep(100); onView(withId(R.id.layer_buttons_control)).check(matches(not(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))); - + */ } } From 165e8c5a59d671243f3858eb73663fe081890946 Mon Sep 17 00:00:00 2001 From: jontayler Date: Tue, 28 Sep 2021 17:55:00 -0400 Subject: [PATCH 7/7] A bit more adb logging. --- .github/workflows/android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 0762378dd..216c6b5af 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -47,7 +47,7 @@ jobs: target: ${{ matrix.target }} arch: x86_64 profile: Nexus 6 - script: adb logcat | grep Stardroid & ./gradlew connectedGmsDebugAndroidTest -x lint --stacktrace + script: adb logcat Stardroid:I *:W & ./gradlew connectedGmsDebugAndroidTest -x lint --stacktrace - run: ls - run: ls app/build/reports/androidTests/connected/flavors/gms