@cubejs-backend/testing 1.8.14 → 1.8.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/birdbox-fixtures/view-join/schema/customers.yml +32 -0
- package/birdbox-fixtures/view-join/schema/orders.yml +23 -0
- package/birdbox-fixtures/view-join/schema/payments.yml +23 -0
- package/birdbox-fixtures/view-join/schema/returns.yml +23 -0
- package/birdbox-fixtures/view-join/schema/views.yml +33 -0
- package/package.json +13 -12
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Shared dimension cube. Every fact joins to it; views expose `city` via
|
|
2
|
+
# `join_path: customers` (not through the fact) so the shared key resolves
|
|
3
|
+
# to one member on both sides of a SQL API join.
|
|
4
|
+
#
|
|
5
|
+
# id city created_at
|
|
6
|
+
# 1 Austin 2024-01-01
|
|
7
|
+
# 2 Austin 2024-01-01
|
|
8
|
+
# 3 Boston 2024-01-02
|
|
9
|
+
# 4 Chicago 2024-01-03
|
|
10
|
+
# 5 Denver 2024-01-03
|
|
11
|
+
cubes:
|
|
12
|
+
- name: customers
|
|
13
|
+
sql: >
|
|
14
|
+
SELECT 1 AS id, 'Austin' AS city, TIMESTAMP '2024-01-01 10:00:00' AS created_at UNION ALL
|
|
15
|
+
SELECT 2 AS id, 'Austin' AS city, TIMESTAMP '2024-01-01 12:00:00' AS created_at UNION ALL
|
|
16
|
+
SELECT 3 AS id, 'Boston' AS city, TIMESTAMP '2024-01-02 10:00:00' AS created_at UNION ALL
|
|
17
|
+
SELECT 4 AS id, 'Chicago' AS city, TIMESTAMP '2024-01-03 10:00:00' AS created_at UNION ALL
|
|
18
|
+
SELECT 5 AS id, 'Denver' AS city, TIMESTAMP '2024-01-03 12:00:00' AS created_at
|
|
19
|
+
|
|
20
|
+
dimensions:
|
|
21
|
+
- name: id
|
|
22
|
+
sql: id
|
|
23
|
+
type: number
|
|
24
|
+
primary_key: true
|
|
25
|
+
|
|
26
|
+
- name: city
|
|
27
|
+
sql: city
|
|
28
|
+
type: string
|
|
29
|
+
|
|
30
|
+
- name: created_at
|
|
31
|
+
sql: created_at
|
|
32
|
+
type: time
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Austin 150 (customers 1 and 2), Boston 70.
|
|
2
|
+
cubes:
|
|
3
|
+
- name: orders
|
|
4
|
+
sql: >
|
|
5
|
+
SELECT 1 AS id, 1 AS customer_id, 100 AS amount UNION ALL
|
|
6
|
+
SELECT 2 AS id, 2 AS customer_id, 50 AS amount UNION ALL
|
|
7
|
+
SELECT 3 AS id, 3 AS customer_id, 70 AS amount
|
|
8
|
+
|
|
9
|
+
joins:
|
|
10
|
+
- name: customers
|
|
11
|
+
sql: "{CUBE}.customer_id = {customers}.id"
|
|
12
|
+
relationship: many_to_one
|
|
13
|
+
|
|
14
|
+
dimensions:
|
|
15
|
+
- name: id
|
|
16
|
+
sql: id
|
|
17
|
+
type: number
|
|
18
|
+
primary_key: true
|
|
19
|
+
|
|
20
|
+
measures:
|
|
21
|
+
- name: revenue
|
|
22
|
+
sql: amount
|
|
23
|
+
type: sum
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Austin 120, Boston 70, Denver 20: the only fact with a Denver row.
|
|
2
|
+
cubes:
|
|
3
|
+
- name: payments
|
|
4
|
+
sql: >
|
|
5
|
+
SELECT 1 AS id, 1 AS customer_id, 120 AS amount UNION ALL
|
|
6
|
+
SELECT 2 AS id, 3 AS customer_id, 70 AS amount UNION ALL
|
|
7
|
+
SELECT 3 AS id, 5 AS customer_id, 20 AS amount
|
|
8
|
+
|
|
9
|
+
joins:
|
|
10
|
+
- name: customers
|
|
11
|
+
sql: "{CUBE}.customer_id = {customers}.id"
|
|
12
|
+
relationship: many_to_one
|
|
13
|
+
|
|
14
|
+
dimensions:
|
|
15
|
+
- name: id
|
|
16
|
+
sql: id
|
|
17
|
+
type: number
|
|
18
|
+
primary_key: true
|
|
19
|
+
|
|
20
|
+
measures:
|
|
21
|
+
- name: paid
|
|
22
|
+
sql: amount
|
|
23
|
+
type: sum
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Austin 10, Chicago 5: overlaps orders on Austin only, and each side has a
|
|
2
|
+
# city the other lacks (Boston / Chicago).
|
|
3
|
+
cubes:
|
|
4
|
+
- name: returns
|
|
5
|
+
sql: >
|
|
6
|
+
SELECT 1 AS id, 1 AS customer_id, 10 AS amount UNION ALL
|
|
7
|
+
SELECT 2 AS id, 4 AS customer_id, 5 AS amount
|
|
8
|
+
|
|
9
|
+
joins:
|
|
10
|
+
- name: customers
|
|
11
|
+
sql: "{CUBE}.customer_id = {customers}.id"
|
|
12
|
+
relationship: many_to_one
|
|
13
|
+
|
|
14
|
+
dimensions:
|
|
15
|
+
- name: id
|
|
16
|
+
sql: id
|
|
17
|
+
type: number
|
|
18
|
+
primary_key: true
|
|
19
|
+
|
|
20
|
+
measures:
|
|
21
|
+
- name: refunds
|
|
22
|
+
sql: amount
|
|
23
|
+
type: sum
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# `join_path: customers`, not `<fact>.customers`: the fact path is not plannable yet.
|
|
2
|
+
views:
|
|
3
|
+
- name: orders_view
|
|
4
|
+
cubes:
|
|
5
|
+
- join_path: orders
|
|
6
|
+
includes:
|
|
7
|
+
- revenue
|
|
8
|
+
- join_path: customers
|
|
9
|
+
includes:
|
|
10
|
+
- name: city
|
|
11
|
+
alias: customer_city
|
|
12
|
+
- created_at
|
|
13
|
+
|
|
14
|
+
- name: returns_view
|
|
15
|
+
cubes:
|
|
16
|
+
- join_path: returns
|
|
17
|
+
includes:
|
|
18
|
+
- refunds
|
|
19
|
+
- join_path: customers
|
|
20
|
+
includes:
|
|
21
|
+
- name: city
|
|
22
|
+
alias: customer_city
|
|
23
|
+
- created_at
|
|
24
|
+
|
|
25
|
+
- name: payments_view
|
|
26
|
+
cubes:
|
|
27
|
+
- join_path: payments
|
|
28
|
+
includes:
|
|
29
|
+
- paid
|
|
30
|
+
- join_path: customers
|
|
31
|
+
includes:
|
|
32
|
+
- name: city
|
|
33
|
+
alias: customer_city
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cubejs-backend/testing",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.16",
|
|
4
4
|
"description": "Cube e2e tests",
|
|
5
5
|
"author": "Cube Dev, Inc.",
|
|
6
6
|
"repository": {
|
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
"smoke:duckdb:snapshot": "jest --verbose --updateSnapshot -i dist/test/smoke-duckdb.test.js",
|
|
84
84
|
"smoke:view-groups": "jest --verbose --forceExit -i dist/test/smoke-view-groups.test.js",
|
|
85
85
|
"smoke:multi-fact": "jest --verbose --forceExit -i dist/test/smoke-multi-fact.test.js",
|
|
86
|
+
"smoke:view-join": "TZ=UTC jest --verbose --forceExit -i dist/test/smoke-view-join.test.js",
|
|
86
87
|
"smoke:shared-calc-group": "TZ=UTC jest --verbose -i dist/test/smoke-shared-calc-group.test.js"
|
|
87
88
|
},
|
|
88
89
|
"files": [
|
|
@@ -90,15 +91,15 @@
|
|
|
90
91
|
"birdbox-fixtures"
|
|
91
92
|
],
|
|
92
93
|
"dependencies": {
|
|
93
|
-
"@cubejs-backend/cubestore-driver": "1.8.
|
|
94
|
+
"@cubejs-backend/cubestore-driver": "1.8.16",
|
|
94
95
|
"@cubejs-backend/dotenv": "^9.0.2",
|
|
95
|
-
"@cubejs-backend/ksql-driver": "1.8.
|
|
96
|
-
"@cubejs-backend/postgres-driver": "1.8.
|
|
97
|
-
"@cubejs-backend/query-orchestrator": "1.8.
|
|
98
|
-
"@cubejs-backend/schema-compiler": "1.8.
|
|
99
|
-
"@cubejs-backend/shared": "1.8.
|
|
100
|
-
"@cubejs-backend/testing-shared": "1.8.
|
|
101
|
-
"@cubejs-client/ws-transport": "1.8.
|
|
96
|
+
"@cubejs-backend/ksql-driver": "1.8.16",
|
|
97
|
+
"@cubejs-backend/postgres-driver": "1.8.16",
|
|
98
|
+
"@cubejs-backend/query-orchestrator": "1.8.16",
|
|
99
|
+
"@cubejs-backend/schema-compiler": "1.8.16",
|
|
100
|
+
"@cubejs-backend/shared": "1.8.16",
|
|
101
|
+
"@cubejs-backend/testing-shared": "1.8.16",
|
|
102
|
+
"@cubejs-client/ws-transport": "1.8.16",
|
|
102
103
|
"dedent": "^0.7.0",
|
|
103
104
|
"fs-extra": "^11.1.1",
|
|
104
105
|
"http-proxy": "^1.18.1",
|
|
@@ -109,8 +110,8 @@
|
|
|
109
110
|
},
|
|
110
111
|
"devDependencies": {
|
|
111
112
|
"@4tw/cypress-drag-drop": "^1.6.0",
|
|
112
|
-
"@cubejs-backend/linter": "1.8.
|
|
113
|
-
"@cubejs-client/core": "1.8.
|
|
113
|
+
"@cubejs-backend/linter": "1.8.16",
|
|
114
|
+
"@cubejs-client/core": "1.8.16",
|
|
114
115
|
"@jest/globals": "^29",
|
|
115
116
|
"@simonsmith/cypress-image-snapshot": "^11.0.0",
|
|
116
117
|
"@types/dedent": "^0.7.0",
|
|
@@ -131,5 +132,5 @@
|
|
|
131
132
|
"publishConfig": {
|
|
132
133
|
"access": "public"
|
|
133
134
|
},
|
|
134
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "5139e19125833e3f97a11cf26d6383e991ea0afd"
|
|
135
136
|
}
|