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 1d5ca2dc7b
commit c5b5ac3c0a
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
6 changed files with 19 additions and 18 deletions

13
ci/Jenkinsfile vendored
View File

@ -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')
} } }
}

View File

@ -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)

View File

@ -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')

View File

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

View File

@ -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__()

View File

@ -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