fix(all): rename APP_DIR to AUT_PATH to reflect purpose

The name APP_DIR suggests the path is a directory, but it's not.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2023-11-30 12:05:59 +01:00
parent bbc81717ce
commit 5d8d7aaa39
6 changed files with 19 additions and 18 deletions

View File

@ -91,13 +91,13 @@ pipeline {
stage('Download') { stage('Download') {
when { expression { params.BUILD_SOURCE.startsWith('http') } } when { expression { params.BUILD_SOURCE.startsWith('http') } }
steps { timeout(5) { script { steps { timeout(5) { script {
sh 'mkdir -p ./tmp/pkg/' sh 'mkdir -p ./pkg/'
setBuildDescFromFile(params.BUILD_SOURCE) setBuildDescFromFile(params.BUILD_SOURCE)
fileOperations([ fileOperations([
fileDownloadOperation( fileDownloadOperation(
url: params.BUILD_SOURCE, url: params.BUILD_SOURCE,
targetFileName: 'StatusIm-Desktop.tar.gz', targetFileName: 'StatusIm-Desktop.tar.gz',
targetLocation: './tmp/pkg/', targetLocation: './pkg/',
userName: '', userName: '',
password: '', password: '',
) )
@ -112,16 +112,17 @@ pipeline {
projectName: params.BUILD_SOURCE, projectName: params.BUILD_SOURCE,
filter: 'pkg/*-x86_64.tar.gz', filter: 'pkg/*-x86_64.tar.gz',
selector: lastWithArtifacts(), selector: lastWithArtifacts(),
target: './tmp' target: './'
) )
setBuildDescFromFile(utils.findFile('tmp/pkg/*tar.gz')) setBuildDescFromFile(utils.findFile('pkg/*tar.gz'))
} } } } } }
} }
stage('Unpack') { stage('Unpack') {
steps { timeout(5) { script { steps { timeout(5) { script {
sh "tar -zxvf '${utils.findFile('tmp/pkg/*tar.gz')}' -C './tmp'" sh 'mkdir aut'
env.APP_DIR = utils.findFile('tmp/*.AppImage') sh "tar -zxvf '${utils.findFile('pkg/*tar.gz')}' -C './aut'"
env.AUT_PATH = utils.findFile('aut/*.AppImage')
} } } } } }
} }

View File

@ -14,8 +14,8 @@ except ImportError:
rf'cp {testpath.ROOT}/configs/_local.default.py {testpath.ROOT}/configs/_local.py' rf'cp {testpath.ROOT}/configs/_local.default.py {testpath.ROOT}/configs/_local.py'
) )
if APP_DIR is None: if AUT_PATH is None:
exit('Please add "APP_DIR" in ./configs/_local.py') exit('Please add "AUT_PATH" in ./configs/_local.py')
if system.IS_WIN and 'bin' not in APP_DIR: if system.IS_WIN and 'bin' not in AUT_PATH:
exit('Please use launcher from "bin" folder in "APP_DIR"') exit('Please use launcher from "bin" folder in "AUT_PATH"')
APP_DIR = SystemPath(APP_DIR) AUT_PATH = SystemPath(AUT_PATH)

View File

@ -4,4 +4,4 @@ import os
LOG_LEVEL = logging.INFO LOG_LEVEL = logging.INFO
UPDATE_VP_ON_FAIL = False UPDATE_VP_ON_FAIL = False
DEV_BUILD = False DEV_BUILD = False
APP_DIR = os.getenv('APP_DIR') AUT_PATH = os.getenv('AUT_PATH')

View File

@ -3,4 +3,4 @@ import logging
LOG_LEVEL = logging.DEBUG LOG_LEVEL = logging.DEBUG
UPDATE_VP_ON_FAIL = False UPDATE_VP_ON_FAIL = False
DEV_BUILD = False DEV_BUILD = False
APP_DIR = None AUT_PATH = None

View File

@ -22,7 +22,7 @@ _logger = logging.getLogger(__name__)
class AUT: class AUT:
def __init__( def __init__(
self, self,
app_path: system_path.SystemPath = configs.APP_DIR, app_path: system_path.SystemPath = configs.AUT_PATH,
user_data: SystemPath = None user_data: SystemPath = None
): ):
super(AUT, self).__init__() super(AUT, self).__init__()

View File

@ -38,8 +38,8 @@ def user_data(request) -> system_path.SystemPath:
@pytest.fixture @pytest.fixture
def aut(user_data) -> AUT: def aut(user_data) -> AUT:
if not configs.APP_DIR.exists(): if not configs.AUT_PATH.exists():
pytest.exit(f"Application not found: {configs.APP_DIR}") pytest.exit(f"Application not found: {configs.AUT_PATH}")
_aut = AUT(user_data=user_data) _aut = AUT(user_data=user_data)
yield _aut yield _aut
@ -47,8 +47,8 @@ def aut(user_data) -> AUT:
@pytest.fixture() @pytest.fixture()
def multiple_instance(): def multiple_instance():
def _aut(user_data: SystemPath = None) -> AUT: def _aut(user_data: SystemPath = None) -> AUT:
if not configs.APP_DIR.exists(): if not configs.AUT_PATH.exists():
pytest.exit(f"Application not found: {configs.APP_DIR}") pytest.exit(f"Application not found: {configs.AUT_PATH}")
return AUT(user_data=user_data) return AUT(user_data=user_data)
yield _aut yield _aut