(ctx context.Context, db common.Store, s *testing.T)
| 111 | } |
| 112 | |
| 113 | func 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 | |
| 138 | func CreateDefaultGiteaEndpoint(ctx context.Context, db common.Store, s *testing.T) params.ForgeEndpoint { |
| 139 | endpointParams := params.CreateGiteaEndpointParams{ |
nothing calls this directly
no test coverage detected