Some checks failed
CI / Test (Go 1.24.x, ubuntu-latest) (push) Successful in 1m53s
CI / Code Quality (push) Failing after 26s
CI / Security Scan (push) Failing after 11s
CI / Test Coverage (push) Successful in 1m13s
CI / Benchmarks (push) Failing after 10m22s
CI / Build CLI (push) Failing after 8s
Benchmarks / Run Benchmarks (push) Failing after 10m13s
Release / Test (push) Successful in 55s
Release / Build (amd64, darwin, ) (push) Failing after 12s
Release / Build (amd64, linux, ) (push) Failing after 6s
Release / Build (amd64, windows, .exe) (push) Failing after 12s
Release / Build (arm64, darwin, ) (push) Failing after 12s
Release / Build (arm64, linux, ) (push) Failing after 12s
Release / Release (push) Has been skipped
CI / Test (Go 1.24.x, macos-latest) (push) Has been cancelled
CI / Test (Go 1.24.x, windows-latest) (push) Has been cancelled
Move hosting from GitHub to private Gitea instance.
44 lines
1.1 KiB
Go
44 lines
1.1 KiB
Go
//go:build perf
|
|
|
|
package perfsuite_test
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"gitea.dockr.co/kev/go-jdenticon/internal/perfsuite"
|
|
)
|
|
|
|
// TestPerformanceRegressionSuite can be called from a regular Go test
|
|
func TestPerformanceRegressionSuite(t *testing.T) {
|
|
if testing.Short() {
|
|
t.Skip("Skipping performance regression tests in short mode")
|
|
}
|
|
|
|
suite := perfsuite.NewPerformanceSuite()
|
|
suite.FailOnRegress = false // Don't fail tests, just report
|
|
|
|
// Check if we should establish baselines
|
|
if os.Getenv("ESTABLISH_BASELINES") == "true" {
|
|
if err := suite.EstablishBaselines(); err != nil {
|
|
t.Fatalf("Failed to establish baselines: %v", err)
|
|
}
|
|
return
|
|
}
|
|
|
|
// Run regression check
|
|
if err := suite.CheckForRegressions(); err != nil {
|
|
t.Logf("Performance regression check completed with issues: %v", err)
|
|
// Don't fail the test, just log the results
|
|
}
|
|
}
|
|
|
|
// BenchmarkPerformanceSuite runs all performance benchmarks for standard Go bench testing
|
|
func BenchmarkPerformanceSuite(b *testing.B) {
|
|
suite := perfsuite.NewPerformanceSuite()
|
|
|
|
for _, bench := range suite.Benchmarks {
|
|
b.Run(bench.Name, bench.BenchmarkFunc)
|
|
}
|
|
}
|