Skip to content

test(functional): fix GitLab configuration to support pagination #1881

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 5, 2022

Conversation

JohnVillalovos
Copy link
Member

When pagination occurs python-gitlab uses the URL provided by the
GitLab server to use for the next request.

We had previously set the GitLab server configuraiton to say its URL
was http://gitlab.test which is not in DNS. Set the hostname
in the URL to http://127.0.0.1:8080 which is the correct URL for the
GitLab server to be accessed while doing functional tests.

Closes: #1877

@JohnVillalovos JohnVillalovos requested a review from nejch February 5, 2022 18:42
Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this @JohnVillalovos! tiny comment here.

@@ -244,7 +244,7 @@ def test_project_protected_branches(project):


def test_project_remote_mirrors(project):
mirror_url = "http://gitlab.test/root/mirror.git"
mirror_url = "https://gitlab.com/root/mirror.git"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think push mirrors don't create any requests by default, but just in case:

Suggested change
mirror_url = "https://gitlab.com/root/mirror.git"
mirror_url = "https://gitlab.example.com/root/mirror.git"

(from https://datatracker.ietf.org/doc/html/rfc2606#section-3)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think push mirrors don't create any requests by default, but just in case:

Yeah push mirroring is disabled by default:
https://docs.gitlab.com/ee/api/remote_mirrors.html#create-a-push-mirror

But a good idea to use a non-real host-name. Let me update it and test locally to make sure it works.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We enable it a few lines down from here, not sure if has any effects still, but just in case. Thanks :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. I wasn't looking at that. Nice that the test works even with a not existing host.

When pagination occurs python-gitlab uses the URL provided by the
GitLab server to use for the next request.

We had previously set the GitLab server configuraiton to say its URL
was `http://gitlab.test` which is not in DNS. Set the hostname
in the URL to `http://127.0.0.1:8080` which is the correct URL for the
GitLab server to be accessed while doing functional tests.

Closes: #1877
@nejch nejch merged commit 4cb7d92 into main Feb 5, 2022
@nejch nejch deleted the jlvillal/easy2 branch February 5, 2022 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

list() pagination doesn't work in functional tests
2 participants