Debian Codegraph @

testing/web-platform/tests/tools/wave/docs/config.md

raw
1 # Configuration - [WAVE Test Runner](./README.md)
2
3 Using a configuration file, the WAVE Test Runner can be configured to be more
4 functional in different use cases. This document lists all configuration
5 parameters and what they are used for.
6
7 ## Contents
8
9 1. [Location and structure](#1-location-and-structure)
10 2. [Parameters](#2-parameters)
11 1. [Results directory](#21-results-directory)
12 2. [Test Timeouts](#22-test-timeouts)
13 3. [Enable import of results](#23-enable-import-of-results)
14 4. [Web namespace](#24-web-namespace)
15 5. [Persisting interval](#25-persisting-interval)
16 6. [API titles](#26-api-titles)
17 7. [Enable listing all sessions](#27-enable-listing-all-sessions)
18 8. [Event caching duration](#28-event-caching-duration)
19 9. [Enable test type selection](#29-enable-test-type-selection)
20
21 ## 1. Location and structure
22
23 Configuration parameters are defined in a JSON file called `config.json` in
24 the project root of the WPT runner. This configuration file is also used by
25 the WPT runner, so any WAVE Test Runner related configuration parameters are
26 wrapped inside a `wave` object.
27
28 ```
29 <PRJ_ROOT>/config.json
30 ```
31
32 ```json
33 {
34 "wave": {
35 "results": "./results"
36 }
37 }
38 ```
39
40 All the default values are stored in a configuration file inside the wave
41 directory:
42
43 ```
44 <PRJ_ROOT>/tools/wave/config.default.json
45 ```
46
47 ```json
48 {
49 "wave": {
50 "results": "./results",
51 "timeouts": {
52 "automatic": 60000,
53 "manual": 300000
54 },
55 "enable_import_results": false,
56 "web_root": "/_wave",
57 "persisting_interval": 20,
58 "api_titles": [],
59 "enable_read_sessions": false,
60 "event_cache_duration": 60000
61 }
62 }
63 ```
64 [🠑 top](#configuration---wave-test-runner)
65
66 ## 2. Parameters
67
68 ### 2.1 Results directory
69
70 The results parameter sets where results and session information are stored.
71
72 **Parameters**:
73
74 ```json
75 {
76 "results": "<String>"
77 }
78 ```
79
80 - **results**: Path to the results directory. Can be absolute, or relative to
81 the project root.
82
83 **Default**:
84
85 ```json
86 {
87 "results": "./results"
88 }
89 ```
90
91 [🠑 top](#configuration---wave-test-runner)
92
93 ### 2.2 Test Timeouts
94
95 The test timeouts set the default test timeout for different test types.
96
97 **Parameters**:
98
99 ```json
100 {
101 "timeouts": {
102 "automatic": "<Number>",
103 "manual": "<Number>"
104 }
105 }
106 ```
107
108 - **timeouts**: Holds the key value pairs for different types of tests
109 - **automatic**: Default time to wait for automatic tests in milliseconds.
110 - **manual**: Default time to wait for manual tests in milliseconds.
111
112 **Default**:
113
114 ```json
115 {
116 "timeouts": {
117 "automatic": 600000,
118 "manual": 300000
119 }
120 }
121 ```
122
123 [🠑 top](#configuration---wave-test-runner)
124
125 ### 2.3 Enable import of results
126
127 This parameter enables the capability to import session results from other
128 WAVE Test Runner instances into the current one.
129
130 **Parameters**:
131
132 ```json
133 {
134 "enable_import_results": "<Boolean>"
135 }
136 ```
137
138 - **enable_import_results**: Sets whether or not to enable the [REST API endpoint to import results](./rest-api/results-api/import.md)
139
140 **Default**:
141
142 ```json
143 {
144 "enable_import_results": "false"
145 }
146 ```
147
148 [🠑 top](#configuration---wave-test-runner)
149
150 ### 2.4 Web namespace
151
152 All static resources and REST API endpoints are accessible under a
153 configurable namespace. This namespace can be set using the `web_root`
154 parameter.
155
156 **Parameters**:
157
158 ```json
159 {
160 "web_root": "<String>"
161 }
162 ```
163
164 - **web_root**: The namespace to use
165
166 **Default**:
167
168 ```json
169 {
170 "web_root": "/_wave"
171 }
172 ```
173
174 [🠑 top](#configuration---wave-test-runner)
175
176 ### 2.5 Persisting interval
177
178 The persisting interval specifies how many tests have to be completed until
179 all session information is updated in the results directory.
180
181 For example, if set to 5, then every 5 completed tests the `info.json` in the
182 results directory is updated with the current state of the session. When
183 restarting the server, this state is used to reconstruct all sessions testing
184 state.
185
186 **Parameters**:
187
188 ```json
189 {
190 "persisting_interval": "<Number>"
191 }
192 ```
193
194 - **persisting_interval**: The number of tests to execute until the persisted
195 session information gets updated
196
197 **Default**:
198
199 ```json
200 {
201 "persisting_interval": 20
202 }
203 ```
204
205 [🠑 top](#configuration---wave-test-runner)
206
207 ### 2.6 API titles
208
209 The API titles are used to display a more human readible representation of an
210 API that tests are available for. Using the parameter it is possible to assign
211 a name to an API subdirectory.
212
213 **Parameters**:
214
215 ```json
216 {
217 "api_titles": [
218 {
219 "title": "<String>",
220 "path": "<String>"
221 },
222 ...
223 ]
224 }
225 ```
226
227 - **api_titles**: An array of titles assigned to paths
228 - **title**: The displayed title of the API in the UI
229 - **path**: The path relative to the project root of the tested API
230
231 **Default**:
232
233 ```json
234 {
235 "api_titles": []
236 }
237 ```
238
239 **Example**:
240
241 ```json
242 {
243 "api_titles": [
244 {
245 "title": "WebGL",
246 "path": "/webgl"
247 },
248 {
249 "title": "WebRTC Extensions",
250 "path": "/webrtc-extensions"
251 }
252 ]
253 }
254 ```
255
256 [🠑 top](#configuration---wave-test-runner)
257
258 ### 2.7 Enable listing all sessions
259
260 This parameter enables the [REST API endpoint to list all available sessions](./rest-api/sessions-api/read_sessions.md).
261
262 **Parameters**:
263
264 ```json
265 {
266 "enable_read_sessions": "<Boolean>"
267 }
268 ```
269
270 - **enable_import_results**: Sets whether or not to enable the REST API endpoint read all sessions
271
272 **Default**:
273
274 ```json
275 {
276 "enable_read_sessions": "false"
277 }
278 ```
279
280 [🠑 top](#configuration---wave-test-runner)
281
282 ### 2.8 Event caching duration
283
284 This parameters specifies how long events are hold in the cache. Depending on
285 how fast clients are able to evaluate events, this value may be changed
286 accordingly.
287
288 **Parameters**:
289
290 ```json
291 {
292 "event_cache_duration": "<Number>"
293 }
294 ```
295
296 - **event_cache_duration**: The duration events are hold in the cache in milliseconds
297
298 **Default**:
299
300 ```json
301 {
302 "event_cache_duration": 60000
303 }
304 ```
305
306 [🠑 top](#configuration---wave-test-runner)
307
308 ### 2.9 Enable test type selection
309
310 Sets display of test type configuration UI elements.
311
312 **Parameters**:
313
314 ```json
315 {
316 "enable_test_type_selection": "<Boolean>"
317 }
318 ```
319
320 - **enable_test_type_selection**: Whether or not test type UI controls are displayed
321
322 **Default**:
323
324 False
325
326 [🠑 top](#configuration---wave-test-runner)