mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-19 03:53:09 -06:00
Veriying the generated configuration. global.jetstream.addresses is required in polylith mode. Adding a dummy value for CI.
34 lines
674 B
Go
34 lines
674 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"testing"
|
|
|
|
"github.com/matrix-org/dendrite/setup/config"
|
|
)
|
|
|
|
func TestBuildConfig(t *testing.T) {
|
|
tsts := []struct {
|
|
Name string
|
|
Args []string
|
|
IsMonolith bool
|
|
}{
|
|
{"ciMonolith", []string{"-ci"}, true},
|
|
{"ciPolylith", []string{"-ci", "-polylith"}, false},
|
|
}
|
|
for _, tst := range tsts {
|
|
t.Run(tst.Name, func(t *testing.T) {
|
|
cfg, err := buildConfig(flag.NewFlagSet("main_test", flag.ContinueOnError), tst.Args)
|
|
if err != nil {
|
|
t.Fatalf("buildConfig failed: %v", err)
|
|
}
|
|
|
|
var ss config.ConfigErrors
|
|
cfg.Verify(&ss, tst.IsMonolith)
|
|
for _, s := range ss {
|
|
t.Errorf("Verify: %s", s)
|
|
}
|
|
})
|
|
}
|
|
}
|