diff --git a/.drone.star b/.drone.star index 52cd3c46343..ca36c9a880a 100644 --- a/.drone.star +++ b/.drone.star @@ -27,9 +27,9 @@ OC_CI_CLIENT_FEDORA = "owncloudci/client:fedora-39-amd64" OC_CI_SQUISH = "owncloudci/squish:fedora-39-7.2.1-qt66x-linux64" PLUGINS_GIT_ACTION = "plugins/git-action:1" -PLUGINS_S3 = "plugins/s3" +PLUGINS_S3 = "plugins/s3:1.4.0" PLUGINS_SLACK = "plugins/slack" -TOOLHIPPIE_CALENS = "toolhippie/calens:latest" +TOOLHIPPIE_CALENS = "toolhippie/calens:0.4.0" # npm packages to install NPM_GHERLINT = "@gherlint/gherlint@1.1.0" diff --git a/test/gui/shared/scripts/bdd_hooks.py b/test/gui/shared/scripts/bdd_hooks.py index c3a80ee4145..101e135e92d 100644 --- a/test/gui/shared/scripts/bdd_hooks.py +++ b/test/gui/shared/scripts/bdd_hooks.py @@ -25,7 +25,7 @@ from helpers.SyncHelper import closeSocketConnection, clearWaitedAfterSync from helpers.SpaceHelper import delete_project_spaces from helpers.api.provisioning import delete_created_groups, delete_created_users -from helpers.SetupClientHelper import wait_until_app_killed +from helpers.SetupClientHelper import wait_until_app_killed, unlock_keyring from helpers.ConfigHelper import ( init_config, get_config, @@ -63,6 +63,7 @@ def hook(context): # Order: 1 @OnScenarioStart def hook(context): + unlock_keyring() clear_scenario_config() @@ -170,8 +171,13 @@ def save_screenrecord(filename): ) if not os.path.exists(screenrecords_dir): os.makedirs(screenrecords_dir) - if video_files: - shutil.move(video_files[0], os.path.join(screenrecords_dir, filename)) + # reverse the list to get the latest video first + video_files.reverse() + for idx, video in enumerate(video_files): + if idx: + file_parts = filename.rsplit(".", 1) + filename = f"{file_parts[0]}_{idx+1}.{file_parts[1]}" + shutil.move(video, os.path.join(screenrecords_dir, filename)) shutil.rmtree(prefix_path_namespace(video_dir)) diff --git a/test/gui/shared/scripts/helpers/SetupClientHelper.py b/test/gui/shared/scripts/helpers/SetupClientHelper.py index a32dc38d46d..32584508e12 100644 --- a/test/gui/shared/scripts/helpers/SetupClientHelper.py +++ b/test/gui/shared/scripts/helpers/SetupClientHelper.py @@ -1,4 +1,6 @@ import uuid +import os +import subprocess from urllib.parse import urlparse from os import makedirs from os.path import exists, join @@ -207,3 +209,51 @@ def wait_until_app_killed(pid=0): def generate_UUIDV4(): return str(uuid.uuid4()) + + +# sometimes the keyring is locked during the test execution +# and we need to unlock it +def unlock_keyring(): + if isWindows(): + return + + stdout, stderr, _ = run_sys_command( + [ + 'busctl', + '--user', + 'get-property', + 'org.freedesktop.secrets', + '/org/freedesktop/secrets/collection/login', + 'org.freedesktop.Secret.Collection', + 'Locked', + ] + ) + output = '' + if stdout: + output = stdout.decode('utf-8') + if stderr: + output = stderr.decode('utf-8') + test.log(output) + if not output.strip().endswith('false'): + test.log('Unlocking keyring...') + password = os.getenv('VNC_PW') + command = f'echo -n "{password}" | gnome-keyring-daemon -r --unlock' + stdout, stderr, returncode = run_sys_command(command, True) + if stdout: + output = stdout.decode('utf-8') + if stderr: + output = stderr.decode('utf-8') + if returncode: + test.log(f'Failed to unlock keyring:\n{output}') + test.log(output) + + +def run_sys_command(command=None, shell=False): + cmd = subprocess.run( + command, + shell=shell, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + check=False, + ) + return cmd.stdout, cmd.stderr, cmd.returncode