mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 23:53:10 +08:00

* unistore: wire the authz client * rename dashboards.grafana.app into dashboard.grafana.app * wire the authz client * wire the authz client * resuse the Standalone constructor * configure default migration for resource folder * add tests * cleanup * add logging
23 lines
549 B
Go
23 lines
549 B
Go
package standalone
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestReadRuntimeCOnfig(t *testing.T) {
|
|
out, err := ReadRuntimeConfig("all/all=true,dashboard.grafana.app/v0alpha1=false")
|
|
require.NoError(t, err)
|
|
require.Equal(t, []RuntimeConfig{
|
|
{Group: "all", Version: "all", Enabled: true},
|
|
{Group: "dashboard.grafana.app", Version: "v0alpha1", Enabled: false},
|
|
}, out)
|
|
require.Equal(t, "all/all=true", fmt.Sprintf("%v", out[0]))
|
|
|
|
// Empty is an error
|
|
_, err = ReadRuntimeConfig("")
|
|
require.Error(t, err)
|
|
}
|