Fix bootstrap YAML round-trip tests
Replace gopkg.in/yaml.v3 with sigs.k8s.io/yaml in write_test.go to match the marshaling library used by WriteConfig. The sigs.k8s.io/yaml library uses JSON struct tags, enabling proper round-trip serialization of configs with custom unmarshaling logic like ConnectorConfig. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
2
go.mod
2
go.mod
@@ -174,7 +174,7 @@ require (
|
||||
google.golang.org/protobuf v1.36.11 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gotest.tools/gotestsum v1.13.0 // indirect
|
||||
sigs.k8s.io/yaml v1.6.0 // indirect
|
||||
sigs.k8s.io/yaml v1.6.0
|
||||
)
|
||||
|
||||
tool (
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.probo.inc/probo/pkg/probod"
|
||||
"gopkg.in/yaml.v3"
|
||||
"sigs.k8s.io/yaml"
|
||||
)
|
||||
|
||||
func TestWriteConfig(t *testing.T) {
|
||||
@@ -149,5 +149,5 @@ func TestWriteConfig_CompleteConfig(t *testing.T) {
|
||||
assert.Equal(t, cfg.Probod.Api.Cors.AllowedOrigins, loaded.Probod.Api.Cors.AllowedOrigins)
|
||||
assert.Equal(t, cfg.Probod.Pg.PoolSize, loaded.Probod.Pg.PoolSize)
|
||||
require.Len(t, loaded.Probod.Connectors, 1)
|
||||
assert.Equal(t, "slack", loaded.Probod.Connectors[0].Provider)
|
||||
assert.Equal(t, "SLACK", loaded.Probod.Connectors[0].Provider)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user