MCPcopy Create free account
hub / github.com/cloudbase/garm / CreateDefaultGithubEndpoint

Function CreateDefaultGithubEndpoint

internal/testing/testing.go:113–136  ·  view source on GitHub ↗
(ctx context.Context, db common.Store, s *testing.T)

Source from the content-addressed store, hash-verified

111}
112
113func CreateDefaultGithubEndpoint(ctx context.Context, db common.Store, s *testing.T) params.ForgeEndpoint {
114 endpointParams := params.CreateGithubEndpointParams{
115 Name: "github.com",
116 Description: "github endpoint",
117 APIBaseURL: appdefaults.GithubDefaultBaseURL,
118 UploadBaseURL: appdefaults.GithubDefaultUploadBaseURL,
119 BaseURL: appdefaults.DefaultGithubURL,
120 }
121
122 ep, err := db.GetGithubEndpoint(ctx, endpointParams.Name)
123 if err != nil {
124 if !errors.Is(err, runnerErrors.ErrNotFound) {
125 s.Fatalf("failed to get database object (github.com): %v", err)
126 }
127 ep, err = db.CreateGithubEndpoint(ctx, endpointParams)
128 if err != nil {
129 if !errors.Is(err, runnerErrors.ErrDuplicateEntity) {
130 s.Fatalf("failed to create database object (github.com): %v", err)
131 }
132 }
133 }
134
135 return ep
136}
137
138func CreateDefaultGiteaEndpoint(ctx context.Context, db common.Store, s *testing.T) params.ForgeEndpoint {
139 endpointParams := params.CreateGiteaEndpointParams{

Callers

nothing calls this directly

Calls 2

GetGithubEndpointMethod · 0.65
CreateGithubEndpointMethod · 0.65

Tested by

no test coverage detected