diff --git a/tests/functional/api/test_bulk_imports.py b/tests/functional/api/test_bulk_imports.py index 899d35840..6eda12ab9 100644 --- a/tests/functional/api/test_bulk_imports.py +++ b/tests/functional/api/test_bulk_imports.py @@ -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, diff --git a/tests/functional/api/test_groups.py b/tests/functional/api/test_groups.py index ec381d594..14e6a06c9 100644 --- a/tests/functional/api/test_groups.py +++ b/tests/functional/api/test_groups.py @@ -10,7 +10,7 @@ def test_groups(gl): "email": "user@test.com", "username": "user", "name": "user", - "password": "user_pass", + "password": "E4596f8be406Bc3a14a4ccdb1df80587#!1", } ) user2 = gl.users.create( @@ -18,7 +18,7 @@ def test_groups(gl): "email": "user2@test.com", "username": "user2", "name": "user2", - "password": "user2_pass", + "password": "E4596f8be406Bc3a14a4ccdb1df80587#!#2", } ) group1 = gl.groups.create( diff --git a/tests/functional/api/test_users.py b/tests/functional/api/test_users.py index 3209e65c8..70e0ee51d 100644 --- a/tests/functional/api/test_users.py +++ b/tests/functional/api/test_users.py @@ -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"), } ) @@ -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#!", } ) @@ -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 @@ -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" diff --git a/tests/functional/cli/test_cli_v4.py b/tests/functional/cli/test_cli_v4.py index 684293f30..7bc3a050c 100644 --- a/tests/functional/cli/test_cli_v4.py +++ b/tests/functional/cli/test_cli_v4.py @@ -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", diff --git a/tests/functional/conftest.py b/tests/functional/conftest.py index 34b286b4d..949f57239 100644 --- a/tests/functional/conftest.py +++ b/tests/functional/conftest.py @@ -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) diff --git a/tests/functional/fixtures/.env b/tests/functional/fixtures/.env index 449bc84a1..855565ccf 100644 --- a/tests/functional/fixtures/.env +++ b/tests/functional/fixtures/.env @@ -1,2 +1,2 @@ GITLAB_IMAGE=gitlab/gitlab-ee -GITLAB_TAG=15.4.0-ee.0 +GITLAB_TAG=15.8.1-ee.0