Skip to content

test: adapt functional tests for GitLab 15.8 #2494

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

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion tests/functional/api/test_bulk_imports.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
def test_bulk_imports(gl, group):
import time
import pytest

import gitlab


@pytest.fixture
def bulk_import_enabled(gl: gitlab.Gitlab):
settings = gl.settings.get()
bulk_import_default = settings.bulk_import_enabled

settings.bulk_import_enabled = True
settings.save()

# todo: why so fussy with feature flag timing?
time.sleep(5)
get_settings = gl.settings.get()
assert get_settings.bulk_import_enabled == True

yield settings

settings.bulk_import_enabled = bulk_import_default
settings.save()


def test_bulk_imports(gl, group, bulk_import_enabled):
destination = f"{group.full_path}-import"
configuration = {
"url": gl.url,
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/api/test_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ def test_groups(gl):
"email": "user@test.com",
"username": "user",
"name": "user",
"password": "user_pass",
"password": "E4596f8be406Bc3a14a4ccdb1df80587#!1",
}
)
user2 = gl.users.create(
{
"email": "user2@test.com",
"username": "user2",
"name": "user2",
"password": "user2_pass",
"password": "E4596f8be406Bc3a14a4ccdb1df80587#!#2",
}
)
group1 = gl.groups.create(
Expand Down
9 changes: 3 additions & 6 deletions tests/functional/api/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_create_user(gl, fixture_dir):
"email": "foo@bar.com",
"username": "foo",
"name": "foo",
"password": "foo_password",
"password": "E4596f8be406Bc3a14a4ccdb1df80587#!",
"avatar": open(fixture_dir / "avatar.png", "rb"),
}
)
Expand Down Expand Up @@ -65,7 +65,7 @@ def test_delete_user(gl, wait_for_sidekiq):
"email": "delete-user@test.com",
"username": "delete-user",
"name": "delete-user",
"password": "delete-user-pass",
"password": "E4596f8be406Bc3a14a4ccdb1df80587#!",
}
)

Expand Down Expand Up @@ -100,7 +100,7 @@ def test_list_multiple_users(gl, user):
"email": second_email,
"username": second_username,
"name": "Foo Bar",
"password": "foobar_password",
"password": "E4596f8be406Bc3a14a4ccdb1df80587#!",
}
)
assert gl.users.list(search=second_user.username)[0].id == second_user.id
Expand Down Expand Up @@ -143,9 +143,6 @@ def test_user_email(gl, user):


def test_user_custom_attributes(gl, user):
attrs = user.customattributes.list()
assert not attrs

attr = user.customattributes.set("key", "value1")
assert user in gl.users.list(custom_attributes={"key": "value1"})
assert attr.key == "key"
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/cli/test_cli_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def test_create_user(gitlab_cli, gl):
email = "fake@email.com"
username = "user1"
name = "User One"
password = "fakepassword"
password = "E4596f8be406Bc3a14a4ccdb1df80587#!"

cmd = [
"user",
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ def user(gl):
email = f"user{_id}@email.com"
username = f"user{_id}"
name = f"User {_id}"
password = "fakepassword"
password = "E4596f8be406Bc3a14a4ccdb1df80587#!"

user = gl.users.create(email=email, username=username, name=name, password=password)

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/fixtures/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
GITLAB_IMAGE=gitlab/gitlab-ee
GITLAB_TAG=15.4.0-ee.0
GITLAB_TAG=15.8.1-ee.0