CI experiment

Change-Id: I5f11e19f53c66d3dd546f935c9ba74014e0cb2f3
ben/dropshots
Jose Alcérreca 6 months ago
parent 19b62f85d1
commit 89231b8ef6

@ -324,11 +324,18 @@ jobs:
# 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: >
set +e ; set +e ;
./gradlew connectedDemoDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.google.samples.apps.nowinandroid.ui.InstrumentedScreenshotTests --daemon if ./gradlew connectedDemoDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.google.samples.apps.nowinandroid.ui.InstrumentedScreenshotTests --daemon ; then
|| echo "Recording new screenshots" echo "All screenshot tests passed"
; ./gradlew connectedDemoDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.google.samples.apps.nowinandroid.ui.InstrumentedScreenshotTests -Pdropshots.record --daemon --stacktrace else
; echo "Done recording new screenshots, exiting with failure" echo "Verification failed. Recording new reference images"
; echo "newgoldens=true" >> $GITHUB_OUTPUT ; exit 5 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 - name: Prevent pushing new screenshots if this is a fork
id: checkfork_screenshots_instrumented id: checkfork_screenshots_instrumented

Loading…
Cancel
Save