From c5b5ac3c0a22b9c5816a1b102e38556c69d5ee3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Thu, 30 Nov 2023 12:05:59 +0100 Subject: [PATCH] fix(all): rename APP_DIR to AUT_PATH to reflect purpose MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The name APP_DIR suggests the path is a directory, but it's not. Signed-off-by: Jakub SokoĊ‚owski --- ci/Jenkinsfile | 13 +++++++------ configs/__init__.py | 10 +++++----- configs/_local.ci.py | 2 +- configs/_local.default.py | 2 +- driver/aut.py | 2 +- fixtures/aut.py | 8 ++++---- 6 files changed, 19 insertions(+), 18 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 874bbbd..9988fc7 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -91,13 +91,13 @@ pipeline { stage('Download') { when { expression { params.BUILD_SOURCE.startsWith('http') } } steps { timeout(5) { script { - sh 'mkdir -p ./tmp/pkg/' + sh 'mkdir -p ./pkg/' setBuildDescFromFile(params.BUILD_SOURCE) fileOperations([ fileDownloadOperation( url: params.BUILD_SOURCE, targetFileName: 'StatusIm-Desktop.tar.gz', - targetLocation: './tmp/pkg/', + targetLocation: './pkg/', userName: '', password: '', ) @@ -112,16 +112,17 @@ pipeline { projectName: params.BUILD_SOURCE, filter: 'pkg/*-x86_64.tar.gz', selector: lastWithArtifacts(), - target: './tmp' + target: './' ) - setBuildDescFromFile(utils.findFile('tmp/pkg/*tar.gz')) + setBuildDescFromFile(utils.findFile('pkg/*tar.gz')) } } } } stage('Unpack') { steps { timeout(5) { script { - sh "tar -zxvf '${utils.findFile('tmp/pkg/*tar.gz')}' -C './tmp'" - env.APP_DIR = utils.findFile('tmp/*.AppImage') + sh 'mkdir aut' + sh "tar -zxvf '${utils.findFile('pkg/*tar.gz')}' -C './aut'" + env.AUT_PATH = utils.findFile('aut/*.AppImage') } } } } diff --git a/configs/__init__.py b/configs/__init__.py index c8a0969..8609afe 100644 --- a/configs/__init__.py +++ b/configs/__init__.py @@ -14,8 +14,8 @@ except ImportError: rf'cp {testpath.ROOT}/configs/_local.default.py {testpath.ROOT}/configs/_local.py' ) -if APP_DIR is None: - exit('Please add "APP_DIR" in ./configs/_local.py') -if system.IS_WIN and 'bin' not in APP_DIR: - exit('Please use launcher from "bin" folder in "APP_DIR"') -APP_DIR = SystemPath(APP_DIR) +if AUT_PATH is None: + exit('Please add "AUT_PATH" in ./configs/_local.py') +if system.IS_WIN and 'bin' not in AUT_PATH: + exit('Please use launcher from "bin" folder in "AUT_PATH"') +AUT_PATH = SystemPath(AUT_PATH) diff --git a/configs/_local.ci.py b/configs/_local.ci.py index f5d64ed..8f85087 100644 --- a/configs/_local.ci.py +++ b/configs/_local.ci.py @@ -4,4 +4,4 @@ import os LOG_LEVEL = logging.INFO UPDATE_VP_ON_FAIL = False DEV_BUILD = False -APP_DIR = os.getenv('APP_DIR') +AUT_PATH = os.getenv('AUT_PATH') diff --git a/configs/_local.default.py b/configs/_local.default.py index 24fa2da..48a4d24 100644 --- a/configs/_local.default.py +++ b/configs/_local.default.py @@ -3,4 +3,4 @@ import logging LOG_LEVEL = logging.DEBUG UPDATE_VP_ON_FAIL = False DEV_BUILD = False -APP_DIR = None +AUT_PATH = None diff --git a/driver/aut.py b/driver/aut.py index 4394dbb..fbd3723 100644 --- a/driver/aut.py +++ b/driver/aut.py @@ -22,7 +22,7 @@ _logger = logging.getLogger(__name__) class AUT: def __init__( self, - app_path: system_path.SystemPath = configs.APP_DIR, + app_path: system_path.SystemPath = configs.AUT_PATH, user_data: SystemPath = None ): super(AUT, self).__init__() diff --git a/fixtures/aut.py b/fixtures/aut.py index 41dcc75..1c3fcca 100644 --- a/fixtures/aut.py +++ b/fixtures/aut.py @@ -38,8 +38,8 @@ def user_data(request) -> system_path.SystemPath: @pytest.fixture def aut(user_data) -> AUT: - if not configs.APP_DIR.exists(): - pytest.exit(f"Application not found: {configs.APP_DIR}") + if not configs.AUT_PATH.exists(): + pytest.exit(f"Application not found: {configs.AUT_PATH}") _aut = AUT(user_data=user_data) yield _aut @@ -47,8 +47,8 @@ def aut(user_data) -> AUT: @pytest.fixture() def multiple_instance(): def _aut(user_data: SystemPath = None) -> AUT: - if not configs.APP_DIR.exists(): - pytest.exit(f"Application not found: {configs.APP_DIR}") + if not configs.AUT_PATH.exists(): + pytest.exit(f"Application not found: {configs.AUT_PATH}") return AUT(user_data=user_data) yield _aut