Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: docs/ios_infra.md

Issue 2695813003: Document how to write configs for iOS bots (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Continuous build and test infrastructure for Chromium for iOS 1 # Continuous build and test infrastructure for Chromium for iOS
2 2
3 See the [instructions] for how to check out and build Chromium for iOS. 3 See the [instructions] for how to check out and build Chromium for iOS.
4 4
5 The Chromium projects use buildbot for continuous integration. This doc starts 5 The Chromium projects use buildbot for continuous integration. This doc starts
6 with an overview of the system, then gives detailed explanations about each 6 with an overview of the system, then gives detailed explanations about each
7 part. 7 part.
8 8
9 [TOC] 9 [TOC]
10 10
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 requests which they execute and post the results of. 111 requests which they execute and post the results of.
112 112
113 ### Compiling with the analyzer 113 ### Compiling with the analyzer
114 114
115 In addition to goma, the try bots use another time-saving mechanism called the 115 In addition to goma, the try bots use another time-saving mechanism called the
116 [analyzer] to determine the subset of compilation targets affected by the patch 116 [analyzer] to determine the subset of compilation targets affected by the patch
117 that need to be compiled in order to run the affected tests. If a patch is 117 that need to be compiled in order to run the affected tests. If a patch is
118 determined not to affect a certain test target, compilation and execution of the 118 determined not to affect a certain test target, compilation and execution of the
119 test target will be skipped. 119 test target will be skipped.
120 120
121 ## Configuring the bots
122
123 See the [configs code location](#Configs) for where to find the config files for
124 the bots. The config files are JSON which describe how the bot should compile
125 and which tests it should run. The config files are located in the configs
126 directory. The configs directory contains a named directory for each master. For
127 example:
128 ```shell
129 $ ls ios/build/bots
130 OWNERS scripts tests chromium.fyi chromium.mac
131 ```
132 In this case, configs are defined for iOS bots on [chromium.fyi] and
133 [chromium.mac]. Inside each master-specific directory are JSON config files
134 named after each bot. For example:
135 ```shell
136 $ ls ios/build/bots/chromium.mac
137 ios-device.json ios-simulator.json
138 ```
139 The `ios-device` bot on [chromium.mac] will read its configuration from
140 `chromium.mac/ios-device.json` in the configs directory.
141
142 ### Example
143
144 ```json
145 {
146 "comments": [
147 "Sample config for a bot."
148 ],
149 "gn_args": [
150 "is_debug=true",
151 "target_cpu=\"x64\""
152 ],
153 "tests": [
154 {
155 "app": "ios_chrome_unittests",
156 "device type": "iPhone 5s",
157 "os": "10.0",
158 "xcode version": "8.0"
159 }
160 ]
161 }
162 ```
163 The `comments` key is optional and defines a list of strings which can be used
164 to annotate the config. You may want to explain why the bot exists and what it's
165 doing, particularly if there are extensive and atypical `gn_args`.
166
167 The `gn_args` key is a required list of arguments to pass to [GN] to generate
168 the build files. Two GN args are required, `is_debug` and `target_cpu`. Use
169 `is_debug` to define whether to compile for Debug or Release, and `target_cpu`
170 to define whether to compile for x86, x64, arm, or arm64. The iOS bots typically
171 perform Debug builds for x86 and x64, and Release builds for arm and arm64. An
172 x86/x64 build can only be tested on the [iOS simulator], while an arm/arm64
173 build can only be tested on a physical device.
174
175 Since Chromium for iOS is shipped as a [universal binary], it's also fairly
176 common to set `additional_target_cpus`. For simulator builds, we typically set:
177 ```json
178 "gn_args": [
179 "additional_target_cpus=[\"x86\"]",
180 "is_debug=true",
181 "target_cpu=\"x64\""
182 ]
183 ```
184 This builds universal binaries which run in 32-bit mode on 32-bit simulators and
185 64-bit mode on 64-bit simulators. For device builds we typically set:
186 ```json
187 "gn_args": [
188 "additional_target_cpus=[\"arm\"]",
189 "is_debug=false",
190 "target_cpu=\"arm64\""
191 ]
192 ```
193 In order to build universal binaries which run in 32-bit mode on 32-bit devices
194 and 64-bit mode on 64-bit devices.
195
196 The `tests` key is an optional list of dictionaries defining tests to run. There
197 are two types of test dictionary, `app` and `include`. An `app` dict defines a
198 specific compiled app to run, for example:
199 ```json
200 "tests": [
201 {
202 "app": "ios_chrome_unittests",
203 "device type": "iPhone 5s",
204 "os": "10.0",
205 "xcode version": "8.0"
206 }
207 ]
208 ```
209 This dict says to run `ios_chrome_unittests` on an `iPhone 5s` running iOS
210 `10.0` using Xcode `8.0`. A test dict may optionally define a list of `test
211 args`, which are arguments to pass directly to the test on the command line,
212 and it may define a Boolean value `xctest` to indicate whether the test is an
sdefresne 2017/02/17 10:02:45 nit: I would use "boolean" here
smut 2017/02/21 23:38:03 Done.
213 [xctest] \(default if unspecified is `false`\). For example:
214 ```json
215 "tests": [
216 {
217 "app": "ios_chrome_unittests",
218 "device type": "iPhone 5s",
219 "os": "10.0",
220 "test args": [
221 "--foo",
222 "--bar"
223 ],
224 "xcode version": "8.0"
225 },
226 {
227 "app": "ios_chrome_integration_egtests",
228 "device type": "iPhone 5s",
229 "os": "10.0",
230 "xcode version": "8.0",
231 "xctest": true
232 }
233 ]
234 ```
235 This defines two tests to run, first `ios_chrome_unittests` will be run with
236 `--foo` and `--bar` passed directly to the test on the command line. Next,
237 `ios_chrome_integration_egtests` will be run as an xctest. `"xctest": true`
238 must be specified for all xctests, it is an error to try and launch an xctest as
239 a regular test.
240
241 An `include` dict defines a list of tests to import from the `tests`
242 subdirectory in the configs directory. For example:
243 ```json
244 "tests": [
245 {
246 "include": "common_tests.json",
247 "device type": "iPhone 5s",
248 "os": "10.0",
249 "xcode version": "8.0"
250 }
251 ]
252 ```
253 This dict says to import the list of tests from the `tests` subdirectory and run
254 each one on an `iPhone 5s` running iOS `10.0` using Xcode `8.0`. Here's what
255 `common_tests.json` might look like:
256 ```json
257 "tests": [
258 {
259 "app": "ios_chrome_unittests"
260 },
261 {
262 "app": "ios_net_unittests"
263 },
264 {
265 "app": "ios_web_unittests"
266 },
267 ]
268 ```
269 Includes may contain other keys besides `app` which can then be omitted in the
270 bot config. For example if `common_tests.json` specifies:
271 ```json
272 "tests": [
273 {
274 "app": "ios_chrome_integration_egtests",
275 "xctest": true,
276 "xcode version": "8.0"
277 }
278 ]
279 ```
280 Then the bot config may omit the `xctest` or `xcode version` keys, for example:
281 ```json
282 {
283 "comments": [
284 "Sample config for a bot."
285 ],
286 "gn_args": [
287 "is_debug=true",
288 "target_cpu=\"x64\""
289 ],
290 "tests": [
291 {
292 "include": "common_tests.json",
293 "device type": "iPhone 5s",
294 "os": "10.0"
295 }
296 ]
297 }
298 ```
299 Includes are not recursive, so `common_tests.json` may not itself include any
300 `include` dicts.
301
302 ### Uploading compiled artifacts from a bot
303
304 A bot may be configured to upload compiled artifacts. This is defined by the
305 `upload` key. For example:
306 ```json
307 {
308 "comments": [
309 "Sample config for a bot which uploads artifacts."
310 ],
311 "gn_args": [
312 "is_debug=true",
313 "target_cpu=\"x64\""
314 ],
315 "upload": [
316 {
317 "artifact": "Chromium.breakpad",
318 "bucket": "my-gcs-bucket",
319 },
320 {
321 "artifact": "Chromium.app",
322 "bucket": "my-gcs-bucket",
323 "compress": true,
324 },
325 {
326 "artifact": "Chromium.breakpad",
327 "symupload": true,
328 }
329 ]
330 }
331 ```
332 After compilation, the bot will upload three artifacts. First the
333 `Chromium.breakpad` symbols will be uploaded to
334 `gs://my-gcs-bucket/<buildername>/<buildnumber>/Chromium.breakpad`. Next
335 `Chromium.app` will be tarred, gzipped, and uploaded to
336 `gs://my-gcs-bucket/<buildername>/<buildnumber>/Chromium.tar.gz`. Finally
337 the `Chromium.breakpad` symbols will be uploaded to the [breakpad] crash
338 reporting server where they can be used to symbolicate stack traces.
339
340 If `artifact` is a directory, you must specify `"compress": true`.
341
121 [analyzer]: ../tools/mb 342 [analyzer]: ../tools/mb
343 [breakpad]: https://chromium.googlesource.com/breakpad/breakpad
122 [buildbucket]: https://cr-buildbucket.appspot.com 344 [buildbucket]: https://cr-buildbucket.appspot.com
345 [chromium.fyi]: https://build.chromium.org/p/chromium.fyi/waterfall
123 [chromium.mac]: https://build.chromium.org/p/chromium.mac 346 [chromium.mac]: https://build.chromium.org/p/chromium.mac
124 [clang]: ../tools/clang 347 [clang]: ../tools/clang
125 [commit queue]: https://dev.chromium.org/developers/testing/commit-queue 348 [commit queue]: https://dev.chromium.org/developers/testing/commit-queue
126 [gitiles]: https://gerrit.googlesource.com/gitiles 349 [gitiles]: https://gerrit.googlesource.com/gitiles
350 [GN]: ../tools/gn
127 [instructions]: ./ios_build_instructions.md 351 [instructions]: ./ios_build_instructions.md
128 [iOS recipes]: https://chromium.googlesource.com/chromium/tools/build/+/master/s cripts/slave/recipes/ios 352 [iOS recipes]: https://chromium.googlesource.com/chromium/tools/build/+/master/s cripts/slave/recipes/ios
353 [iOS simulator]: ../testing/iossim
129 [recipe module]: https://chromium.googlesource.com/chromium/tools/build/+/master /scripts/slave/recipe_modules/ios 354 [recipe module]: https://chromium.googlesource.com/chromium/tools/build/+/master /scripts/slave/recipe_modules/ios
130 [recipes]: https://chromium.googlesource.com/infra/infra/+/HEAD/doc/users/recipe s.md 355 [recipes]: https://chromium.googlesource.com/infra/infra/+/HEAD/doc/users/recipe s.md
131 [simulator]: https://developer.apple.com/library/content/documentation/IDEs/Conc eptual/iOS_Simulator_Guide/Introduction/Introduction.html 356 [simulator]: https://developer.apple.com/library/content/documentation/IDEs/Conc eptual/iOS_Simulator_Guide/Introduction/Introduction.html
132 [src/ios/build/bots]: ../ios/build/bots 357 [src/ios/build/bots]: ../ios/build/bots
133 [src/ios/build/bots/scripts]: ../ios/build/bots/scripts 358 [src/ios/build/bots/scripts]: ../ios/build/bots/scripts
134 [swarming]: https://github.com/luci/luci-py/tree/master/appengine/swarming 359 [swarming]: https://github.com/luci/luci-py/tree/master/appengine/swarming
135 [swarming server]: https://chromium-swarm.appspot.com 360 [swarming server]: https://chromium-swarm.appspot.com
136 [test runner]: ../ios/build/bots/scripts/test_runner.py 361 [test runner]: ../ios/build/bots/scripts/test_runner.py
137 [tools/build]: https://chromium.googlesource.com/chromium/tools/build 362 [tools/build]: https://chromium.googlesource.com/chromium/tools/build
138 [try job access]: https://www.chromium.org/getting-involved/become-a-committer#T OC-Try-job-access 363 [try job access]: https://www.chromium.org/getting-involved/become-a-committer#T OC-Try-job-access
139 [try server]: https://build.chromium.org/p/tryserver.chromium.mac/waterfall 364 [try server]: https://build.chromium.org/p/tryserver.chromium.mac/waterfall
140 [tryserver.chromium.mac]: https://build.chromium.org/p/tryserver.chromium.mac/wa terfall 365 [tryserver.chromium.mac]: https://build.chromium.org/p/tryserver.chromium.mac/wa terfall
366 [universal binary]: https://en.wikipedia.org/wiki/Universal_binary
367 [xctest]: https://developer.apple.com/reference/xctest
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698