(t *testing.T)
| 37 | const pluginName = "gitlab" |
| 38 | |
| 39 | func TestGitlabPlugin(t *testing.T) { |
| 40 | createConnection := func(cfg TestConfig, client *helper.DevlakeClient) *helper.Connection { |
| 41 | conn := pluginmodels.GitlabConnection{ |
| 42 | BaseConnection: api.BaseConnection{ |
| 43 | Name: "gitlab-conn", |
| 44 | }, |
| 45 | GitlabConn: pluginmodels.GitlabConn{ |
| 46 | RestConnection: api.RestConnection{ |
| 47 | Endpoint: "https://gitlab.com/api/v4", |
| 48 | Proxy: "", |
| 49 | RateLimitPerHour: 0, |
| 50 | }, |
| 51 | AccessToken: api.AccessToken{Token: cfg.Token}, |
| 52 | }, |
| 53 | } |
| 54 | client.TestConnection(pluginName, conn) |
| 55 | return client.CreateConnection(pluginName, conn) |
| 56 | } |
| 57 | client := helper.ConnectLocalServer(t, &helper.LocalClientConfig{ |
| 58 | ServerPort: 8089, |
| 59 | DbURL: config.GetConfig().GetString("E2E_DB_URL"), |
| 60 | CreateServer: true, |
| 61 | DropDb: false, |
| 62 | TruncateDb: true, |
| 63 | Plugins: []plugin.PluginMeta{ |
| 64 | gitlab.Gitlab{}, |
| 65 | gitextractor.GitExtractor{}, |
| 66 | }, |
| 67 | }) |
| 68 | cfg := helper.GetTestConfig[TestConfig]() |
| 69 | connection := createConnection(cfg, client) |
| 70 | t.Run("blueprint v200", func(t *testing.T) { |
| 71 | scopeConfig := helper.Cast[pluginmodels.GitlabScopeConfig](client.CreateScopeConfig("gitlab", connection.ID, |
| 72 | pluginmodels.GitlabScopeConfig{ |
| 73 | ScopeConfig: common.ScopeConfig{ |
| 74 | Entities: []string{ |
| 75 | plugin.DOMAIN_TYPE_CICD, |
| 76 | plugin.DOMAIN_TYPE_CODE, |
| 77 | plugin.DOMAIN_TYPE_CODE_REVIEW, |
| 78 | }, |
| 79 | Name: "config-1", |
| 80 | }, |
| 81 | PrType: "", |
| 82 | PrComponent: "", |
| 83 | PrBodyClosePattern: "", |
| 84 | IssueSeverity: "", |
| 85 | IssuePriority: "", |
| 86 | IssueComponent: "", |
| 87 | IssueTypeBug: "", |
| 88 | IssueTypeIncident: "", |
| 89 | IssueTypeRequirement: "", |
| 90 | DeploymentPattern: ".*", |
| 91 | ProductionPattern: ".*", // this triggers dora |
| 92 | Refdiff: nil, // this is technically a true/false (nil or not) |
| 93 | })) |
| 94 | _ = scopeConfig |
| 95 | remoteScopes := client.RemoteScopes(helper.RemoteScopesQuery{ |
| 96 | PluginName: pluginName, |
nothing calls this directly
no test coverage detected