|
54 | 54 | -project HomeAssistant.xcodeproj |
55 | 55 | -scheme Tests-Unit |
56 | 56 |
|
| 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 | +
|
57 | 67 | # `SNAPSHOT_TESTING_RECORD` is read from the test process environment, so it has to |
58 | 68 | # reach the simulator through the scheme rather than the runner's shell. |
59 | 69 | - name: Record failing snapshots through the scheme |
@@ -90,6 +100,18 @@ jobs: |
90 | 100 | - name: Push re-recorded references |
91 | 101 | run: | |
92 | 102 | 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 |
93 | 115 | git add -- 'Tests/App/Settings/__Snapshots__/SensorListView.test' |
94 | 116 | if git diff --cached --quiet; then |
95 | 117 | echo "No snapshot changed" |
|
0 commit comments