(t *testing.T)
| 30 | ) |
| 31 | |
| 32 | func TestGitlabAccountDataFlow(t *testing.T) { |
| 33 | |
| 34 | var gitlab impl.Gitlab |
| 35 | dataflowTester := e2ehelper.NewDataFlowTester(t, "gitlab", gitlab) |
| 36 | apiClient := &api.ApiClient{} |
| 37 | apiClient.Setup( |
| 38 | "https://gitlab.com", |
| 39 | make(map[string]string), |
| 40 | time.Hour, |
| 41 | ) |
| 42 | |
| 43 | taskData := &tasks.GitlabTaskData{ |
| 44 | Options: &tasks.GitlabOptions{ |
| 45 | ConnectionId: 1, |
| 46 | ProjectId: 12345678, |
| 47 | ScopeConfig: new(models.GitlabScopeConfig), |
| 48 | }, |
| 49 | |
| 50 | ApiClient: &api.ApiAsyncClient{ |
| 51 | ApiClient: apiClient, |
| 52 | }, |
| 53 | } |
| 54 | |
| 55 | // import raw data table |
| 56 | dataflowTester.ImportCsvIntoRawTable("./raw_tables/_raw_gitlab_api_users.csv", |
| 57 | "_raw_gitlab_api_users") |
| 58 | |
| 59 | // verify extraction |
| 60 | dataflowTester.FlushTabler(&models.GitlabAccount{}) |
| 61 | dataflowTester.Subtask(tasks.ExtractAccountsMeta, taskData) |
| 62 | dataflowTester.VerifyTable( |
| 63 | models.GitlabAccount{}, |
| 64 | "./snapshot_tables/_tool_gitlab_accounts.csv", |
| 65 | e2ehelper.ColumnWithRawData( |
| 66 | "connection_id", |
| 67 | "gitlab_id", |
| 68 | "username", |
| 69 | "email", |
| 70 | "name", |
| 71 | "state", |
| 72 | "membership_state", |
| 73 | "avatar_url", |
| 74 | "web_url", |
| 75 | ), |
| 76 | ) |
| 77 | |
| 78 | // verify conversion |
| 79 | dataflowTester.FlushTabler(&crossdomain.Account{}) |
| 80 | dataflowTester.Subtask(tasks.ConvertAccountsMeta, taskData) |
| 81 | dataflowTester.VerifyTable( |
| 82 | crossdomain.Account{}, |
| 83 | "./snapshot_tables/accounts.csv", |
| 84 | e2ehelper.ColumnWithRawData( |
| 85 | "id", |
| 86 | "email", |
| 87 | "full_name", |
| 88 | "user_name", |
| 89 | "avatar_url", |
nothing calls this directly
no test coverage detected