Complete integer schema version consumer readiness
This commit is contained in:
@@ -26,7 +26,7 @@ func Example_notarius() {
|
||||
result, err := consumers.LoadNotarius(fixture("notarius", "config.yml"))
|
||||
window, ok := consumers.NotariusWindow(result.Config, 0)
|
||||
fmt.Println(result.Config.Version, result.Config.Bindings[0].Object, window, ok, err)
|
||||
// Output: v1 summary 12 true <nil>
|
||||
// Output: 4 summary 12 true <nil>
|
||||
}
|
||||
|
||||
func Example_weatherReporter() {
|
||||
@@ -100,6 +100,10 @@ func TestMaintainedConsumerFixturesPreserveDomainOutcomes(t *testing.T) {
|
||||
if _, ok := notarius.Config.Bindings[0].Options["window_units"].(int64); !ok {
|
||||
t.Fatalf("dynamic integer type = %T", notarius.Config.Bindings[0].Options["window_units"])
|
||||
}
|
||||
integerNotarius, err := consumers.LoadNotarius(fixture("notarius", "integer-version.yml"))
|
||||
if err != nil || integerNotarius.Config.Version != notarius.Config.Version || integerNotarius.Config.Version != "4" {
|
||||
t.Fatalf("Notarius version forms = %#v / %#v, %v", notarius.Config, integerNotarius, err)
|
||||
}
|
||||
|
||||
weather, err := consumers.LoadWeather(configkit.File(fixture("weather", "config.yml")))
|
||||
if err != nil || weather.Config.Reports["daily"].Modules[1].Options.Sections[0] != "short_term" {
|
||||
@@ -124,10 +128,21 @@ func TestMigrationFixturesFailWithStableCodesAndPaths(t *testing.T) {
|
||||
path string
|
||||
}{
|
||||
{
|
||||
name: "unsupported integer schema version",
|
||||
load: func() error { _, err := consumers.LoadNotarius(fixture("notarius", "integer-version.yml")); return err },
|
||||
name: "unsupported application version",
|
||||
load: func() error {
|
||||
_, err := consumers.LoadNotarius(fixture("notarius", "unsupported-version.yml"))
|
||||
return err
|
||||
},
|
||||
code: configkit.CodeVersionError, path: "/version",
|
||||
},
|
||||
{
|
||||
name: "non-integer numeric version",
|
||||
load: func() error {
|
||||
_, err := consumers.LoadNotarius(fixture("notarius", "noninteger-version.yml"))
|
||||
return err
|
||||
},
|
||||
code: configkit.CodeVersionType, path: "/version",
|
||||
},
|
||||
{
|
||||
name: "module shorthand",
|
||||
load: func() error {
|
||||
|
||||
Reference in New Issue
Block a user