blob: 9568f20a6b36ca4e1af08cfb7e14d6e7b9b0e4de [file] [log] [blame] [view]
robliao2ff53322016-09-23 19:28:241# Field Trial Testing Configuration
2
ishermana509c1852017-03-23 21:11:353This directory contains the `fieldtrial_testing_config.json` configuration file,
4which is used to ensure test coverage of active field trials.
robliao2ff53322016-09-23 19:28:245
ishermana509c1852017-03-23 21:11:356For each study, the first available experiment after platform filtering is used
7as the default experiment for Chromium builds. This experiment is also used for
8perf bots and browser tests in the waterfall.
robliao2ff53322016-09-23 19:28:249
ishermana509c1852017-03-23 21:11:3510> Note: This configuration applies specifically to Chromium developer builds.
11> Chrome branded / official builds do not use these definitions.
robliao2ff53322016-09-23 19:28:2412
Hiroshige Hayashizakiac2fc0c2018-12-03 19:20:5013> Note: This configuration is NOT used for content_browsertests or other test
14> targets based on content_shell.
15
robliao2ff53322016-09-23 19:28:2416## Config File Format
17
18```json
19{
20 "StudyName": [
21 {
22 "platforms": [Array of Strings of Valid Platforms for These Experiments],
23 "experiments": [
24 {
25 "//0": "Comment Line 0. Lines 0-9 are supported.",
26 "name": "ExperimentName",
27 "params": {Dictionary of Params},
28 "enable_features": [Array of Strings of Features],
29 "disable_features": [Array of Strings of Features]
30 },
31 ...
32 ]
33 },
34 ...
35 ],
36 ...
37}
38```
39
40The config file is a dictionary at the top level mapping a study name to an
Carlos Knippschilde12741b2019-12-12 01:26:2341array of *study configurations*. The study name in the configuration file
42**must** match the FieldTrial name used in the Chromium client code.
ishermana509c1852017-03-23 21:11:3543
44> Note: Many newer studies do not use study names in the client code at all, and
45> rely on the [Feature List API][FeatureListAPI] instead. Nonetheless, if a
Carlos Knippschilde12741b2019-12-12 01:26:2346> study has a server-side configuration, the study `name` specified here
47> must still match the name specified in the server-side configuration; this is
48> used to implement sanity-checks on the server.
robliao2ff53322016-09-23 19:28:2449
50### Study Configurations
51
ishermana509c1852017-03-23 21:11:3552Each *study configuration* is a dictionary containing `platforms` and
robliao2ff53322016-09-23 19:28:2453`experiments`.
54
ishermana509c1852017-03-23 21:11:3555`platforms` is an array of strings, indicating the targetted platforms. The
Dominik Röttsches1243e0f2019-07-08 18:49:5656strings may be `android`, `android_webview`, `chromeos`, `ios`, `linux`, `mac`,
57or `windows`.
robliao2ff53322016-09-23 19:28:2458
59`experiments` is an array containing the *experiments*.
60
ishermana509c1852017-03-23 21:11:3561The converter uses the `platforms` array to determine which experiment to use
62for the study. The first experiment matching the active platform will be used.
63
64> Note: While `experiments` is defined as an array, currently only the first
65> entry is used*\**. We would love to be able to test all possible study
66> configurations, but don't currently have the buildbot resources to do so.
67> Hence, the current best-practice is to identify which experiment group is the
68> most likely candidate for ultimate launch, and to test that configuration. If
69> there is a server-side configuration for this study, it's typically
70> appropriate to copy/paste one of the experiment definitions into this file.
71>
72> *\**
73> <small>
74> Technically, there is one exception: If there's a forcing_flag group
75> specified in the config, that group will be used if there's a corresponding
76> forcing_flag specified on the command line. You, dear reader, should
77> probably not use this fancy mechanism unless you're <em>quite</em> sure you
78> know what you're doing =)
79> </small>
robliao2ff53322016-09-23 19:28:2480
81### Experiments (Groups)
82Each *experiment* is a dictionary that must contain the `name` key, identifying
Ilya Sherman84225992020-02-28 00:39:2183the experiment group name.
ishermana509c1852017-03-23 21:11:3584
Ilya Sherman84225992020-02-28 00:39:2185> Note: Studies should typically use the [Feature List API][FeatureListAPI]. For
86> such studies, the experiment `name` specified in the testing config is still
87> required (for legacy reasons), but it is ignored. However, the lists of
88> `enable_features`, `disable_features`, and `params` **must** match the server
89> config. This is enforced via server-side Tricorder checks.
90>
91> For old-school studies that do check the actual experiment group name in the
92> client code, the `name` **must** exactly match the client code and the server
93> config.
robliao2ff53322016-09-23 19:28:2494
Ilya Sherman84225992020-02-28 00:39:2195The remaining keys -- `enable_features`, `disable_features`, and `params` -- are
robliao2ff53322016-09-23 19:28:2496optional.
97
robliao2ff53322016-09-23 19:28:2498`enable_features` and `disable_features` indicate which features should be
ishermana509c1852017-03-23 21:11:3599enabled and disabled, respectively, through the
100[Feature List API][FeatureListAPI].
101
Ilya Sherman84225992020-02-28 00:39:21102`params` is a dictionary mapping parameter name to parameter value.
103
ishermana509c1852017-03-23 21:11:35104> Reminder: The variations framework does not actually fetch any field trial
105> definitions from the server for Chromium builds, so any feature enabling or
106> disabling must be configured here.
107
108[FeatureListAPI]: https://cs.chromium.org/chromium/src/base/feature_list.h
robliao2ff53322016-09-23 19:28:24109
110#### Comments
111
112Each experiment may have up to 10 lines of comments. The comment key must be of
113the form `//N` where `N` is between 0 and 9.
114
115```json
116{
117 "AStudyWithExperimentComment": [
118 {
Paul Millerad77b7892018-07-11 20:07:43119 "platforms": ["chromeos", "linux", "mac", "windows"],
robliao2ff53322016-09-23 19:28:24120 "experiments": [
121 {
122 "//0": "This is the first comment line.",
123 "//1": "This is the second comment line.",
124 "name": "DesktopExperiment"
125 }
126 ]
127 }
128 ]
129}
130```
131
132### Specifying Different Experiments for Different Platforms
133Simply specify two different study configurations in the study:
134
135```json
136{
137 "DifferentExperimentsPerPlatform": [
138 {
Paul Millerad77b7892018-07-11 20:07:43139 "platforms": ["chromeos", "linux", "mac", "windows"],
robliao2ff53322016-09-23 19:28:24140 "experiments": [{ "name": "DesktopExperiment" }]
141 },
142 {
143 "platforms": ["android", "ios"],
144 "experiments": [{ "name": "MobileExperiment" }]
145 }
146 ]
147}
148```
149
150## Presubmit
151The presubmit tool will ensure that your changes follow the correct ordering and
152format.