Debian Codegraph @

debian/patches/0004-Skip-flaky-test-during-autopkgtest-on-riscv64.patch

raw
1 From: "Dr. Tobias Quathamer" <[email protected]>
2 Date: Mon, 20 Oct 2025 11:33:09 +0200
3 Subject: Skip flaky test during autopkgtest on riscv64
4
5 Forwarded: not-needed
6 ---
7 internal/warpc/avif_integration_test.go | 9 +++++++++
8 internal/warpc/warpc_test.go | 18 ++++++++++++------
9 internal/warpc/webp_integration_test.go | 13 +++++++++++++
10 resources/images/imagetesting/testing.go | 2 +-
11 tpl/images/images_integration_test.go | 8 ++++++++
12 5 files changed, 43 insertions(+), 7 deletions(-)
13
14 diff --git a/internal/warpc/avif_integration_test.go b/internal/warpc/avif_integration_test.go
15 index 9b3b68c..0b783a1 100644
16 --- a/internal/warpc/avif_integration_test.go
17 +++ b/internal/warpc/avif_integration_test.go
18 @@ -6,9 +6,14 @@ import (
19
20 qt "github.com/frankban/quicktest"
21 "github.com/gohugoio/hugo/hugolib"
22 + "github.com/gohugoio/hugo/resources/images/imagetesting"
23 )
24
25 func TestAvifBasic(t *testing.T) {
26 + if imagetesting.SkipGoldenTests {
27 + t.Skip("Skip golden test on this architecture")
28 + }
29 +
30 files := `
31 -- hugo.toml --
32 -- assets/sunset.avif --
33 @@ -32,6 +37,10 @@ Encode avif from avif: {{ $avif := $image.Process "avif" }}|{{ $avif.RelPermalin
34 // GIF, and the libavif "repetitionCount" → Go "LoopCount" inversion (libavif
35 // -1 = infinite, image/gif 0 = infinite) is handled at the AVIF decoder boundary.
36 func TestAvifAnimatedToGif(t *testing.T) {
37 + if imagetesting.SkipGoldenTests {
38 + t.Skip("Skip golden test on this architecture")
39 + }
40 +
41 files := `
42 -- hugo.toml --
43 disableKinds = ["page", "section", "taxonomy", "term", "sitemap", "robotsTXT", "404"]
44 diff --git a/internal/warpc/warpc_test.go b/internal/warpc/warpc_test.go
45 index d193348..8a19652 100644
46 --- a/internal/warpc/warpc_test.go
47 +++ b/internal/warpc/warpc_test.go
48 @@ -17,6 +17,8 @@ import (
49 "context"
50 _ "embed"
51 "fmt"
52 + "os"
53 + "runtime"
54 "sync"
55 "sync/atomic"
56 "testing"
57 @@ -77,12 +79,16 @@ func TestKatex(t *testing.T) {
58 c.Assert(result.GetID(), qt.Equals, id)
59 })
60
61 - c.Run("Chemistry", func(c *qt.C) {
62 - id := uint32(32)
63 - result, err := runExpression(c, id, "C_p[\\ce{H2O(l)}] = \\pu{75.3 J // mol K}")
64 - c.Assert(err, qt.IsNil)
65 - c.Assert(result.GetID(), qt.Equals, id)
66 - })
67 + if runtime.GOARCH == "riscv64" && os.Getenv("AUTOPKGTEST_TMP") != "" {
68 + t.Skip("Skip flaky test during autopkgtest on riscv64")
69 + } else {
70 + c.Run("Chemistry", func(c *qt.C) {
71 + id := uint32(32)
72 + result, err := runExpression(c, id, "C_p[\\ce{H2O(l)}] = \\pu{75.3 J // mol K}")
73 + c.Assert(err, qt.IsNil)
74 + c.Assert(result.GetID(), qt.Equals, id)
75 + })
76 + }
77
78 c.Run("Invalid expression", func(c *qt.C) {
79 id := uint32(32)
80 diff --git a/internal/warpc/webp_integration_test.go b/internal/warpc/webp_integration_test.go
81 index 857b1c3..9200b4a 100644
82 --- a/internal/warpc/webp_integration_test.go
83 +++ b/internal/warpc/webp_integration_test.go
84 @@ -20,9 +20,14 @@ import (
85
86 qt "github.com/frankban/quicktest"
87 "github.com/gohugoio/hugo/hugolib"
88 + "github.com/gohugoio/hugo/resources/images/imagetesting"
89 )
90
91 func TestWebPMisc(t *testing.T) {
92 + if imagetesting.SkipGoldenTests {
93 + t.Skip("Skip golden test on this architecture")
94 + }
95 +
96 files := `
97 -- assets/sunrise.webp --
98 sourcefilename: ../../resources/testdata/sunrise.webp
99 @@ -49,6 +54,10 @@ ImageConfig: {{ printf "%d/%d" $ic.Width $ic.Height }}|
100 }
101
102 func TestWebPEncodeGrayscale(t *testing.T) {
103 + if imagetesting.SkipGoldenTests {
104 + t.Skip("Skip golden test on this architecture")
105 + }
106 +
107 files := `
108 -- assets/gopher.png --
109 sourcefilename: ../../resources/testdata/bw-gopher.png
110 @@ -89,6 +98,10 @@ Resized RelPermalink: {{ $resized.RelPermalink }}|
111
112 // This test isn't great, but we have golden tests to verify the output itself.
113 func TestWebPAnimation(t *testing.T) {
114 + if imagetesting.SkipGoldenTests {
115 + t.Skip("Skip golden test on this architecture")
116 + }
117 +
118 files := `
119 -- hugo.toml --
120 disableKinds = ["page", "section", "taxonomy", "term", "sitemap", "robotsTXT", "404"]
121 diff --git a/resources/images/imagetesting/testing.go b/resources/images/imagetesting/testing.go
122 index ef029eb..df7b029 100644
123 --- a/resources/images/imagetesting/testing.go
124 +++ b/resources/images/imagetesting/testing.go
125 @@ -237,7 +237,7 @@ func goldenEqual(img1, img2 *image.NRGBA) bool {
126
127 // We don't have a CI test environment for these, and there are known dithering issues that makes these time consuming to maintain.
128 // Go changed their JPEG implementation in Go 1.26, so we cannot run the golden tests on earlier versions. See https://go.dev/doc/go1.26#imagejpegpkgimagejpeg
129 -var SkipGoldenTests = htesting.GoMinorVersion() < 26 || runtime.GOARCH == "ppc64" || runtime.GOARCH == "ppc64le" || runtime.GOARCH == "s390x"
130 +var SkipGoldenTests = htesting.GoMinorVersion() < 26 || runtime.GOARCH == "ppc64" || runtime.GOARCH == "ppc64le" || runtime.GOARCH == "s390x" || runtime.GOARCH == "arm64" || runtime.GOARCH == "arm" || runtime.GOARCH == "riscv64" || runtime.GOARCH == "386" || runtime.GOARCH == "loong64"
131
132 // UsesFMA indicates whether "fused multiply and add" (FMA) instruction is
133 // used. The command "grep FMADD go/test/codegen/floats.go" can help keep
134 diff --git a/tpl/images/images_integration_test.go b/tpl/images/images_integration_test.go
135 index 55b541f..7c5eb6e 100644
136 --- a/tpl/images/images_integration_test.go
137 +++ b/tpl/images/images_integration_test.go
138 @@ -144,6 +144,10 @@ Home.
139 }
140
141 func TestPNGIssue14288(t *testing.T) {
142 + if imagetesting.SkipGoldenTests {
143 + t.Skip("Skip golden test on this architecture")
144 + }
145 +
146 t.Parallel()
147
148 files := `
149 @@ -167,6 +171,10 @@ Brightnes func: /qr_hu_d5f06fd7594d0594.png
150 }
151
152 func TestPNGNamedWebpIssue14288(t *testing.T) {
153 + if imagetesting.SkipGoldenTests {
154 + t.Skip("Skip golden test on this architecture")
155 + }
156 +
157 t.Parallel()
158
159 files := `