Now using right sdkmanager but More debug

Change-Id: If32a685aefebe5c3d18a3e6023b9a681452ab7fe
ja/edge-to-edge-dropshots
Jose Alcérreca 6 months ago
parent 4c324f4b8b
commit b81ebd2f3d

@ -247,8 +247,10 @@ jobs:
include: include:
- api-level: 27 - api-level: 27
profile: pixel_5 profile: pixel_5
target: google_apis
- api-level: 33 - api-level: 33
profile: pixel_fold profile: pixel_fold
target: google_apis
# Enable when a new version of the runner is released. Currently v2.30.1 # 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 # https://github.com/ReactiveCircus/android-emulator-runner/releases/tag/v2.30.1
# Also, change from VanillaIceCream to 35 when that image is available # 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 mv ${{ env.ANDROID_HOME}}/cmdline-tools/11479570 ${{ env.ANDROID_HOME}}/cmdline-tools/latest
echo ${{ env.ANDROID_HOME}}/cmdline-tools/latest/bin >> $GITHUB_PATH echo ${{ env.ANDROID_HOME}}/cmdline-tools/latest/bin >> $GITHUB_PATH
- name: Debug Environment - name: Print debug avd
run: | run: |
echo "PATH: $PATH" ls -alR ~/.android/avd/
echo "SHELL: $SHELL"
shell: bash
- name: Print debug avdmanager list
run: avdmanager list
- name: Print debug sdkmanager
run: |
sdkmanager --version
which sdkmanager
which avdmanager
- name: Build projects and run instrumented screenshot tests - name: Build projects and run instrumented screenshot tests
id: dropshotsverify id: dropshotsverify
@ -330,6 +321,11 @@ jobs:
heap-size: 600M heap-size: 600M
profile: ${{ matrix.profile }} profile: ${{ matrix.profile }}
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none 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 # Run tests, if they fail, record screenshots and exit with a failure
script: > script: >
./gradlew connectedDemoDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.google.samples.apps.nowinandroid.ui.InstrumentedScreenshotTests --daemon ./gradlew connectedDemoDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.google.samples.apps.nowinandroid.ui.InstrumentedScreenshotTests --daemon

@ -18,7 +18,6 @@ package com.google.samples.apps.nowinandroid.ui
import android.graphics.Bitmap import android.graphics.Bitmap
import android.util.Log import android.util.Log
import android.view.WindowInsets
import androidx.core.view.WindowInsetsCompat import androidx.core.view.WindowInsetsCompat
import androidx.test.core.app.takeScreenshot import androidx.test.core.app.takeScreenshot
import androidx.test.espresso.device.DeviceInteraction.Companion.setClosedMode import androidx.test.espresso.device.DeviceInteraction.Companion.setClosedMode
@ -162,8 +161,8 @@ class EdgeToEdgeTest {
).bottom ).bottom
width = metrics.bounds.width() width = metrics.bounds.width()
} }
Log.d("jalc", "width: $width" ) Log.d("jalc", "width: $width")
Log.d("jalc", "topInset: $topInset" ) Log.d("jalc", "topInset: $topInset")
// Crop the top, adding extra pixels to check continuity // Crop the top, adding extra pixels to check continuity
val bitmap = takeScreenshot().let { val bitmap = takeScreenshot().let {
Bitmap.createBitmap(it, 0, 0, width!!, (topInset!! * 2)) Bitmap.createBitmap(it, 0, 0, width!!, (topInset!! * 2))
@ -186,8 +185,8 @@ class EdgeToEdgeTest {
width = metrics.bounds.width() width = metrics.bounds.width()
height = metrics.bounds.height() height = metrics.bounds.height()
} }
Log.d("jalc", "height: $height" ) Log.d("jalc", "height: $height")
Log.d("jalc", "bottomInset: $bottomInset" ) Log.d("jalc", "bottomInset: $bottomInset")
// Crop the top, adding extra pixels to check continuity // Crop the top, adding extra pixels to check continuity
val bitmap = takeScreenshot().let { val bitmap = takeScreenshot().let {
Bitmap.createBitmap(it, 0, height!! - (bottomInset!! * 2), width!!, (bottomInset!! * 2)) Bitmap.createBitmap(it, 0, height!! - (bottomInset!! * 2), width!!, (bottomInset!! * 2))

Loading…
Cancel
Save