Skip to content

Commit

Permalink
Fix clickhouseUseCollation tests to check for default value
Browse files Browse the repository at this point in the history
  • Loading branch information
casab committed Feb 6, 2025
1 parent a2616fe commit ce3ec56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/cubejs-backend-shared/test/db_env_multi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1561,8 +1561,8 @@ describe('Multiple datasources', () => {
delete process.env.CUBEJS_DB_CLICKHOUSE_SORT_COLLATION;
delete process.env.CUBEJS_DS_POSTGRES_DB_CLICKHOUSE_SORT_COLLATION;
delete process.env.CUBEJS_DS_WRONG_DB_CLICKHOUSE_SORT_COLLATION;
expect(getEnv('clickhouseSortCollation', { dataSource: 'default' })).toBeUndefined();
expect(getEnv('clickhouseSortCollation', { dataSource: 'postgres' })).toBeUndefined();
expect(getEnv('clickhouseSortCollation', { dataSource: 'default' })).toEqual('en');
expect(getEnv('clickhouseSortCollation', { dataSource: 'postgres' })).toEqual('en');
expect(() => getEnv('clickhouseSortCollation', { dataSource: 'wrong' })).toThrow(
'The wrong data source is missing in the declared CUBEJS_DATASOURCES.'
);
Expand Down
6 changes: 3 additions & 3 deletions packages/cubejs-backend-shared/test/db_env_single.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -987,9 +987,9 @@ describe('Single datasources', () => {
expect(getEnv('clickhouseSortCollation', { dataSource: 'wrong' })).toEqual('default2');

delete process.env.CUBEJS_DB_CLICKHOUSE_SORT_COLLATION;
expect(getEnv('clickhouseSortCollation', { dataSource: 'default' })).toBeUndefined();
expect(getEnv('clickhouseSortCollation', { dataSource: 'postgres' })).toBeUndefined();
expect(getEnv('clickhouseSortCollation', { dataSource: 'wrong' })).toBeUndefined();
expect(getEnv('clickhouseSortCollation', { dataSource: 'default' })).toEqual('en');
expect(getEnv('clickhouseSortCollation', { dataSource: 'postgres' })).toEqual('en');
expect(getEnv('clickhouseSortCollation', { dataSource: 'wrong' })).toEqual('en');
});

test('getEnv("clickhouseUseCollation")', () => {
Expand Down

0 comments on commit ce3ec56

Please sign in to comment.