Skip to content

Commit 1d816c1

Browse files
committed
test: set query memory limit in regression tests
Regression tests usually don't have many or big objects, so they shouldn't take a lot of memory. If they do, the query is likely not optimal. If the value (10 MB) does not work we can also tweak it later. This can also be used by special tests that have a large "payload" field to ensure this field never makes it into query memory. Needed to refactor one query because it was one query that performed a lot of filters.
1 parent 76a867c commit 1d816c1

File tree

3 files changed

+412
-264
lines changed

3 files changed

+412
-264
lines changed

spec/regression/papers/tests/filter.graphql

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,100 @@
1-
query {
1+
query eq {
22
eq: allPapers(filter: { key: "OOM" }, orderBy: key_ASC) {
33
key
44
}
5+
}
6+
7+
query neq {
58
neq: allPapers(filter: { key_not: "OOM" }, orderBy: key_ASC) {
69
key
710
}
11+
}
12+
13+
query gt {
814
gt: allPapers(filter: { key_gt: "OOM" }, orderBy: key_ASC) {
915
key
1016
}
17+
}
18+
19+
query gte {
1120
gte: allPapers(filter: { key_gte: "OOM" }, orderBy: key_ASC) {
1221
key
1322
}
23+
}
24+
25+
query lt {
1426
lt: allPapers(filter: { key_lt: "OOM" }, orderBy: key_ASC) {
1527
key
1628
}
29+
}
30+
31+
query lte {
1732
lte: allPapers(filter: { key_lte: "OOM" }, orderBy: key_ASC) {
1833
key
1934
}
35+
}
36+
37+
query in {
2038
in: allPapers(filter: { key_in: ["OOM", "Part"] }, orderBy: key_ASC) {
2139
key
2240
}
41+
}
42+
43+
query not_in {
2344
not_in: allPapers(filter: { key_not_in: ["OOM", "Part"] }, orderBy: key_ASC) {
2445
key
2546
}
47+
}
48+
49+
query contains {
2650
contains: allPapers(filter: { key_contains: "a" }, orderBy: key_ASC) {
2751
key
2852
}
53+
}
54+
55+
query contains_empty_string {
2956
contains_empty_string: allPapers(filter: { key_contains: "" }, orderBy: key_ASC) {
3057
key
3158
}
59+
}
60+
61+
query not_contains {
3262
not_contains: allPapers(filter: { key_not_contains: "a" }, orderBy: key_ASC) {
3363
key
3464
}
65+
}
66+
67+
query not_contains_empty_string {
3568
not_contains_empty_string: allPapers(filter: { key_not_contains: "" }, orderBy: key_ASC) {
3669
key
3770
}
71+
}
72+
73+
query starts_with {
3874
starts_with: allPapers(filter: { key_starts_with: "O" }, orderBy: key_ASC) {
3975
key
4076
}
77+
}
78+
79+
query not_starts_with {
4180
not_starts_with: allPapers(filter: { key_not_starts_with: "O" }, orderBy: key_ASC) {
4281
key
4382
}
83+
}
84+
85+
query ends_with {
4486
ends_with: allPapers(filter: { key_ends_with: "M" }, orderBy: key_ASC) {
4587
key
4688
}
89+
}
90+
91+
query not_ends_with {
4792
not_ends_with: allPapers(filter: { key_not_ends_with: "M" }, orderBy: key_ASC) {
4893
key
4994
}
95+
}
96+
97+
query like {
5098
like_prefix: allPapers(filter: { key_like: "o%" }, orderBy: key_ASC) {
5199
key
52100
}
@@ -74,9 +122,15 @@ query {
74122
like_lower_matching_upper_pattern: allPapers(filter: { key_like: "%part" }, orderBy: key_ASC) {
75123
key
76124
}
125+
}
126+
127+
query not_like {
77128
not_like: allPapers(filter: { key_not_like: "O%" }, orderBy: key_ASC) {
78129
key
79130
}
131+
}
132+
133+
query or {
80134
or: allPapers(
81135
filter: {
82136
OR: [
@@ -88,7 +142,9 @@ query {
88142
) {
89143
title
90144
}
145+
}
91146

147+
query enums {
92148
enum_in: allUsers(
93149
filter: { category_in: [Telecommunications, Programming] }
94150
orderBy: lastName_ASC

0 commit comments

Comments
 (0)