Skip to content

Commit c42836d

Browse files
committed
add tests
1 parent 633dfac commit c42836d

27 files changed

+419
-0
lines changed

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,6 +1804,35 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten
18041804
expect(response.rawData()).toMatchSnapshot();
18051805
});
18061806

1807+
execute('querying BigECommerce: filtering with possible casts', async () => {
1808+
const response = await client.load({
1809+
measures: [
1810+
'BigECommerce.totalSales',
1811+
],
1812+
filters: [
1813+
{
1814+
values: ['10'],
1815+
member: 'BigECommerce.sales',
1816+
operator: 'gte'
1817+
},
1818+
{
1819+
values: ['true'],
1820+
member: 'BigECommerce.returning',
1821+
operator: 'equals'
1822+
}
1823+
],
1824+
timeDimensions: [{
1825+
dimension: 'BigECommerce.orderDate',
1826+
granularity: 'month',
1827+
dateRange: ['2020-01-01', '2020-12-31'],
1828+
}],
1829+
order: {
1830+
'BigECommerce.orderDate': 'asc',
1831+
}
1832+
});
1833+
expect(response.rawData()).toMatchSnapshot();
1834+
});
1835+
18071836
execute('querying custom granularities ECommerce: count by half_year + no dimension', async () => {
18081837
const response = await client.load({
18091838
measures: [

packages/cubejs-testing-drivers/test/__snapshots__/athena-export-bucket-s3-full.test.ts.snap

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9840,3 +9840,18 @@ Array [
98409840
},
98419841
]
98429842
`;
9843+
9844+
exports[`Queries with the @cubejs-backend/athena-driver querying BigECommerce: filtering with possible casts 1`] = `
9845+
Array [
9846+
Object {
9847+
"BigECommerce.orderDate": "2020-01-01T00:00:00.000",
9848+
"BigECommerce.orderDate.month": "2020-01-01T00:00:00.000",
9849+
"BigECommerce.totalSales": 48.896,
9850+
},
9851+
Object {
9852+
"BigECommerce.orderDate": "2020-12-01T00:00:00.000",
9853+
"BigECommerce.orderDate.month": "2020-12-01T00:00:00.000",
9854+
"BigECommerce.totalSales": 232.88,
9855+
},
9856+
]
9857+
`;

packages/cubejs-testing-drivers/test/__snapshots__/bigquery-export-bucket-gcs-full.test.ts.snap

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6260,6 +6260,21 @@ Array [
62606260
]
62616261
`;
62626262

6263+
exports[`Queries with the @cubejs-backend/bigquery-driver querying BigECommerce: filtering with possible casts 1`] = `
6264+
Array [
6265+
Object {
6266+
"BigECommerce.orderDate": "2020-01-01T00:00:00.000",
6267+
"BigECommerce.orderDate.month": "2020-01-01T00:00:00.000",
6268+
"BigECommerce.totalSales": 48.896,
6269+
},
6270+
Object {
6271+
"BigECommerce.orderDate": "2020-12-01T00:00:00.000",
6272+
"BigECommerce.orderDate.month": "2020-12-01T00:00:00.000",
6273+
"BigECommerce.totalSales": 232.88,
6274+
},
6275+
]
6276+
`;
6277+
62636278
exports[`Queries with the @cubejs-backend/bigquery-driver querying BigECommerce: partitioned pre-agg 1`] = `
62646279
Array [
62656280
Object {

packages/cubejs-testing-drivers/test/__snapshots__/clickhouse-export-bucket-s3-full.test.ts.snap

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9209,3 +9209,18 @@ Array [
92099209
},
92109210
]
92119211
`;
9212+
9213+
exports[`Queries with the @cubejs-backend/clickhouse-driver export-bucket-s3 querying BigECommerce: filtering with possible casts 1`] = `
9214+
Array [
9215+
Object {
9216+
"BigECommerce.orderDate": "2020-01-01T00:00:00.000",
9217+
"BigECommerce.orderDate.month": "2020-01-01T00:00:00.000",
9218+
"BigECommerce.totalSales": 48.896,
9219+
},
9220+
Object {
9221+
"BigECommerce.orderDate": "2020-12-01T00:00:00.000",
9222+
"BigECommerce.orderDate.month": "2020-12-01T00:00:00.000",
9223+
"BigECommerce.totalSales": 232.88,
9224+
},
9225+
]
9226+
`;

packages/cubejs-testing-drivers/test/__snapshots__/clickhouse-export-bucket-s3-prefix-full.test.ts.snap

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9209,3 +9209,18 @@ Array [
92099209
},
92109210
]
92119211
`;
9212+
9213+
exports[`Queries with the @cubejs-backend/clickhouse-driver export-bucket-s3-prefix querying BigECommerce: filtering with possible casts 1`] = `
9214+
Array [
9215+
Object {
9216+
"BigECommerce.orderDate": "2020-01-01T00:00:00.000",
9217+
"BigECommerce.orderDate.month": "2020-01-01T00:00:00.000",
9218+
"BigECommerce.totalSales": 48.896,
9219+
},
9220+
Object {
9221+
"BigECommerce.orderDate": "2020-12-01T00:00:00.000",
9222+
"BigECommerce.orderDate.month": "2020-12-01T00:00:00.000",
9223+
"BigECommerce.totalSales": 232.88,
9224+
},
9225+
]
9226+
`;

packages/cubejs-testing-drivers/test/__snapshots__/clickhouse-full.test.ts.snap

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9209,3 +9209,18 @@ Array [
92099209
},
92109210
]
92119211
`;
9212+
9213+
exports[`Queries with the @cubejs-backend/clickhouse-driver querying BigECommerce: filtering with possible casts 1`] = `
9214+
Array [
9215+
Object {
9216+
"BigECommerce.orderDate": "2020-01-01T00:00:00.000",
9217+
"BigECommerce.orderDate.month": "2020-01-01T00:00:00.000",
9218+
"BigECommerce.totalSales": 48.896,
9219+
},
9220+
Object {
9221+
"BigECommerce.orderDate": "2020-12-01T00:00:00.000",
9222+
"BigECommerce.orderDate.month": "2020-12-01T00:00:00.000",
9223+
"BigECommerce.totalSales": 232.88,
9224+
},
9225+
]
9226+
`;

packages/cubejs-testing-drivers/test/__snapshots__/databricks-jdbc-export-bucket-azure-full.test.ts.snap

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15980,3 +15980,18 @@ Array [
1598015980
},
1598115981
]
1598215982
`;
15983+
15984+
exports[`Queries with the @cubejs-backend/databricks-jdbc-driver export-bucket-azure querying BigECommerce: filtering with possible casts 1`] = `
15985+
Array [
15986+
Object {
15987+
"BigECommerce.orderDate": "2020-01-01T00:00:00.000",
15988+
"BigECommerce.orderDate.month": "2020-01-01T00:00:00.000",
15989+
"BigECommerce.totalSales": 48.896,
15990+
},
15991+
Object {
15992+
"BigECommerce.orderDate": "2020-12-01T00:00:00.000",
15993+
"BigECommerce.orderDate.month": "2020-12-01T00:00:00.000",
15994+
"BigECommerce.totalSales": 232.88,
15995+
},
15996+
]
15997+
`;

packages/cubejs-testing-drivers/test/__snapshots__/databricks-jdbc-export-bucket-azure-prefix-full.test.ts.snap

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15785,3 +15785,18 @@ Array [
1578515785
},
1578615786
]
1578715787
`;
15788+
15789+
exports[`Queries with the @cubejs-backend/databricks-jdbc-driver export-bucket-azure-prefix querying BigECommerce: filtering with possible casts 1`] = `
15790+
Array [
15791+
Object {
15792+
"BigECommerce.orderDate": "2020-01-01T00:00:00.000",
15793+
"BigECommerce.orderDate.month": "2020-01-01T00:00:00.000",
15794+
"BigECommerce.totalSales": 48.896,
15795+
},
15796+
Object {
15797+
"BigECommerce.orderDate": "2020-12-01T00:00:00.000",
15798+
"BigECommerce.orderDate.month": "2020-12-01T00:00:00.000",
15799+
"BigECommerce.totalSales": 232.88,
15800+
},
15801+
]
15802+
`;

packages/cubejs-testing-drivers/test/__snapshots__/databricks-jdbc-export-bucket-gcs-full.test.ts.snap

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15980,3 +15980,18 @@ Array [
1598015980
},
1598115981
]
1598215982
`;
15983+
15984+
exports[`Queries with the @cubejs-backend/databricks-jdbc-driver export-bucket-gcs querying BigECommerce: filtering with possible casts 1`] = `
15985+
Array [
15986+
Object {
15987+
"BigECommerce.orderDate": "2020-01-01T00:00:00.000",
15988+
"BigECommerce.orderDate.month": "2020-01-01T00:00:00.000",
15989+
"BigECommerce.totalSales": 48.896,
15990+
},
15991+
Object {
15992+
"BigECommerce.orderDate": "2020-12-01T00:00:00.000",
15993+
"BigECommerce.orderDate.month": "2020-12-01T00:00:00.000",
15994+
"BigECommerce.totalSales": 232.88,
15995+
},
15996+
]
15997+
`;

packages/cubejs-testing-drivers/test/__snapshots__/databricks-jdbc-export-bucket-gcs-prefix-full.test.ts.snap

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15785,3 +15785,18 @@ Array [
1578515785
},
1578615786
]
1578715787
`;
15788+
15789+
exports[`Queries with the @cubejs-backend/databricks-jdbc-driver export-bucket-gcs-prefix querying BigECommerce: filtering with possible casts 1`] = `
15790+
Array [
15791+
Object {
15792+
"BigECommerce.orderDate": "2020-01-01T00:00:00.000",
15793+
"BigECommerce.orderDate.month": "2020-01-01T00:00:00.000",
15794+
"BigECommerce.totalSales": 48.896,
15795+
},
15796+
Object {
15797+
"BigECommerce.orderDate": "2020-12-01T00:00:00.000",
15798+
"BigECommerce.orderDate.month": "2020-12-01T00:00:00.000",
15799+
"BigECommerce.totalSales": 232.88,
15800+
},
15801+
]
15802+
`;

0 commit comments

Comments
 (0)