tests: replace godebug by go-cmp for structure diffs

go-cmp is stricter and allow to catch more problems. Moreover, the
output is a bit nicer.
This commit is contained in:
Vincent Bernat
2025-08-23 08:28:38 +02:00
parent 1a09ba9e7c
commit e2f1df9add
45 changed files with 852 additions and 710 deletions

View File

@@ -9,6 +9,8 @@ import (
"testing"
"github.com/benbjohnson/clock"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"akvorado/common/clickhousedb"
"akvorado/common/clickhousedb/mocks"
@@ -43,3 +45,8 @@ func NewMock(t *testing.T, config Configuration) (*Component, *httpserver.Compon
helpers.StartStop(t, c)
return c, h, mockConn, mockClock
}
func init() {
helpers.RegisterCmpOption(cmpopts.IgnoreUnexported(graphCommonHandlerInput{}))
helpers.RegisterCmpOption(cmp.AllowUnexported(graphLineHandlerInput{}))
}