aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/gitlab/export_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/gitlab/export_test.go')
-rw-r--r--bridge/gitlab/export_test.go20
1 files changed, 15 insertions, 5 deletions
diff --git a/bridge/gitlab/export_test.go b/bridge/gitlab/export_test.go
index 645e2d76..d16defd0 100644
--- a/bridge/gitlab/export_test.go
+++ b/bridge/gitlab/export_test.go
@@ -188,7 +188,8 @@ func TestPushPull(t *testing.T) {
// initialize exporter
exporter := &gitlabExporter{}
err = exporter.Init(backend, core.Configuration{
- keyProjectID: strconv.Itoa(projectID),
+ keyProjectID: strconv.Itoa(projectID),
+ keyGitlabBaseUrl: "https://gitlab.com/",
})
require.NoError(t, err)
@@ -215,7 +216,8 @@ func TestPushPull(t *testing.T) {
importer := &gitlabImporter{}
err = importer.Init(backend, core.Configuration{
- keyProjectID: strconv.Itoa(projectID),
+ keyProjectID: strconv.Itoa(projectID),
+ keyGitlabBaseUrl: "https://gitlab.com/",
})
require.NoError(t, err)
@@ -280,7 +282,11 @@ func generateRepoName() string {
// create repository need a token with scope 'repo'
func createRepository(ctx context.Context, name string, token *auth.Token) (int, error) {
- client := buildClient(token)
+ client, err := buildClient("https://gitlab.com/", token)
+ if err != nil {
+ return 0, err
+ }
+
project, _, err := client.Projects.CreateProject(
&gitlab.CreateProjectOptions{
Name: gitlab.String(name),
@@ -296,7 +302,11 @@ func createRepository(ctx context.Context, name string, token *auth.Token) (int,
// delete repository need a token with scope 'delete_repo'
func deleteRepository(ctx context.Context, project int, token *auth.Token) error {
- client := buildClient(token)
- _, err := client.Projects.DeleteProject(project, gitlab.WithContext(ctx))
+ client, err := buildClient("https://gitlab.com/", token)
+ if err != nil {
+ return err
+ }
+
+ _, err = client.Projects.DeleteProject(project, gitlab.WithContext(ctx))
return err
}