Update gitlab integration tests

This commit is contained in:
Jay Gabriels
2023-01-07 09:46:17 -08:00
parent 3a86514940
commit b370e8a951
3 changed files with 8 additions and 17 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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 <<EOF
local-gitlab-v15-group3-preserve/local-gitlab-group3/subgroup-a/subgroup-b
local-gitlab-v15-group3-preserve/local-gitlab-group3/subgroup-a/subgroup_a_repo_0
local-gitlab-v15-group3-preserve/local-gitlab-group3/subgroup-a/subgroup_a_repo_1
local-gitlab-v15-group3-preserve/local-gitlab-group3/subgroup-a/subgroup_a_repo_2
local-gitlab-v15-group3-preserve/local-gitlab-group3/subgroup-a/subgroup_a_repo_3
local-gitlab-v15-group3-preserve/subgroup-a/subgroup-b
local-gitlab-v15-group3-preserve/subgroup-a/subgroup_a_repo_0
local-gitlab-v15-group3-preserve/subgroup-a/subgroup_a_repo_1
local-gitlab-v15-group3-preserve/subgroup-a/subgroup_a_repo_2
local-gitlab-v15-group3-preserve/subgroup-a/subgroup_a_repo_3
EOF
)