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:
parent
55833dad2d
commit
ac935b00d7
|
@ -77,7 +77,8 @@ pipeline {
|
||||||
/* Ganache config */
|
/* Ganache config */
|
||||||
GANACHE_RPC_PORT = "${9545 + env.EXECUTOR_NUMBER.toInteger()}"
|
GANACHE_RPC_PORT = "${9545 + env.EXECUTOR_NUMBER.toInteger()}"
|
||||||
GANACHE_MNEMONIC = 'pelican chief sudden oval media rare swamp elephant lawsuit wheat knife initial'
|
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 {
|
stages {
|
||||||
|
|
|
@ -46,7 +46,7 @@ QtObject:
|
||||||
self.storeToKeychainValueChanged()
|
self.storeToKeychainValueChanged()
|
||||||
|
|
||||||
proc getStoreToKeychainValue*(self: LocalAccountSettings): string {.slot.} =
|
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
|
return DEFAULT_STORE_TO_KEYCHAIN
|
||||||
|
|
||||||
self.settings.value(LS_KEY_STORE_TO_KEYCHAIN).stringVal
|
self.settings.value(LS_KEY_STORE_TO_KEYCHAIN).stringVal
|
||||||
|
|
|
@ -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_CUSTOM_MOUSE_SCROLLING_ENABLED = false
|
||||||
const DEFAULT_VISIBILITY = 2 #windowed visibility, from qml
|
const DEFAULT_VISIBILITY = 2 #windowed visibility, from qml
|
||||||
const LAS_KEY_FAKE_LOADING_SCREEN_ENABLED = "global/fake_loading_screen"
|
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 LAS_KEY_SHARDED_COMMUNITIES_ENABLED = "global/sharded_communities"
|
||||||
const DEFAULT_LAS_KEY_SHARDED_COMMUNITIES_ENABLED = false
|
const DEFAULT_LAS_KEY_SHARDED_COMMUNITIES_ENABLED = false
|
||||||
|
|
||||||
|
@ -144,8 +144,7 @@ QtObject:
|
||||||
|
|
||||||
|
|
||||||
proc getTestEnvironment*(self: LocalAppSettings): bool {.slot.} =
|
proc getTestEnvironment*(self: LocalAppSettings): bool {.slot.} =
|
||||||
let value = getEnv(TEST_ENVIRONMENT_VAR)
|
return TEST_MODE_ENABLED
|
||||||
return value.toUpperAscii() == "TRUE" or value == "1"
|
|
||||||
|
|
||||||
QtProperty[bool] testEnvironment:
|
QtProperty[bool] testEnvironment:
|
||||||
read = getTestEnvironment
|
read = getTestEnvironment
|
||||||
|
|
|
@ -88,4 +88,7 @@ const GIT_COMMIT* {.strdefine.} = ""
|
||||||
const APP_VERSION* = if defined(production): DESKTOP_VERSION else: fmt("{GIT_COMMIT}")
|
const APP_VERSION* = if defined(production): DESKTOP_VERSION else: fmt("{GIT_COMMIT}")
|
||||||
|
|
||||||
# Name of the test environment var to check for
|
# 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"
|
Loading…
Reference in New Issue