CI experiment

Change-Id: I5f11e19f53c66d3dd546f935c9ba74014e0cb2f3
ja/edge-to-edge-dropshots
Jose Alcérreca 6 months ago
parent 784f94c7de
commit ece23564cb

@ -324,11 +324,18 @@ jobs:
# Run tests, if they fail, record screenshots and exit with a failure
script: >
set +e ;
./gradlew connectedDemoDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.google.samples.apps.nowinandroid.ui.InstrumentedScreenshotTests --daemon
|| echo "Recording new screenshots"
; ./gradlew connectedDemoDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.google.samples.apps.nowinandroid.ui.InstrumentedScreenshotTests -Pdropshots.record --daemon --stacktrace
; echo "Done recording new screenshots, exiting with failure"
; echo "newgoldens=true" >> $GITHUB_OUTPUT ; exit 5
if ./gradlew connectedDemoDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.google.samples.apps.nowinandroid.ui.InstrumentedScreenshotTests --daemon ; then
echo "All screenshot tests passed"
else
echo "Verification failed. Recording new reference images"
if ./gradlew connectedDemoDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.google.samples.apps.nowinandroid.ui.InstrumentedScreenshotTests -Pdropshots.record --daemon --stacktrace ; then
echo "New goldens recorded, no issues"
; echo "newgoldens=true" >> $GITHUB_OUTPUT
else
echo "Error while recording new goldens"
; exit 5
fi
fi
- name: Prevent pushing new screenshots if this is a fork
id: checkfork_screenshots_instrumented

Loading…
Cancel
Save