diff --git a/ts/session/disappearing_messages/timerOptions.ts b/ts/session/disappearing_messages/timerOptions.ts index 1dc1267f3..b5b93aa2f 100644 --- a/ts/session/disappearing_messages/timerOptions.ts +++ b/ts/session/disappearing_messages/timerOptions.ts @@ -1,5 +1,5 @@ import moment from 'moment'; -import { isDevProd } from '../../shared/env_vars'; +import { isCI, isDevProd } from '../../shared/env_vars'; import { LocalizerKeys } from '../../types/LocalizerKeys'; type TimerOptionsEntry = { name: string; value: number }; @@ -67,7 +67,7 @@ const VALUES: Array = timerOptionsDurations.map(t => { }); const filterOutDebugValues = (option: number) => { - return isDevProd() || option > 60; // when not a dev build, filter out options with less than 60s + return isDevProd() || isCI() || option > 60; // when not a dev build nor on CI, filter out options with less than 60s }; const DELETE_AFTER_READ = VALUES.filter(option => { diff --git a/ts/shared/env_vars.ts b/ts/shared/env_vars.ts index 349277c42..d87b8b428 100644 --- a/ts/shared/env_vars.ts +++ b/ts/shared/env_vars.ts @@ -5,12 +5,19 @@ function envAppInstanceIncludes(prefix: string) { return !!process.env.NODE_APP_INSTANCE.includes(prefix); } +export function isCI() { + // this is set by session-playwright to run a build on CI + return !!process.env.CI; +} + export function isDevProd() { return envAppInstanceIncludes('devprod'); } + export function isTestNet() { - return envAppInstanceIncludes('testnet'); + return envAppInstanceIncludes('testnet') || isCI(); // when running on CI, we always want to use testnet } + export function isTestIntegration() { - return envAppInstanceIncludes('test-integration'); + return envAppInstanceIncludes('test-integration') || isCI(); // when running on CI, we always want the 'test-integration' behavior }