fix(operator): pbt test failure with control chars
The CR PBT test failed with seed that introduced
control characters in string values of the generated YAML. This
configures the generator to generate alpha strings by default and
identifiers for Maven repository configuration.
@@ -721,13 +721,16 @@ func TestGeneratorProperty(t *testing.T) {
parameters.MaxSize = 10
arbitraries := arbitrary.DefaultArbitraries()
- arbitraries.RegisterGen(gen.AlphaNumChar())
+ arbitraries.RegisterGen(gen.AlphaString())
arbitraries.RegisterGen(gen.Struct(reflect.TypeOf(v1beta2.ResourcesWithPersistentVolume{}), map[string]gopter.Gen{
"VolumeLabels": gen.MapOf(gen.Identifier(), gen.Identifier()), // we can't have volume labels with keys that are empty strings
}))
arbitraries.RegisterGen(gen.Struct(reflect.TypeOf(v1beta2.DatabaseConfiguration{}), map[string]gopter.Gen{
"ExternalDbURL": gen.Identifier(),
}))
+ arbitraries.RegisterGen(gen.Struct(reflect.TypeOf(v1beta2.MavenConfiguration{}), map[string]gopter.Gen{
+ "Repositories": gen.MapOf(gen.Identifier(), gen.Identifier()), // we can't have Maven repositories with illegal characters
+ }))
properties := gopter.NewProperties(parameters)
