fix: make CI runs use testnet and test-integration setup

pull/3054/head
Audric Ackermann 1 year ago
parent 261d67d496
commit 016d0ad03b

@ -1,5 +1,5 @@
import moment from 'moment'; import moment from 'moment';
import { isDevProd } from '../../shared/env_vars'; import { isCI, isDevProd } from '../../shared/env_vars';
import { LocalizerKeys } from '../../types/LocalizerKeys'; import { LocalizerKeys } from '../../types/LocalizerKeys';
type TimerOptionsEntry = { name: string; value: number }; type TimerOptionsEntry = { name: string; value: number };
@ -67,7 +67,7 @@ const VALUES: Array<number> = timerOptionsDurations.map(t => {
}); });
const filterOutDebugValues = (option: number) => { 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 => { const DELETE_AFTER_READ = VALUES.filter(option => {

@ -5,12 +5,19 @@ function envAppInstanceIncludes(prefix: string) {
return !!process.env.NODE_APP_INSTANCE.includes(prefix); 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() { export function isDevProd() {
return envAppInstanceIncludes('devprod'); return envAppInstanceIncludes('devprod');
} }
export function isTestNet() { export function isTestNet() {
return envAppInstanceIncludes('testnet'); return envAppInstanceIncludes('testnet') || isCI(); // when running on CI, we always want to use testnet
} }
export function isTestIntegration() { export function isTestIntegration() {
return envAppInstanceIncludes('test-integration'); return envAppInstanceIncludes('test-integration') || isCI(); // when running on CI, we always want the 'test-integration' behavior
} }

Loading…
Cancel
Save