mirror of
https://github.com/PostHog/posthog.git
synced 2024-12-01 12:21:02 +01:00
faf75ebb5e
* refactor(ingestion): Make `KAFKA_ENABLED` true by default * Sync `KAFKA_HOSTS` defaults too * Update snapshots * Update "kafka" to "kafka:9092" * Revert "Update "kafka" to "kafka:9092"" This reverts commitd954ac6fa6
. * Update some tests * Revert "Revert "Update "kafka" to "kafka:9092""" This reverts commit07edfa6c5e
. * Update test_0004_replicated_schema.ambr * Remove `KAFKA_ENABLED` and `KAFKA_HOSTS` from places Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
31 lines
994 B
TypeScript
31 lines
994 B
TypeScript
import { getDefaultConfig, overrideWithEnv } from '../src/config/config'
|
|
|
|
describe('config', () => {
|
|
test('overrideWithEnv 1', () => {
|
|
const defaultConfig = getDefaultConfig()
|
|
const env = {
|
|
CLICKHOUSE_SECURE: 'false',
|
|
TASK_TIMEOUT: '3008',
|
|
CLICKHOUSE_HOST: '0.0.0.0',
|
|
BASE_DIR: undefined,
|
|
}
|
|
const config = overrideWithEnv(getDefaultConfig(), env)
|
|
|
|
expect(config.CLICKHOUSE_SECURE).toEqual(false)
|
|
expect(config.TASK_TIMEOUT).toEqual(3008)
|
|
expect(config.CLICKHOUSE_HOST).toEqual('0.0.0.0')
|
|
expect(config.BASE_DIR).toEqual(defaultConfig.BASE_DIR)
|
|
})
|
|
|
|
test('overrideWithEnv 2', () => {
|
|
const env = {
|
|
CLICKHOUSE_SECURE: '1',
|
|
TASK_TIMEOUT: '3008.12',
|
|
}
|
|
const config = overrideWithEnv(getDefaultConfig(), env)
|
|
|
|
expect(config.CLICKHOUSE_SECURE).toEqual(true)
|
|
expect(config.TASK_TIMEOUT).toEqual(3008.12)
|
|
})
|
|
})
|