Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: make reset_gitlab() better#1785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nejch merged 1 commit intomainfromjlvillal/reset_gitlab
Jul 22, 2022
Merged

Conversation

@JohnVillalovos
Copy link
Member

@JohnVillalovosJohnVillalovos commentedDec 29, 2021
edited
Loading

Saw issues in the CI where reset_gitlab() would fail. It would fail to
delete the group that is created when GitLab starts up. Extending the
timeout didn't fix the issue.

Changed the code to use the newhelpers.safe_delete() function.
Which will delete the resource and then make sure it is deleted before
returning.

Also added some logging functionality that can be seen if logging is
turned on in pytest.

@JohnVillalovosJohnVillalovos marked this pull request as draftDecember 29, 2021 05:42
@JohnVillalovosJohnVillalovos changed the titlewip: make reset_gitlab() betterchore: make reset_gitlab() betterDec 29, 2021
@JohnVillalovosJohnVillalovos marked this pull request as ready for reviewDecember 29, 2021 08:06
@JohnVillalovos
Copy link
MemberAuthor

JohnVillalovos commentedDec 29, 2021
edited
Loading

@nejch Please look at the functional testing logs and let me know what you think.

@JohnVillalovos
Copy link
MemberAuthor

JohnVillalovos commentedDec 29, 2021
edited
Loading

An example of what this is fixing fromhttps://github.com/python-gitlab/python-gitlab/runs/4656774636?check_suite_focus=true#step:5:27

tests/functional/api/test_clusters.py::test_project_clusters -------------------------------- live log setup --------------------------------2021-12-29 08:13:06.617 [    INFO] (conftest.py:gl:L258) Create python-gitlab gitlab.Gitlab object2021-12-29 08:13:07.660 [    INFO] (conftest.py:_reset_gitlab_delete_resources:L35) Mark for deletion project: 'Monitoring'2021-12-29 08:13:08.277 [    INFO] (conftest.py:_reset_gitlab_delete_resources:L44) Mark for deletion group: 'GitLab Instance'2021-12-29 08:13:08.684 [    INFO] (conftest.py:wait_for_maximum_list_length:L83) Iteration: 0: items in projects: []2021-12-29 08:13:08.954 [    INFO] (conftest.py:wait_for_maximum_list_length:L83) Iteration: 0: items in groups: ['GitLab Instance']# NOTE(jlvillal): Deleting again and no message about already marked for deletion, so this is a fix.2021-12-29 08:13:08.955 [    INFO] (conftest.py:wait_for_maximum_list_length:L88) Marking again for deletion groups: 'GitLab Instance'2021-12-29 08:13:09.142 [    INFO] (conftest.py:wait_for_maximum_list_length:L83) Iteration: 1: items in groups: ['GitLab Instance']# NOTE(jlvillal): 2nd time through, deleting again but this time indicates already marked for deletion.2021-12-29 08:13:09.143 [    INFO] (conftest.py:wait_for_maximum_list_length:L88) Marking again for deletion groups: 'GitLab Instance'2021-12-29 08:13:09.177 [    INFO] (conftest.py:wait_for_maximum_list_length:L94) Already marked for deletion: 'GitLab Instance' 404: 404 Group Not Found# NOTE(jlvillal): 3rd time through and group is now gone.2021-12-29 08:13:09.308 [    INFO] (conftest.py:wait_for_maximum_list_length:L83) Iteration: 2: items in groups: []2021-12-29 08:13:09.359 [    INFO] (conftest.py:wait_for_maximum_list_length:L83) Iteration: 0: items in variables: []2021-12-29 08:13:09.525 [    INFO] (conftest.py:wait_for_maximum_list_length:L83) Iteration: 0: items in users: ['Administrator']

@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/reset_gitlab branch 2 times, most recently from3c5f510 tocda90f0CompareDecember 29, 2021 17:14
@JohnVillalovosJohnVillalovos marked this pull request as draftDecember 30, 2021 05:50
@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/reset_gitlab branch 3 times, most recently from26f4944 to67dd7b4CompareDecember 31, 2021 21:14
@JohnVillalovosJohnVillalovos marked this pull request as ready for reviewJune 2, 2022 05:30
@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/reset_gitlab branch 2 times, most recently frome9e8a7c to9b4c01bCompareJuly 22, 2022 15:21
Saw issues in the CI where reset_gitlab() would fail. It would fail todelete the group that is created when GitLab starts up. Extending thetimeout didn't fix the issue.Changed the code to use the new `helpers.safe_delete()` function.Which will delete the resource and then make sure it is deleted beforereturning.Also added some logging functionality that can be seen if logging isturned on in pytest.
@JohnVillalovos
Copy link
MemberAuthor

@nejch By usingsafe_delete() it simplified things 🙂

@nejch
Copy link
Member

@nejch By usingsafe_delete() it simplified things slightly_smiling_face

Amazing, love to see code get deleted 😅

@nejchnejch merged commit789ef81 intomainJul 22, 2022
@nejchnejch deleted the jlvillal/reset_gitlab branchJuly 22, 2022 19:56
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nejchnejchnejch left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@JohnVillalovos@nejch

[8]ページ先頭

©2009-2025 Movatter.jp