Skip to content

Commit 697e393

Browse files
committed
Re-record every Apple Health sensors reference
1 parent bcdf2a1 commit 697e393

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎.github/workflows/record_snapshots.yml‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ jobs:
5454
-project HomeAssistant.xcodeproj
5555
-scheme Tests-Unit
5656
57+
# The badge is small enough that its removal stays inside the comparison's tolerance, so
58+
# the references that draw it do not all fail. Dropping the ones that render the Apple
59+
# Health row makes them missing instead, which is always re-recorded.
60+
- name: Drop the references that render the Apple Health row
61+
run: >-
62+
rm -f
63+
Tests/App/Settings/__Snapshots__/SensorListView.test/sensorListWithOneServerShowsItsSensors.*.png
64+
Tests/App/Settings/__Snapshots__/SensorListView.test/serverScopedSensorListIsTitledAfterItsServer.*.png
65+
Tests/App/Settings/__Snapshots__/SensorListView.test/serverScopedSensorListShowsItsSensors.*.png
66+
5767
# `SNAPSHOT_TESTING_RECORD` is read from the test process environment, so it has to
5868
# reach the simulator through the scheme rather than the runner's shell.
5969
- name: Record failing snapshots through the scheme
@@ -90,6 +100,18 @@ jobs:
90100
- name: Push re-recorded references
91101
run: |
92102
git checkout -- HomeAssistant.xcodeproj/xcshareddata/xcschemes/Tests-Unit.xcscheme
103+
# A reference the run failed to record would otherwise be committed as a deletion.
104+
for name in sensorListWithOneServerShowsItsSensors \
105+
serverScopedSensorListIsTitledAfterItsServer \
106+
serverScopedSensorListShowsItsSensors; do
107+
for mode in light dark; do
108+
path="Tests/App/Settings/__Snapshots__/SensorListView.test/$name.$mode.png"
109+
if [ ! -f "$path" ]; then
110+
echo "::error::$path was not recorded"
111+
exit 1
112+
fi
113+
done
114+
done
93115
git add -- 'Tests/App/Settings/__Snapshots__/SensorListView.test'
94116
if git diff --cached --quiet; then
95117
echo "No snapshot changed"

0 commit comments

Comments
 (0)