Skip to content

Commit 4aee42c

Browse files
committed
fix actually incorrect tests
1 parent c0e3762 commit 4aee42c

File tree

1 file changed

+27
-29
lines changed

1 file changed

+27
-29
lines changed

packages/cubejs-schema-compiler/test/integration/postgres/sql-generation.test.ts

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5198,7 +5198,7 @@ cubes:
51985198
sql: amount
51995199
type: sum
52005200
5201-
# Join loop for testing transitive joins
5201+
# Model for testing multiple joins to the same cube via transitive joins
52025202
- name: alpha_facts
52035203
sql: |
52045204
(
@@ -5345,34 +5345,32 @@ cubes:
53455345
});
53465346
}
53475347

5348-
if (!getEnv('nativeSqlPlanner')) {
5349-
it('querying cube with transitive joins with a few joins to same cube', async () => {
5350-
await compiler.compile();
5348+
it('querying cube with transitive joins with a few joins to same cube', async () => {
5349+
// TODO: This is not supported atm, but it's a good case, so keeeping this test
5350+
// for the future implementation
5351+
5352+
// await compiler.compile();
5353+
//
5354+
// const query = new PostgresQuery({ joinGraph, cubeEvaluator, compiler }, {
5355+
// measures: [],
5356+
// dimensions: [
5357+
// 'alpha_facts.reporting_date',
5358+
// 'delta_bridge.b_name',
5359+
// 'alpha_facts.channel'
5360+
// ],
5361+
// order: [{
5362+
// id: 'alpha_facts.reporting_date'
5363+
// }],
5364+
// timezone: 'America/Los_Angeles'
5365+
// });
5366+
//
5367+
// const res = await dbRunner.testQuery(query.buildSqlAndParams());
5368+
// console.log(JSON.stringify(res));
5369+
//
5370+
// expect(res).toEqual([
5371+
// // Fill
5372+
// ]);
5373+
});
53515374

5352-
try {
5353-
const query = new PostgresQuery({ joinGraph, cubeEvaluator, compiler }, {
5354-
measures: [],
5355-
dimensions: [
5356-
'alpha_facts.reporting_date',
5357-
'delta_bridge.b_name',
5358-
'alpha_facts.channel'
5359-
],
5360-
order: [{
5361-
id: 'alpha_facts.reporting_date'
5362-
}],
5363-
timezone: 'America/Los_Angeles'
5364-
});
5365-
5366-
await dbRunner.testQuery(query.buildSqlAndParams());
5367-
throw new Error('Should have thrown an error');
5368-
} catch (err: any) {
5369-
expect(err.message).toContain('Can not construct joins for the query, potential loop detected');
5370-
}
5371-
});
5372-
} else {
5373-
it.skip('FIXME(tesseract): querying cube dimension that require transitive joins', async () => {
5374-
// FIXME should be implemented in Tesseract
5375-
});
5376-
}
53775375
});
53785376
});

0 commit comments

Comments
 (0)