chore: all CI server test jobs have all FFs on by default (#4016)
This commit is contained in:
committed by
GitHub
parent
aacaa09fa3
commit
49438f089d
@@ -495,7 +495,7 @@ jobs:
|
||||
REDIS_URL: 'redis://127.0.0.1:6379'
|
||||
S3_REGION: '' # optional, defaults to 'us-east-1'
|
||||
ENCRYPTION_KEYS_PATH: 'test/assets/automate/encryptionKeys.json'
|
||||
FF_BILLING_INTEGRATION_ENABLED: 'true'
|
||||
ENABLE_ALL_FFS: 'true'
|
||||
RATELIMITER_ENABLED: 'false'
|
||||
steps:
|
||||
- checkout
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
"dev:clean": "yarn build:clean && yarn dev",
|
||||
"dev:server:test": "cross-env DISABLE_NOTIFICATIONS_CONSUMPTION=true NODE_ENV=test LOG_LEVEL=silent LOG_PRETTY=true node ./bin/ts-www",
|
||||
"test": "cross-env NODE_ENV=test LOG_LEVEL=silent LOG_PRETTY=true mocha",
|
||||
"test:all-ff": "cross-env ENABLE_ALL_FFS=true yarn test",
|
||||
"test:multiregion": "cross-env RUN_TESTS_IN_MULTIREGION_MODE=true FF_WORKSPACES_MODULE_ENABLED=true FF_WORKSPACES_MULTI_REGION_ENABLED=true yarn test",
|
||||
"test:no-ff": "cross-env DISABLE_ALL_FFS=true yarn test",
|
||||
"test:coverage": "cross-env NODE_ENV=test LOG_LEVEL=silent LOG_PRETTY=true nyc --reporter lcov mocha",
|
||||
|
||||
@@ -3,6 +3,8 @@ import { z } from 'zod'
|
||||
|
||||
const isDisableAllFFsMode = () =>
|
||||
['true', '1'].includes(process.env.DISABLE_ALL_FFS || '')
|
||||
const isEnableAllFFsMode = () =>
|
||||
['true', '1'].includes(process.env.ENABLE_ALL_FFS || '')
|
||||
|
||||
const parseFeatureFlags = () => {
|
||||
//INFO
|
||||
@@ -68,10 +70,10 @@ const parseFeatureFlags = () => {
|
||||
}
|
||||
})
|
||||
|
||||
// Can be used to disable all feature flags for testing purposes
|
||||
if (isDisableAllFFsMode()) {
|
||||
// Can be used to disable/enable all feature flags for testing purposes
|
||||
if (isDisableAllFFsMode() || isEnableAllFFsMode()) {
|
||||
for (const key of Object.keys(res)) {
|
||||
;(res as Record<string, boolean>)[key] = false
|
||||
;(res as Record<string, boolean>)[key] = !isDisableAllFFsMode() // disable takes precedence
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user