Commit 444d85d
authored
Introduce "include" block in YAML testing framework (#3819)
This PR introduces a new block called `IncludeBlock` to the YAML testing
framework. This block enables importing blocks from other yamsql file.
Major changes in this PR:
- Replaces `lineNumber` with a more expressive `Reference` as a way of
representing locations in the yamsql file. While the former works well
when a single file is executed, the latter is a recursive way of
referencing in files with nested includes.
- Adds a new `IncludeBlock` that is able to open a new yamsql file and
"import" its execution block.
- Changes to `YamlExecutionContext` in the error reporting mechanism to
benefit from `Reference` structure.
One thing to call out explicitly is changes to the semantics of
correcting explain and metrics. By principle (and simplicity), it is
possible to have all kinds of blocks in included yamsql files, except
the `PreambleBlock`. Also, an include yamsql file (which is a normal
yamsql file, that may or may not be able to be executed independently),
can be included multiple times in the same file or different files.
1. This can lead to a situation in the presence of `explain` config,
where when this config is run under different environments (coming from
different includer), can have conflicting corrections to explain
statements and planner metrics. This is dangerous and little undefined.
Correction to `explain` will cause conflicts. However, since the metrics
are not saved associated to "include" file, but with the "includer"
file, it is safe.
2. Even when the metrics are saved with "includer" file, the key to a
query's metric is only on query string, and not the location. This will
be an issue when the same query is executed multiple times in the file.
This problem was already know but has just become more relevant with
this change.
The solution for (1) is to factor out the `explain` string of the query
to the metrics file - but that will not be developer friendly who
usually prefers that "near" the query. Looking at another file for the
`explain` string might not be productive.
Solution for (2) is simply to have some sort of query location
information be included in the metrics file and use it to deduplicate
different runs of same query.1 parent b297cb8 commit 444d85d
65 files changed
Lines changed: 2529 additions & 504 deletions
File tree
- yaml-tests/src
- main/java/com/apple/foundationdb/relational/yamltests
- block
- command
- queryconfigs
- test
- java
- resources/include-block
- includes
- shouldFail
- shouldPass
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
244 | 257 | | |
245 | 258 | | |
246 | 259 | | |
| |||
Lines changed: 175 additions & 138 deletions
Large diffs are not rendered by default.
Lines changed: 193 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
Lines changed: 16 additions & 77 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 24 | + | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 28 | | |
37 | 29 | | |
38 | | - | |
39 | 30 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | 31 | | |
45 | 32 | | |
46 | | - | |
47 | 33 | | |
48 | 34 | | |
49 | | - | |
| 35 | + | |
50 | 36 | | |
51 | 37 | | |
52 | 38 | | |
| |||
57 | 43 | | |
58 | 44 | | |
59 | 45 | | |
60 | | - | |
| 46 | + | |
61 | 47 | | |
62 | 48 | | |
63 | 49 | | |
64 | 50 | | |
65 | 51 | | |
66 | 52 | | |
67 | | - | |
68 | | - | |
| 53 | + | |
| 54 | + | |
69 | 55 | | |
70 | 56 | | |
71 | 57 | | |
72 | 58 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
| 59 | + | |
79 | 60 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
90 | 64 | | |
91 | 65 | | |
92 | | - | |
93 | | - | |
| 66 | + | |
| 67 | + | |
94 | 68 | | |
95 | 69 | | |
96 | 70 | | |
97 | | - | |
98 | | - | |
| 71 | + | |
99 | 72 | | |
100 | | - | |
| 73 | + | |
101 | 74 | | |
102 | 75 | | |
103 | 76 | | |
| |||
117 | 90 | | |
118 | 91 | | |
119 | 92 | | |
120 | | - | |
| 93 | + | |
121 | 94 | | |
122 | 95 | | |
123 | 96 | | |
124 | 97 | | |
125 | 98 | | |
126 | 99 | | |
127 | 100 | | |
128 | | - | |
| 101 | + | |
129 | 102 | | |
130 | 103 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
| 104 | + | |
164 | 105 | | |
165 | | - | |
166 | | - | |
167 | 106 | | |
168 | 107 | | |
0 commit comments