chore(e2e): rename TEST_ENVIRONMENT to STATUS_RUNTIME_TEST_MODE

Because the environment variable name is far too generic and barely
means anything. It needs to clearly indicate that it's supposed to be
used at runtime and it changes how the Status app behaves.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2023-10-11 19:00:30 +02:00
parent 55833dad2d
commit ac935b00d7
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
4 changed files with 9 additions and 6 deletions

View File

@ -77,7 +77,8 @@ pipeline {
/* Ganache config */
GANACHE_RPC_PORT = "${9545 + env.EXECUTOR_NUMBER.toInteger()}"
GANACHE_MNEMONIC = 'pelican chief sudden oval media rare swamp elephant lawsuit wheat knife initial'
TEST_ENVIRONMENT = '1'
/* Runtime flag to make testing of the app easier. */
STATUS_RUNTIME_TEST_MODE = '1'
}
stages {

View File

@ -46,7 +46,7 @@ QtObject:
self.storeToKeychainValueChanged()
proc getStoreToKeychainValue*(self: LocalAccountSettings): string {.slot.} =
if(self.settings.isNil or existsEnv(TEST_ENVIRONMENT_VAR)):
if self.settings.isNil or TEST_MODE_ENABLED:
return DEFAULT_STORE_TO_KEYCHAIN
self.settings.value(LS_KEY_STORE_TO_KEYCHAIN).stringVal

View File

@ -17,7 +17,7 @@ const LAS_KEY_CUSTOM_MOUSE_SCROLLING_ENABLED = "global/custom_mouse_scroll_enabl
const DEFAULT_CUSTOM_MOUSE_SCROLLING_ENABLED = false
const DEFAULT_VISIBILITY = 2 #windowed visibility, from qml
const LAS_KEY_FAKE_LOADING_SCREEN_ENABLED = "global/fake_loading_screen"
const DEFAULT_FAKE_LOADING_SCREEN_ENABLED = defined(production) and (not existsEnv(TEST_ENVIRONMENT_VAR)) #enabled in production, disabled in development and e2e tests
const DEFAULT_FAKE_LOADING_SCREEN_ENABLED = defined(production) and not TEST_MODE_ENABLED #enabled in production, disabled in development and e2e tests
const LAS_KEY_SHARDED_COMMUNITIES_ENABLED = "global/sharded_communities"
const DEFAULT_LAS_KEY_SHARDED_COMMUNITIES_ENABLED = false
@ -144,8 +144,7 @@ QtObject:
proc getTestEnvironment*(self: LocalAppSettings): bool {.slot.} =
let value = getEnv(TEST_ENVIRONMENT_VAR)
return value.toUpperAscii() == "TRUE" or value == "1"
return TEST_MODE_ENABLED
QtProperty[bool] testEnvironment:
read = getTestEnvironment

View File

@ -88,4 +88,7 @@ const GIT_COMMIT* {.strdefine.} = ""
const APP_VERSION* = if defined(production): DESKTOP_VERSION else: fmt("{GIT_COMMIT}")
# Name of the test environment var to check for
const TEST_ENVIRONMENT_VAR* = "TEST_ENVIRONMENT"
const STATUS_RUNTIME_TEST_MODE_VAR* = "STATUS_RUNTIME_TEST_MODE"
const TEST_MODE_ENABLED* = getEnv(STATUS_RUNTIME_TEST_MODE_VAR).toUpperAscii() == "TRUE" or
getEnv(STATUS_RUNTIME_TEST_MODE_VAR) == "1"