Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f3a8fcc

Browse files
committed
test: revert "run loop for top level groups only in reset_gitlab"
This reverts commit 5343394.
1 parent 7281ccc commit f3a8fcc

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tests/functional/conftest.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,15 @@ def reset_gitlab(gl: gitlab.Gitlab) -> None:
9595
logging.info(f"Deleting project: {project.path_with_namespace!r}")
9696
helpers.safe_delete(project)
9797

98-
# skip deletion of a descendant group to prevent scenarios where parent group gets deleted leaving a dangling descendant whose deletion will throw 404s.
99-
for group in gl.groups.list(top_level_only=True):
98+
for group in gl.groups.list():
99+
100+
# skip deletion of a descendant group to prevent scenarios where parent group gets deleted leaving a dangling descendant whose deletion will throw 404s.
101+
if group.parent_id:
102+
logging.info(
103+
f"Skipping deletion of {group.full_path} as it is a descendant group and will be removed when the parent group is deleted"
104+
)
105+
continue
106+
100107
for deploy_token in group.deploytokens.list():
101108
logging.info(
102109
f"Deleting deploy token: {deploy_token.username!r} in "

0 commit comments

Comments
 (0)