blob: 18e66131c5c89087642aa8869ba60baf84ddd49e [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
13## Config File Format
14
15```json
16{
17 "StudyName": [
18 {
19 "platforms": [Array of Strings of Valid Platforms for These Experiments],
20 "experiments": [
21 {
22 "//0": "Comment Line 0. Lines 0-9 are supported.",
23 "name": "ExperimentName",
24 "params": {Dictionary of Params},
25 "enable_features": [Array of Strings of Features],
26 "disable_features": [Array of Strings of Features]
27 },
28 ...
29 ]
30 },
31 ...
32 ],
33 ...
34}
35```
36
37The config file is a dictionary at the top level mapping a study name to an
ishermana509c1852017-03-23 21:11:3538array of *study configurations*. The study name in the configuration file should
39match the FieldTrial name used in the Chromium client code.
40
41> Note: Many newer studies do not use study names in the client code at all, and
42> rely on the [Feature List API][FeatureListAPI] instead. Nonetheless, if a
43> study has a server-side configuration, the study `name` specified here should
44> match the name specified in the server-side configuration; this is used to
45> implement sanity-checks on the server.
robliao2ff53322016-09-23 19:28:2446
47### Study Configurations
48
ishermana509c1852017-03-23 21:11:3549Each *study configuration* is a dictionary containing `platforms` and
robliao2ff53322016-09-23 19:28:2450`experiments`.
51
ishermana509c1852017-03-23 21:11:3552`platforms` is an array of strings, indicating the targetted platforms. The
Paul Millerad77b7892018-07-11 20:07:4353strings may be `android`, `chromeos`, `ios`, `linux`, `mac`, or `windows`.
robliao2ff53322016-09-23 19:28:2454
55`experiments` is an array containing the *experiments*.
56
ishermana509c1852017-03-23 21:11:3557The converter uses the `platforms` array to determine which experiment to use
58for the study. The first experiment matching the active platform will be used.
59
60> Note: While `experiments` is defined as an array, currently only the first
61> entry is used*\**. We would love to be able to test all possible study
62> configurations, but don't currently have the buildbot resources to do so.
63> Hence, the current best-practice is to identify which experiment group is the
64> most likely candidate for ultimate launch, and to test that configuration. If
65> there is a server-side configuration for this study, it's typically
66> appropriate to copy/paste one of the experiment definitions into this file.
67>
68> *\**
69> <small>
70> Technically, there is one exception: If there's a forcing_flag group
71> specified in the config, that group will be used if there's a corresponding
72> forcing_flag specified on the command line. You, dear reader, should
73> probably not use this fancy mechanism unless you're <em>quite</em> sure you
74> know what you're doing =)
75> </small>
robliao2ff53322016-09-23 19:28:2476
77### Experiments (Groups)
78Each *experiment* is a dictionary that must contain the `name` key, identifying
ishermana509c1852017-03-23 21:11:3579the experiment group name. This name should match the FieldTrial experiment
80group name used in the Chromium client code.
81
82> Note: Many newer studies do not use experiment names in the client code at
83> all, and rely on the [Feature List API][FeatureListAPI] instead. Nonetheless,
84> if a study has a server-side configuration, the experiment `name` specified
85> here should match the name specified in the server-side configuration; this is
86> used to implement sanity-checks on the server.
robliao2ff53322016-09-23 19:28:2487
88The remaining keys, `params`, `enable_features`, and `disable_features` are
89optional.
90
91`params` is a dictionary mapping parameter name to parameter.
92
93`enable_features` and `disable_features` indicate which features should be
ishermana509c1852017-03-23 21:11:3594enabled and disabled, respectively, through the
95[Feature List API][FeatureListAPI].
96
97> Reminder: The variations framework does not actually fetch any field trial
98> definitions from the server for Chromium builds, so any feature enabling or
99> disabling must be configured here.
100
101[FeatureListAPI]: https://cs.chromium.org/chromium/src/base/feature_list.h
robliao2ff53322016-09-23 19:28:24102
103#### Comments
104
105Each experiment may have up to 10 lines of comments. The comment key must be of
106the form `//N` where `N` is between 0 and 9.
107
108```json
109{
110 "AStudyWithExperimentComment": [
111 {
Paul Millerad77b7892018-07-11 20:07:43112 "platforms": ["chromeos", "linux", "mac", "windows"],
robliao2ff53322016-09-23 19:28:24113 "experiments": [
114 {
115 "//0": "This is the first comment line.",
116 "//1": "This is the second comment line.",
117 "name": "DesktopExperiment"
118 }
119 ]
120 }
121 ]
122}
123```
124
125### Specifying Different Experiments for Different Platforms
126Simply specify two different study configurations in the study:
127
128```json
129{
130 "DifferentExperimentsPerPlatform": [
131 {
Paul Millerad77b7892018-07-11 20:07:43132 "platforms": ["chromeos", "linux", "mac", "windows"],
robliao2ff53322016-09-23 19:28:24133 "experiments": [{ "name": "DesktopExperiment" }]
134 },
135 {
136 "platforms": ["android", "ios"],
137 "experiments": [{ "name": "MobileExperiment" }]
138 }
139 ]
140}
141```
142
143## Presubmit
144The presubmit tool will ensure that your changes follow the correct ordering and
145format.