This commit is contained in:
Ryan McKinley committed 2025-02-19 18:26:55 +03:00
1 parent f9c0501474
commit adced54841
1 file changed
+8 -7
@@ -20,6 +20,8 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
gh "github.com/google/go-github/v66/github"
ghmock "github.com/migueleliasweb/go-github-mock/src/mock"
dashboard "github.com/grafana/grafana/pkg/apis/dashboard/v1alpha1"
folder "github.com/grafana/grafana/pkg/apis/folder/v0alpha1"
provisioning "github.com/grafana/grafana/pkg/apis/provisioning/v0alpha1"
@@ -29,7 +31,6 @@ import (
"github.com/grafana/grafana/pkg/tests/apis"
"github.com/grafana/grafana/pkg/tests/testinfra"
"github.com/grafana/grafana/pkg/tests/testsuite"
ghmock "github.com/migueleliasweb/go-github-mock/src/mock"
)
func TestMain(m *testing.M) {
@@ -97,37 +98,37 @@ func TestIntegrationProvisioning(t *testing.T) {
ghmock.WithRequestMatchHandler(
ghmock.GetUser,
http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.Write(ghmock.MustMarshal(&gh.User{}))
_, _ = w.Write(ghmock.MustMarshal(&gh.User{}))
}),
),
ghmock.WithRequestMatchHandler(
ghmock.GetReposHooksByOwnerByRepo,
http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.Write(ghmock.MustMarshal([]*gh.Hook{}))
_, _ = w.Write(ghmock.MustMarshal([]*gh.Hook{}))
}),
),
ghmock.WithRequestMatchHandler(
ghmock.PostReposHooksByOwnerByRepo,
http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.Write(ghmock.MustMarshal(&gh.Hook{}))
_, _ = w.Write(ghmock.MustMarshal(&gh.Hook{}))
}),
),
ghmock.WithRequestMatchHandler(
ghmock.GetReposByOwnerByRepo,
http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.Write(ghmock.MustMarshal(&gh.Repository{}))
_, _ = w.Write(ghmock.MustMarshal(&gh.Repository{}))
}),
),
ghmock.WithRequestMatchHandler(
ghmock.GetReposBranchesByOwnerByRepoByBranch,
http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.Write(ghmock.MustMarshal(&gh.Branch{}))
_, _ = w.Write(ghmock.MustMarshal(&gh.Branch{}))
}),
),
ghmock.WithRequestMatchHandler(
ghmock.GetReposGitTreesByOwnerByRepoByTreeSha,
http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.Write(ghmock.MustMarshal(&gh.Tree{}))
_, _ = w.Write(ghmock.MustMarshal(&gh.Tree{}))
}),
),
ghmock.WithRequestMatchHandler(