mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-03 23:06:36 +08:00
merge(wavelet): sync upstream changes
This commit is contained in:
@@ -22,7 +22,7 @@ func New(_ *core.Context) *Provider {
|
||||
}
|
||||
|
||||
// PublicConfig returns visibility=1 keys as map[string]string.
|
||||
func (p *Provider) PublicConfig(ctx context.Context) (any, error) {
|
||||
func (p *Provider) PublicConfig(ctx context.Context) (map[string]string, error) {
|
||||
configs, err := repository.ListVisibleSystemConfigs(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -23,11 +23,7 @@ func TestPublicConfigSeesSaveOrUpdateThroughAdminCache(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("PublicConfig() warm error = %v", err)
|
||||
}
|
||||
firstMap, ok := first.(map[string]string)
|
||||
if !ok {
|
||||
t.Fatalf("PublicConfig() = %T, want map[string]string", first)
|
||||
}
|
||||
if got := firstMap[model.ConfigKeySiteName]; got != "OpenFlare" {
|
||||
if got := first[model.ConfigKeySiteName]; got != "OpenFlare" {
|
||||
t.Fatalf("PublicConfig()[%q] = %q, want %q", model.ConfigKeySiteName, got, "OpenFlare")
|
||||
}
|
||||
|
||||
@@ -47,14 +43,10 @@ func TestPublicConfigSeesSaveOrUpdateThroughAdminCache(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("PublicConfig() after save error = %v", err)
|
||||
}
|
||||
secondMap, ok := second.(map[string]string)
|
||||
if !ok {
|
||||
t.Fatalf("PublicConfig() after save = %T, want map[string]string", second)
|
||||
}
|
||||
if got := secondMap[model.ConfigKeySiteName]; got == "OpenFlare" {
|
||||
if got := second[model.ConfigKeySiteName]; got == "OpenFlare" {
|
||||
t.Fatalf("PublicConfig() after save [%q] stayed stale at %q", model.ConfigKeySiteName, got)
|
||||
}
|
||||
if got := secondMap[model.ConfigKeySiteName]; got != "Updated" {
|
||||
if got := second[model.ConfigKeySiteName]; got != "Updated" {
|
||||
t.Fatalf("PublicConfig() after save [%q] = %q, want %q", model.ConfigKeySiteName, got, "Updated")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user