Skip to content
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

Functional tests currently failing on master #1148

Closed
ericfrederich opened this issue Aug 7, 2020 · 3 comments · Fixed by #1164
Closed

Functional tests currently failing on master #1148

ericfrederich opened this issue Aug 7, 2020 · 3 comments · Fixed by #1164

Comments

@ericfrederich
Copy link
Contributor

ericfrederich commented Aug 7, 2020

Description of the problem, including code/CLI snippet

Currently on master, the tests do not pass because it uses gitlab/gitlab-ce:latest.
Something happened between 13.1.4-ce.0 and 13.2.0-ce.0

Because of this, all requests are also failing travis ci tests.

Expected Behavior

Running ./tools/py_functional_tests.sh on master branch should not fail.

Actual Behavior

Running ./tools/py_functional_tests.sh on master branch fails.
But running GITLAB_TAG="13.1.4-ce.0" tools/py_functional_tests.sh works.

Traceback (most recent call last):
  File "./tools/python_test_v4.py", line 422, in <module>
    assert len(gl.projects.list(owned=True)) == 2
AssertionError
ERROR: 'python ./tools/python_test_v4.py' failed

Specifications

  • python-gitlab version: master branch (currently 1606310)
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): Whatever dockerhub is serving up ;-)... that's the problem.
@ericfrederich
Copy link
Contributor Author

Perhaps this is caused by a bug in GitLab itself?

If it is caused by a bug in GitLab perhaps we should consider pinning the GitLab version used for tests?
Currently it seems it's ran against latest and nightly. Should latest be changed to a known good version? Or should we simply add a known version to the tests and now run it against 3 variants?

@ericfrederich
Copy link
Contributor Author

ericfrederich commented Aug 7, 2020

Seems like a bug in GitLab.
Documentation for listing project says owned will Limit by projects explicitly owned by the current user.
Relavent lines in python_test_v4.py are:

  • group2 = gl.groups.create({"name": "group2", "path": "group2"})
  • add another owner otherwise we cannot delete ourselves
    • user2 = gl.users.create({"email": "[email protected]", "username": "user2", "name": "user2", "password": "user2_pass"})
    • group2.members.create({"access_level": gitlab.const.OWNER_ACCESS, "user_id": user2.id})
  • group2.members.delete(gl.user.id)
  • gr2_project = gl.projects.create({"name": "gr2_project", "namespace_id": group2.id})

On 13.1.4-ce.0 this project does not get returned under gl.projects.list(owned=True)
Under 13.2.0-ce.0 it does.

I logged into the GitLab after the test failed and saw in the UI that root was listed as an owner of gr1_project but not gr2_project. So, this seems like a bug in GitLab itself according to documentation as this project is not explicitly owned by the current user.

I suggest:

  • leaving this open here to decide whether there should be a pinned "good" version to run tests against.-
  • creating an issue against GitLab

@nejch
Copy link
Member

nejch commented Aug 30, 2020

I agree, although tests are currently green, I think using latest is going to be painful with how often the GitLab API behavior has changed recently even between minor/patch releases. I opened a PR to pin versions.

I think Max already opened an upstream issue for the specific bug.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants