Commit d9bca16
test(codec): env-gate AVIF encode tests for slow virtualised CI
The macos-14 GitHub runner has no hardware AV1 encoder, so the AVIF
SwiftPM tests that go through ImageIO's software path can take many
minutes per case. Phase 4 capped each AVIF test at .timeLimit(.minutes(1))
but a 4-case parameterised SSIM matrix plus avifBounds plus
avifRoundTrip plus the .avif arm of the decoder dispatch sweep
collectively blew past the workflow's 30-minute job-timeout on a cold
\`swift test\`.
Gate AVIF encode tests on \`IMAGECRC_TEST_SKIP_AVIF != 1\` (mirrors the
existing IMAGECRC_TEST_REQUIRE_PNGQUANT pattern). Set the var to "1"
at workflow level so CI skips the slow path; locally it stays unset so
Apple Silicon hardware AV1 keeps them sub-second and they remain part
of the regression net.
The decoder-dispatch parameterised test filters .avif out of its
arguments via a static helper instead of \`.enabled(if:)\`, since the
gate applies to one of N cases rather than the whole test.
AVIF DECODE remains untouched — only encode is the bottleneck.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ac7f74e commit d9bca16
5 files changed
Lines changed: 23 additions & 4 deletions
File tree
- .github/workflows
- Tests/CodecTests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
9 | 19 | | |
10 | 20 | | |
11 | 21 | | |
| |||
33 | 43 | | |
34 | 44 | | |
35 | 45 | | |
36 | | - | |
| 46 | + | |
37 | 47 | | |
38 | 48 | | |
39 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
52 | 53 | | |
53 | | - | |
| 54 | + | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
0 commit comments