OLD | NEW |
(Empty) | |
| 1 Each package may include a configuration file that applies to the package as a |
| 2 whole. This file can be used to provide custom defaults for various options, to |
| 3 define configuration for multiple files, and more. |
| 4 |
| 5 The file is named `dart_test.yaml` and lives at the root of the package, next to |
| 6 the package's pubspec. Like the pubspec, it's a [YAML][] file. Here's an |
| 7 example: |
| 8 |
| 9 [YAML]: http://yaml.org/ |
| 10 |
| 11 ```yaml |
| 12 # This package's tests are very slow. Double the default timeout. |
| 13 timeout: 2x |
| 14 |
| 15 # This is a browser-only package, so test on content shell by default. |
| 16 platforms: [content-shell] |
| 17 ``` |
| 18 |
| 19 * [Config Fields](#config-fields) |
| 20 |
| 21 ## Config Fields |
| 22 |
| 23 These fields directly affect the behavior of the test runner. They go at the |
| 24 root of the configuration file. |
| 25 |
| 26 ### `platforms` |
| 27 |
| 28 This field indicates which platforms tests should run on by default. It allows |
| 29 the same paltform identifiers that can be passed to `--platform`. If multiple |
| 30 platforms are included, the test runner will default to running tests on all of |
| 31 them. This defaults to `[vm]`. |
| 32 |
| 33 ```yaml |
| 34 platforms: [content_shell] |
| 35 |
| 36 platforms: |
| 37 - chrome |
| 38 - firefox |
| 39 ``` |
| 40 |
| 41 ### `concurrency` |
| 42 |
| 43 This field indicates the default number of test suites to run in parallel. More |
| 44 parallelism can improve the overall speed of running tests up to a point, but |
| 45 eventually it just adds more memory overhead without any performance gain. This |
| 46 defaults to approximately half the number of processors on the current machine. |
| 47 If it's set to 1, only one test suite will run at a time. |
| 48 |
| 49 ```yaml |
| 50 concurrency: 3 |
| 51 ``` |
| 52 |
| 53 ### `pub_serve` |
| 54 |
| 55 This field indicates that the test runner should run against a `pub serve` |
| 56 instance by default, and provides the port number for that instance. Note that |
| 57 if there is no `pub serve` instance running at that port, running the tests will |
| 58 fail by default. |
| 59 |
| 60 ```yaml |
| 61 pub_serve: 8081 |
| 62 ``` |
| 63 |
| 64 ### `timeout` |
| 65 |
| 66 This field indicates how much time the test runner should allow a test to remain |
| 67 inactive before it considers that test to have failed. It has three possible |
| 68 formats: |
| 69 |
| 70 * The string "none" indicates that tests should never time out. |
| 71 |
| 72 * A number followed by a unit abbreviation indicates an exact time. For example, |
| 73 "1m" means a timeout of one minute, and "30s" means a timeout of thirty |
| 74 seconds. Multiple numbers can be combined, as in "1m 30s". |
| 75 |
| 76 * A number followed by "x" indicates a multiple. This is applied to the default |
| 77 value of 30s. |
| 78 |
| 79 ```yaml |
| 80 timeout: 1m |
| 81 ``` |
| 82 |
| 83 ### `reporter` |
| 84 |
| 85 This field indicates the default reporter to use. It may be set to "compact", |
| 86 "expanded", or "json" (although why anyone would want to default to JSON is |
| 87 beyond me). It defaults to "expanded" on Windows and "compact" everywhere else. |
| 88 |
| 89 ```yaml |
| 90 reporter: expanded |
| 91 ``` |
| 92 |
| 93 ### `verbose_trace` |
| 94 |
| 95 This boolean field controls whether or not stack traces caused by errors are |
| 96 trimmed to remove internal stack frames. This includes frames from the Dart core |
| 97 libraries, the [`stack_trace`][stack_trace] package, and the `test` package |
| 98 itself. It defaults to `false`. |
| 99 |
| 100 [stack_trace]: https://pub.dartlang.org/packages/stack_trace |
| 101 |
| 102 ```yaml |
| 103 verbose_trace: true |
| 104 ``` |
| 105 |
| 106 ### `js_trace` |
| 107 |
| 108 This boolean field controls whether or not stack traces caused by errors that |
| 109 occur while running Dart compiled to JS are converted back to Dart style. This |
| 110 conversion uses the source map generated by `dart2js` to approximate the |
| 111 original Dart line, column, and in some cases member name for each stack frame. |
| 112 It defaults to `false`. |
| 113 |
| 114 ```yaml |
| 115 js_trace: true |
| 116 ``` |
OLD | NEW |