diff --git a/.github/workflows/benchmark.yaml b/.github/workflows/benchmark.yaml index 81b52fe..2712b45 100644 --- a/.github/workflows/benchmark.yaml +++ b/.github/workflows/benchmark.yaml @@ -20,7 +20,7 @@ jobs: mkdir -p ./profile { echo "stdout<> $GITHUB_OUTPUT id: bench diff --git a/formstream_test.go b/formstream_test.go index 7f1d3f8..ca6b40c 100644 --- a/formstream_test.go +++ b/formstream_test.go @@ -149,9 +149,15 @@ func BenchmarkFormStreamFastPath(b *testing.B) { benchmarkFormStream(b, 1*formstream.GB, false) }) b.Run("5GB", func(b *testing.B) { + if testing.Short() { + b.Skip("skipping test in short mode.") + } benchmarkFormStream(b, 5*formstream.GB, false) }) b.Run("10GB", func(b *testing.B) { + if testing.Short() { + b.Skip("skipping test in short mode.") + } benchmarkFormStream(b, 10*formstream.GB, false) }) } @@ -170,9 +176,15 @@ func BenchmarkFormStreamSlowPath(b *testing.B) { benchmarkFormStream(b, 1*formstream.GB, true) }) b.Run("5GB", func(b *testing.B) { + if testing.Short() { + b.Skip("skipping test in short mode.") + } benchmarkFormStream(b, 5*formstream.GB, true) }) b.Run("10GB", func(b *testing.B) { + if testing.Short() { + b.Skip("skipping test in short mode.") + } benchmarkFormStream(b, 10*formstream.GB, true) }) } @@ -231,9 +243,15 @@ func BenchmarkStdMultipartReadForm(b *testing.B) { benchmarkStdMultipartReadForm(b, 1*formstream.GB) }) b.Run("5GB", func(b *testing.B) { + if testing.Short() { + b.Skip("skipping test in short mode.") + } benchmarkStdMultipartReadForm(b, 5*formstream.GB) }) b.Run("10GB", func(b *testing.B) { + if testing.Short() { + b.Skip("skipping test in short mode.") + } benchmarkStdMultipartReadForm(b, 10*formstream.GB) }) } diff --git a/http/parser_test.go b/http/parser_test.go index 99cc072..877ab79 100644 --- a/http/parser_test.go +++ b/http/parser_test.go @@ -269,9 +269,15 @@ func BenchmarkFormStreamFastPath(b *testing.B) { benchmarkFormStream(b, 1*formstream.GB, false) }) b.Run("5GB", func(b *testing.B) { + if testing.Short() { + b.Skip("skipping test in short mode.") + } benchmarkFormStream(b, 5*formstream.GB, false) }) b.Run("10GB", func(b *testing.B) { + if testing.Short() { + b.Skip("skipping test in short mode.") + } benchmarkFormStream(b, 10*formstream.GB, false) }) } @@ -290,9 +296,15 @@ func BenchmarkFormStreamSlowPath(b *testing.B) { benchmarkFormStream(b, 1*formstream.GB, true) }) b.Run("5GB", func(b *testing.B) { + if testing.Short() { + b.Skip("skipping test in short mode.") + } benchmarkFormStream(b, 5*formstream.GB, true) }) b.Run("10GB", func(b *testing.B) { + if testing.Short() { + b.Skip("skipping test in short mode.") + } benchmarkFormStream(b, 10*formstream.GB, true) }) } @@ -371,8 +383,17 @@ func BenchmarkStdMultipartReadForm(b *testing.B) { benchmarkStdMultipartReadForm(b, 1*formstream.GB) }) b.Run("5GB", func(b *testing.B) { + if testing.Short() { + b.Skip("skipping test in short mode.") + } benchmarkStdMultipartReadForm(b, 5*formstream.GB) }) + b.Run("10GB", func(b *testing.B) { + if testing.Short() { + b.Skip("skipping test in short mode.") + } + benchmarkStdMultipartReadForm(b, 10*formstream.GB) + }) } func benchmarkStdMultipartReadForm(b *testing.B, fileSize formstream.DataSize) {