From b370e8a9516561556e9eae429ceeec571a4b6e38 Mon Sep 17 00:00:00 2001 From: Jay Gabriels Date: Sat, 7 Jan 2023 09:46:17 -0800 Subject: [PATCH] Update gitlab integration tests --- CHANGELOG.md | 3 +-- scm/gitlab.go | 9 +-------- scripts/local-gitlab/integration-tests.sh | 13 ++++++------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ddb6fe..997a8d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) ## [1.9.3] - unreleased ### Added -- Better examples for GitLab +- Better examples for GitLab; thanks @nudgegoonies - Better tests for local gitlab enterprise ### Changed ### Deprecated @@ -14,7 +14,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) - gitlab hash concurrency issues - all-users command directory nesting - ls command to work with output dirs -- gitlab group name fix when using --preserve-dir and --output-dir; thanks @nudgegoonies ### Security - Bump github.com/ktrysmt/go-bitbucket from 0.9.54 to 0.9.55 - Bump github.com/xanzy/go-gitlab from 0.76.0 to 0.77.0 diff --git a/scm/gitlab.go b/scm/gitlab.go index 6bc5335..fccc6bb 100644 --- a/scm/gitlab.go +++ b/scm/gitlab.go @@ -305,14 +305,7 @@ func (c Gitlab) filter(group string, ps []*gitlab.Project) []Repo { // https://github.com/gabrie30/ghorg/issues/228 // https://github.com/gabrie30/ghorg/issues/267 if !gitLabAllGroups && !gitLabAllUsers { - // cloud instance of gitlab - if os.Getenv("GHORG_SCM_BASE_URL") == "" { - path = strings.TrimPrefix(path, group) - } else { - if os.Getenv("GHORG_OUTPUT_DIR") == "" { - path = strings.TrimPrefix(path, group) - } - } + path = strings.TrimPrefix(path, group) } r.Path = path diff --git a/scripts/local-gitlab/integration-tests.sh b/scripts/local-gitlab/integration-tests.sh index d39d888..4ecd397 100755 --- a/scripts/local-gitlab/integration-tests.sh +++ b/scripts/local-gitlab/integration-tests.sh @@ -160,18 +160,17 @@ echo "CLONE AND TEST TOP LEVEL GROUP FAILED" exit 1 fi -# FAILING ############ CLONE AND TEST TOP LEVEL GROUP WITH NESTED SUBGROUP, PRESERVE DIR, OUTPUT DIR ############ ghorg clone local-gitlab-group3 --scm=gitlab --base-url="${GITLAB_URL}" --token="${TOKEN}" --preserve-dir --output-dir=local-gitlab-v15-group3-preserve ghorg clone local-gitlab-group3 --scm=gitlab --base-url="${GITLAB_URL}" --token="${TOKEN}" --preserve-dir --output-dir=local-gitlab-v15-group3-preserve -GOT=$(ghorg ls local-gitlab-v15-group3-preserve/local-gitlab-group3/subgroup-a | grep -o 'local-gitlab-v15-group3-preserve/local-gitlab-group3/subgroup-a.*') +GOT=$(ghorg ls local-gitlab-v15-group3-preserve/subgroup-a | grep -o 'local-gitlab-v15-group3-preserve/subgroup-a.*') WANT=$(cat <