From b81ebd2f3ddcaadf7739e6af4cec706edb60741a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Alc=C3=A9rreca?= Date: Mon, 27 May 2024 10:14:44 +0000 Subject: [PATCH] Now using right sdkmanager but More debug Change-Id: If32a685aefebe5c3d18a3e6023b9a681452ab7fe --- .github/workflows/Build.yaml | 22 ++++++++----------- .../apps/nowinandroid/ui/EdgeToEdgeTest.kt | 9 ++++---- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index af137e9e6..59bd4487e 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -247,8 +247,10 @@ jobs: include: - api-level: 27 profile: pixel_5 + target: google_apis - api-level: 33 profile: pixel_fold + target: google_apis # Enable when a new version of the runner is released. Currently v2.30.1 # https://github.com/ReactiveCircus/android-emulator-runner/releases/tag/v2.30.1 # Also, change from VanillaIceCream to 35 when that image is available @@ -302,20 +304,9 @@ jobs: mv ${{ env.ANDROID_HOME}}/cmdline-tools/11479570 ${{ env.ANDROID_HOME}}/cmdline-tools/latest echo ${{ env.ANDROID_HOME}}/cmdline-tools/latest/bin >> $GITHUB_PATH - - name: Debug Environment + - name: Print debug avd run: | - echo "PATH: $PATH" - echo "SHELL: $SHELL" - shell: bash - - - name: Print debug avdmanager list - run: avdmanager list - - - name: Print debug sdkmanager - run: | - sdkmanager --version - which sdkmanager - which avdmanager + ls -alR ~/.android/avd/ - name: Build projects and run instrumented screenshot tests id: dropshotsverify @@ -330,6 +321,11 @@ jobs: heap-size: 600M profile: ${{ matrix.profile }} emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + # TODO DEBUG + pre-emulator-launch-script: | + which sdkmanager + sdkmanager --version + sdkmanager --install 'system-images;android-33;default;x86_64' --channel=0 # Run tests, if they fail, record screenshots and exit with a failure script: > ./gradlew connectedDemoDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.google.samples.apps.nowinandroid.ui.InstrumentedScreenshotTests --daemon diff --git a/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/EdgeToEdgeTest.kt b/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/EdgeToEdgeTest.kt index 1447dd716..6a5831b02 100644 --- a/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/EdgeToEdgeTest.kt +++ b/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/EdgeToEdgeTest.kt @@ -18,7 +18,6 @@ package com.google.samples.apps.nowinandroid.ui import android.graphics.Bitmap import android.util.Log -import android.view.WindowInsets import androidx.core.view.WindowInsetsCompat import androidx.test.core.app.takeScreenshot import androidx.test.espresso.device.DeviceInteraction.Companion.setClosedMode @@ -162,8 +161,8 @@ class EdgeToEdgeTest { ).bottom width = metrics.bounds.width() } - Log.d("jalc", "width: $width" ) - Log.d("jalc", "topInset: $topInset" ) + Log.d("jalc", "width: $width") + Log.d("jalc", "topInset: $topInset") // Crop the top, adding extra pixels to check continuity val bitmap = takeScreenshot().let { Bitmap.createBitmap(it, 0, 0, width!!, (topInset!! * 2)) @@ -186,8 +185,8 @@ class EdgeToEdgeTest { width = metrics.bounds.width() height = metrics.bounds.height() } - Log.d("jalc", "height: $height" ) - Log.d("jalc", "bottomInset: $bottomInset" ) + Log.d("jalc", "height: $height") + Log.d("jalc", "bottomInset: $bottomInset") // Crop the top, adding extra pixels to check continuity val bitmap = takeScreenshot().let { Bitmap.createBitmap(it, 0, height!! - (bottomInset!! * 2), width!!, (bottomInset!! * 2))