From ba5e3a5161a497aa8c73827774870fb94676e68b Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 8 Jan 2025 23:15:47 -0800 Subject: [PATCH] Fix fuzz test (#33156) --- tests/fuzz/fuzz_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/fuzz/fuzz_test.go b/tests/fuzz/fuzz_test.go index 01d562d995..e7b832412a 100644 --- a/tests/fuzz/fuzz_test.go +++ b/tests/fuzz/fuzz_test.go @@ -19,6 +19,7 @@ func newFuzzRenderContext() *markup.RenderContext { func FuzzMarkdownRenderRaw(f *testing.F) { f.Fuzz(func(t *testing.T, data []byte) { + setting.IsInTesting = true setting.AppURL = "http://localhost:3000/" markdown.RenderRaw(newFuzzRenderContext(), bytes.NewReader(data), io.Discard) }) @@ -26,6 +27,7 @@ func FuzzMarkdownRenderRaw(f *testing.F) { func FuzzMarkupPostProcess(f *testing.F) { f.Fuzz(func(t *testing.T, data []byte) { + setting.IsInTesting = true setting.AppURL = "http://localhost:3000/" markup.PostProcessDefault(newFuzzRenderContext(), bytes.NewReader(data), io.Discard) })