Skip to content

Commit ebb6712

Browse files
KSDaemonwaralexrom
authored andcommitted
chore(ci): Set up CI tesseract drivers testing
1 parent f60b4aa commit ebb6712

File tree

5 files changed

+50
-5
lines changed

5 files changed

+50
-5
lines changed

.github/workflows/drivers-tests.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ on:
6868
- 'true'
6969
- 'false'
7070

71-
env:
72-
USE_TESSERACT_SQL_PLANNER: false
73-
7471
jobs:
7572
latest-tag-sha:
7673
runs-on: ubuntu-24.04
@@ -268,6 +265,12 @@ jobs:
268265
- snowflake-export-bucket-azure-via-storage-integration
269266
- snowflake-export-bucket-gcs
270267
- snowflake-export-bucket-gcs-prefix
268+
use_tesseract_sql_planner: [ false ]
269+
include:
270+
- database: postgres
271+
use_tesseract_sql_planner: true
272+
- database: bigquery-export-bucket-gcs
273+
use_tesseract_sql_planner: true
271274
fail-fast: false
272275

273276
steps:
@@ -334,7 +337,7 @@ jobs:
334337
(contains(env.CLOUD_DATABASES, matrix.database) && env.DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY != '') ||
335338
(!contains(env.CLOUD_DATABASES, matrix.database))
336339
env:
337-
DRIVERS_TESTS_CUBEJS_TESSERACT_SQL_PLANNER: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.use_tesseract_sql_planner || env.USE_TESSERACT_SQL_PLANNER }}
340+
DRIVERS_TESTS_CUBEJS_TESSERACT_SQL_PLANNER: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.use_tesseract_sql_planner) || matrix.use_tesseract_sql_planner }}
338341

339342
# Athena
340343
DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY: ${{ secrets.DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY }}

packages/cubejs-testing-drivers/fixtures/bigquery.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,5 +172,24 @@
172172
"SQL API: Rollup with aliases",
173173
"SQL API: Nested Rollup over asterisk",
174174
"SQL API: Extended nested Rollup over asterisk"
175+
],
176+
"tesseractSkip": [
177+
"querying Products: dimensions -- doesn't work wo ordering",
178+
"querying ECommerce: total quantity, avg discount, total sales, total profit by product + order + total -- rounding in athena",
179+
"querying ECommerce: total sales, total profit by month + order (date) + total -- doesn't work with the BigQuery",
180+
"querying ECommerce: total quantity, avg discount, total sales, total profit by product + order + total -- noisy test",
181+
"pre-aggregations Customers: running total without time dimension",
182+
"querying BigECommerce: null boolean",
183+
"querying BigECommerce: rolling count_distinct_approx window by 2 day",
184+
"querying BigECommerce: rolling count_distinct_approx window by 2 week",
185+
"querying BigECommerce: rolling count_distinct_approx window by 2 month",
186+
"querying BigECommerce: totalProfitYearAgo",
187+
"SQL API: post-aggregate percentage of total",
188+
"SQL API: Simple Rollup",
189+
"SQL API: Rollup over exprs",
190+
"SQL API: Nested Rollup",
191+
"SQL API: Nested Rollup with aliases",
192+
"SQL API: Timeshift measure from cube",
193+
"SQL API: SQL push down push to cube quoted alias"
175194
]
176195
}

packages/cubejs-testing-drivers/fixtures/postgres.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,5 +162,23 @@
162162
"querying BigECommerce: rolling window by 2 day without date range",
163163
"querying BigECommerce: rolling window by 2 month without date range",
164164
"querying BigECommerce: rolling window YTD without date range"
165+
],
166+
"tesseractSkip": [
167+
"querying Products: dimensions -- doesn't work wo ordering",
168+
"querying ECommerce: total quantity, avg discount, total sales, total profit by product + order + total -- rounding in athena",
169+
"querying ECommerce: total quantity, avg discount, total sales, total profit by product + order + total -- noisy test",
170+
"pre-aggregations Customers: running total without time dimension",
171+
"querying BigECommerce: totalProfitYearAgo",
172+
"SQL API: post-aggregate percentage of total",
173+
"SQL API: Simple Rollup",
174+
"SQL API: Complex Rollup",
175+
"SQL API: Rollup with aliases",
176+
"SQL API: Rollup over exprs",
177+
"SQL API: Nested Rollup",
178+
"SQL API: Nested Rollup with aliases",
179+
"SQL API: Nested Rollup over asterisk",
180+
"SQL API: Extended nested Rollup over asterisk",
181+
"SQL API: Timeshift measure from cube",
182+
"SQL API: SQL push down push to cube quoted alias"
165183
]
166184
}

packages/cubejs-testing-drivers/src/tests/testQueries.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten
2626
describe(`Queries with the @cubejs-backend/${type}-driver${extendedEnv ? ` ${extendedEnv}` : ''}`, () => {
2727
jest.setTimeout(60 * 5 * 1000);
2828

29+
const isTesseractEnv = process.env.DRIVERS_TESTS_CUBEJS_TESSERACT_SQL_PLANNER && process.env.DRIVERS_TESTS_CUBEJS_TESSERACT_SQL_PLANNER.toLowerCase() === 'true';
30+
2931
const fixtures = getFixtures(type, extendedEnv);
3032
let client: CubeApi;
3133
let driver: BaseDriver;
@@ -65,7 +67,9 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten
6567
}
6668

6769
function execute(name: string, test: () => Promise<void>) {
68-
if (fixtures.skip && fixtures.skip.indexOf(name) >= 0) {
70+
if (!isTesseractEnv && fixtures.skip && fixtures.skip.indexOf(name) >= 0) {
71+
it.skip(name, test);
72+
} else if (isTesseractEnv && fixtures.tesseractSkip && fixtures.tesseractSkip.indexOf(name) >= 0) {
6973
it.skip(name, test);
7074
} else {
7175
it(name, test);

packages/cubejs-testing-drivers/src/types/Fixture.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ export type Fixture = {
3131
[cube: string]: [{ name: string, [prop: string]: unknown }],
3232
},
3333
skip?: string[],
34+
tesseractSkip?: string[],
3435
};

0 commit comments

Comments
 (0)