From bd7b50bc8638d3b6c776dd974de32a1ea385c835 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 9 Feb 2020 22:17:10 +0100 Subject: github/gitlab: many fixes and improvments at the config step --- bridge/gitlab/export_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bridge/gitlab/export_test.go') diff --git a/bridge/gitlab/export_test.go b/bridge/gitlab/export_test.go index 1d387655..c97416d8 100644 --- a/bridge/gitlab/export_test.go +++ b/bridge/gitlab/export_test.go @@ -164,6 +164,7 @@ func TestPushPull(t *testing.T) { token := auth.NewToken(envToken, target) token.SetMetadata(auth.MetaKeyLogin, login) + token.SetMetadata(auth.MetaKeyBaseURL, defaultBaseURL) err = auth.Store(repo, token) require.NoError(t, err) @@ -194,7 +195,7 @@ func TestPushPull(t *testing.T) { exporter := &gitlabExporter{} err = exporter.Init(backend, core.Configuration{ keyProjectID: strconv.Itoa(projectID), - keyGitlabBaseUrl: "https://gitlab.com/", + keyGitlabBaseUrl: defaultBaseURL, }) require.NoError(t, err) @@ -222,7 +223,7 @@ func TestPushPull(t *testing.T) { importer := &gitlabImporter{} err = importer.Init(backend, core.Configuration{ keyProjectID: strconv.Itoa(projectID), - keyGitlabBaseUrl: "https://gitlab.com/", + keyGitlabBaseUrl: defaultBaseURL, }) require.NoError(t, err) @@ -287,7 +288,7 @@ func generateRepoName() string { // create repository need a token with scope 'repo' func createRepository(ctx context.Context, name string, token *auth.Token) (int, error) { - client, err := buildClient("https://gitlab.com/", token) + client, err := buildClient(defaultBaseURL, token) if err != nil { return 0, err } @@ -307,7 +308,7 @@ 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, err := buildClient("https://gitlab.com/", token) + client, err := buildClient(defaultBaseURL, token) if err != nil { return err } -- cgit