Initial release: Go Jdenticon library v0.1.0
- Core library with SVG and PNG generation - CLI tool with generate and batch commands - Cross-platform path handling for Windows compatibility - Comprehensive test suite with integration tests
This commit is contained in:
43
internal/perfsuite/regression_test.go
Normal file
43
internal/perfsuite/regression_test.go
Normal file
@@ -0,0 +1,43 @@
|
||||
//go:build perf
|
||||
|
||||
package perfsuite_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/ungluedlabs/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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user