MCPcopy Create free account
hub / github.com/code-pushup/cli / getShardedWal

Function getShardedWal

packages/utils/src/lib/wal-sharded.unit.test.ts:19–36  ·  view source on GitHub ↗
(overrides?: {
  dir?: string;
  format?: Partial<WalFormat>;
  autoCoordinator?: boolean;
  groupId?: string;
})

Source from the content-addressed store, hash-verified

17const read = (p: string) => vol.readFileSync(p, 'utf8') as string;
18
19const getShardedWal = (overrides?: {
20 dir?: string;
21 format?: Partial<WalFormat>;
22 autoCoordinator?: boolean;
23 groupId?: string;
24}) => {
25 const { format, ...rest } = overrides ?? {};
26 return new ShardedWal({
27 debug: false,
28 dir: '/test/shards',
29 format: parseWalFormat({
30 baseName: 'test-wal',
31 ...format,
32 }),
33 coordinatorIdEnvVar: SHARDED_WAL_COORDINATOR_ID_ENV_VAR,
34 ...rest,
35 });
36};
37
38const deleteEnvVar = (key: string) => {
39 // eslint-disable-next-line functional/immutable-data,@typescript-eslint/no-dynamic-delete

Callers 1

Calls 1

parseWalFormatFunction · 0.85

Tested by

no test coverage detected