Skip to content

Commit aa91504

Browse files
authored
chore(tests): Fix flaky birdbox:postgresql tests (due to order by same numbers) (#9466)
1 parent e732fa2 commit aa91504

File tree

3 files changed

+81
-80
lines changed

3 files changed

+81
-80
lines changed

packages/cubejs-testing/test/__snapshots__/birdbox-postgresql.test.ts.snap

+40-40
Original file line numberDiff line numberDiff line change
@@ -16,55 +16,55 @@ Array [
1616
]
1717
`;
1818

19-
exports[`postgresql HTTP Transport #3 Events.count with Events.type order by Events.count DESC: #3 Events.count with Events.type order by Events.count DESC 1`] = `
19+
exports[`postgresql HTTP Transport #3 Events.count with Events.type order by Events.type DESC, Events.count: #3 Events.count with Events.type order by Events.type DESC, Events.count 1`] = `
2020
Array [
21+
Object {
22+
"Events.count": "92",
23+
"Events.type": "WatchEvent",
24+
},
25+
Object {
26+
"Events.count": "2",
27+
"Events.type": "ReleaseEvent",
28+
},
2129
Object {
2230
"Events.count": "513",
2331
"Events.type": "PushEvent",
2432
},
2533
Object {
26-
"Events.count": "120",
27-
"Events.type": "CreateEvent",
34+
"Events.count": "21",
35+
"Events.type": "PullRequestReviewCommentEvent",
2836
},
2937
Object {
30-
"Events.count": "104",
31-
"Events.type": "IssueCommentEvent",
38+
"Events.count": "32",
39+
"Events.type": "PullRequestEvent",
3240
},
3341
Object {
34-
"Events.count": "92",
35-
"Events.type": "WatchEvent",
42+
"Events.count": "1",
43+
"Events.type": "MemberEvent",
3644
},
3745
Object {
3846
"Events.count": "57",
3947
"Events.type": "IssuesEvent",
4048
},
4149
Object {
42-
"Events.count": "32",
43-
"Events.type": "PullRequestEvent",
44-
},
45-
Object {
46-
"Events.count": "21",
47-
"Events.type": "ForkEvent",
50+
"Events.count": "104",
51+
"Events.type": "IssueCommentEvent",
4852
},
4953
Object {
5054
"Events.count": "21",
5155
"Events.type": "GollumEvent",
5256
},
5357
Object {
5458
"Events.count": "21",
55-
"Events.type": "PullRequestReviewCommentEvent",
59+
"Events.type": "ForkEvent",
5660
},
5761
Object {
5862
"Events.count": "14",
5963
"Events.type": "DeleteEvent",
6064
},
6165
Object {
62-
"Events.count": "2",
63-
"Events.type": "ReleaseEvent",
64-
},
65-
Object {
66-
"Events.count": "1",
67-
"Events.type": "MemberEvent",
66+
"Events.count": "120",
67+
"Events.type": "CreateEvent",
6868
},
6969
Object {
7070
"Events.count": "1",
@@ -97,55 +97,55 @@ Array [
9797
]
9898
`;
9999

100-
exports[`postgresql WS Transport #3 Events.count with Events.type order by Events.count DESC: #3 Events.count with Events.type order by Events.count DESC 1`] = `
100+
exports[`postgresql WS Transport #3 Events.count with Events.type order by Events.type DESC, Events.count: #3 Events.count with Events.type order by Events.type DESC, Events.count 1`] = `
101101
Array [
102+
Object {
103+
"Events.count": "92",
104+
"Events.type": "WatchEvent",
105+
},
106+
Object {
107+
"Events.count": "2",
108+
"Events.type": "ReleaseEvent",
109+
},
102110
Object {
103111
"Events.count": "513",
104112
"Events.type": "PushEvent",
105113
},
106114
Object {
107-
"Events.count": "120",
108-
"Events.type": "CreateEvent",
115+
"Events.count": "21",
116+
"Events.type": "PullRequestReviewCommentEvent",
109117
},
110118
Object {
111-
"Events.count": "104",
112-
"Events.type": "IssueCommentEvent",
119+
"Events.count": "32",
120+
"Events.type": "PullRequestEvent",
113121
},
114122
Object {
115-
"Events.count": "92",
116-
"Events.type": "WatchEvent",
123+
"Events.count": "1",
124+
"Events.type": "MemberEvent",
117125
},
118126
Object {
119127
"Events.count": "57",
120128
"Events.type": "IssuesEvent",
121129
},
122130
Object {
123-
"Events.count": "32",
124-
"Events.type": "PullRequestEvent",
125-
},
126-
Object {
127-
"Events.count": "21",
128-
"Events.type": "ForkEvent",
131+
"Events.count": "104",
132+
"Events.type": "IssueCommentEvent",
129133
},
130134
Object {
131135
"Events.count": "21",
132136
"Events.type": "GollumEvent",
133137
},
134138
Object {
135139
"Events.count": "21",
136-
"Events.type": "PullRequestReviewCommentEvent",
140+
"Events.type": "ForkEvent",
137141
},
138142
Object {
139143
"Events.count": "14",
140144
"Events.type": "DeleteEvent",
141145
},
142146
Object {
143-
"Events.count": "2",
144-
"Events.type": "ReleaseEvent",
145-
},
146-
Object {
147-
"Events.count": "1",
148-
"Events.type": "MemberEvent",
147+
"Events.count": "120",
148+
"Events.type": "CreateEvent",
149149
},
150150
Object {
151151
"Events.count": "1",

packages/cubejs-testing/test/__snapshots__/cli-postgresql.test.ts.snap

+38-38
Original file line numberDiff line numberDiff line change
@@ -16,40 +16,44 @@ Array [
1616
]
1717
`;
1818

19-
exports[`postgresql HTTP Transport #3 Events.count with Events.type order by Events.count DESC: #3 Events.count with Events.type order by Events.count DESC 1`] = `
19+
exports[`postgresql HTTP Transport #3 Events.count with Events.type order by Events.type DESC, Events.count: #3 Events.count with Events.type order by Events.type DESC, Events.count 1`] = `
2020
Array [
21+
Object {
22+
"Events.count": "92",
23+
"Events.type": "WatchEvent",
24+
},
25+
Object {
26+
"Events.count": "2",
27+
"Events.type": "ReleaseEvent",
28+
},
2129
Object {
2230
"Events.count": "513",
2331
"Events.type": "PushEvent",
2432
},
2533
Object {
26-
"Events.count": "120",
27-
"Events.type": "CreateEvent",
34+
"Events.count": "21",
35+
"Events.type": "PullRequestReviewCommentEvent",
2836
},
2937
Object {
30-
"Events.count": "104",
31-
"Events.type": "IssueCommentEvent",
38+
"Events.count": "32",
39+
"Events.type": "PullRequestEvent",
3240
},
3341
Object {
34-
"Events.count": "92",
35-
"Events.type": "WatchEvent",
42+
"Events.count": "1",
43+
"Events.type": "MemberEvent",
3644
},
3745
Object {
3846
"Events.count": "57",
3947
"Events.type": "IssuesEvent",
4048
},
4149
Object {
42-
"Events.count": "32",
43-
"Events.type": "PullRequestEvent",
50+
"Events.count": "104",
51+
"Events.type": "IssueCommentEvent",
4452
},
4553
Object {
4654
"Events.count": "21",
4755
"Events.type": "GollumEvent",
4856
},
49-
Object {
50-
"Events.count": "21",
51-
"Events.type": "PullRequestReviewCommentEvent",
52-
},
5357
Object {
5458
"Events.count": "21",
5559
"Events.type": "ForkEvent",
@@ -59,12 +63,8 @@ Array [
5963
"Events.type": "DeleteEvent",
6064
},
6165
Object {
62-
"Events.count": "2",
63-
"Events.type": "ReleaseEvent",
64-
},
65-
Object {
66-
"Events.count": "1",
67-
"Events.type": "MemberEvent",
66+
"Events.count": "120",
67+
"Events.type": "CreateEvent",
6868
},
6969
Object {
7070
"Events.count": "1",
@@ -186,40 +186,44 @@ Array [
186186
]
187187
`;
188188

189-
exports[`postgresql WS Transport #3 Events.count with Events.type order by Events.count DESC: #3 Events.count with Events.type order by Events.count DESC 1`] = `
189+
exports[`postgresql WS Transport #3 Events.count with Events.type order by Events.type DESC, Events.count: #3 Events.count with Events.type order by Events.type DESC, Events.count 1`] = `
190190
Array [
191+
Object {
192+
"Events.count": "92",
193+
"Events.type": "WatchEvent",
194+
},
195+
Object {
196+
"Events.count": "2",
197+
"Events.type": "ReleaseEvent",
198+
},
191199
Object {
192200
"Events.count": "513",
193201
"Events.type": "PushEvent",
194202
},
195203
Object {
196-
"Events.count": "120",
197-
"Events.type": "CreateEvent",
204+
"Events.count": "21",
205+
"Events.type": "PullRequestReviewCommentEvent",
198206
},
199207
Object {
200-
"Events.count": "104",
201-
"Events.type": "IssueCommentEvent",
208+
"Events.count": "32",
209+
"Events.type": "PullRequestEvent",
202210
},
203211
Object {
204-
"Events.count": "92",
205-
"Events.type": "WatchEvent",
212+
"Events.count": "1",
213+
"Events.type": "MemberEvent",
206214
},
207215
Object {
208216
"Events.count": "57",
209217
"Events.type": "IssuesEvent",
210218
},
211219
Object {
212-
"Events.count": "32",
213-
"Events.type": "PullRequestEvent",
220+
"Events.count": "104",
221+
"Events.type": "IssueCommentEvent",
214222
},
215223
Object {
216224
"Events.count": "21",
217225
"Events.type": "GollumEvent",
218226
},
219-
Object {
220-
"Events.count": "21",
221-
"Events.type": "PullRequestReviewCommentEvent",
222-
},
223227
Object {
224228
"Events.count": "21",
225229
"Events.type": "ForkEvent",
@@ -229,12 +233,8 @@ Array [
229233
"Events.type": "DeleteEvent",
230234
},
231235
Object {
232-
"Events.count": "2",
233-
"Events.type": "ReleaseEvent",
234-
},
235-
Object {
236-
"Events.count": "1",
237-
"Events.type": "MemberEvent",
236+
"Events.count": "120",
237+
"Events.type": "CreateEvent",
238238
},
239239
Object {
240240
"Events.count": "1",

packages/cubejs-testing/test/abstract-test-case.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const asserts: [options: QueryTestOptions, query: Query][] = [
4040
],
4141
[
4242
{
43-
name: '#3 Events.count with Events.type order by Events.count DESC',
43+
name: '#3 Events.count with Events.type order by Events.type DESC, Events.count',
4444
ws: true,
4545
},
4646
{
@@ -49,7 +49,8 @@ const asserts: [options: QueryTestOptions, query: Query][] = [
4949
],
5050
timeDimensions: [],
5151
order: {
52-
'Events.count': 'desc'
52+
'Events.type': 'desc',
53+
'Events.count': 'asc'
5354
},
5455
dimensions: [
5556
'Events.type'

0 commit comments

Comments
 (0)