1 Skia Automated Testing 2 ====================== 3 4 Overview 5 -------- 6 7 Skia uses [Swarming](https://github.com/luci/luci-py/blob/master/appengine/swarming/doc/Design.md) 8 to do the heavy lifting for our automated testing. It farms out tasks, which may 9 consist of compiling code, running tests, or any number of other things, to our 10 bots, which are virtual or real machines living in our local lab, Chrome Infra's 11 lab, or in GCE. 12 13 The [Skia Task Scheduler](http://go/skia-task-scheduler) determines what tasks 14 should run on what bots at what time. See the link for a detailed explanation of 15 how relative task priorities are derived. A *task* corresponds to a single 16 Swarming task. A *job* is composed of a directed acyclic graph of one or more 17 *tasks*. The job is complete when all of its component tasks have succeeded 18 or is considered a failure when any of its component tasks fails. The scheduler 19 may automatically retry tasks within its set limits. Jobs are not retried. 20 Multiple jobs may share the same task, for example, tests on two different 21 Android devices which use the same compiled code. 22 23 Each Skia repository has an infra/bots/tasks.json file which defines the jobs 24 and tasks for the repo. Most jobs will run at every commit, but it is possible 25 to specify nightly and weekly jobs as well. For convenience, most repos also 26 have a gen_tasks.go which will generate tasks.json. You will need to 27 [install Go](https://golang.org/doc/install). From the repository root: 28 29 $ go get -u go.skia.org/infra/... 30 $ go run infra/bots/gen_tasks.go 31 32 It is necessary to run gen_tasks.go every time it is changed or every time an 33 [asset](https://skia.googlesource.com/skia/+/master/infra/bots/assets/README.md) 34 has changed. There is also a test mode which simply verifies that the tasks.json 35 file is up to date: 36 37 $ go run infra/bots/gen_tasks.go --test 38 39 40 41 Try Jobs 42 -------- 43 44 It is useful to know how your change will perform before it is submitted. After 45 uploading your CL to [Gerrit](https://skia-review.googlesource.com/), you may 46 trigger a try job for any job listed in tasks.json: 47 48 $ git cl try -B <bucket name> -b <job name> 49 50 The bucket name refers to the [Buildbucket](https://chromium.googlesource.com/infra/infra/+/master/appengine/cr-buildbucket/README.md) 51 bucket to which the request will be submitted. Most public Skia repos use the 52 "skia.primary" bucket, and most private Skia repos use the "skia.internal" 53 bucket. 54 55 56 Status View 57 ------------ 58 59 The status view shows a table with tasks, grouped by test type and platform, 60 on the X-axis and commits on the Y-axis. The cells are colored according to 61 the status of the task for each commit: 62 63 * green: success 64 * orange: failure 65 * purple: exception (infrastructure issue) 66 * black border, no fill: task in progress 67 * blank: no task has started yet for a given revision 68 69 Commits are listed by author, and the branch on which the commit was made is 70 shown on the very left. A purple result will override an orange result. 71 72 For more detail, you can click on an individual cell to get a summary of the 73 task. You can also click one of the white bars at the top of each column to see 74 a summary of recent tasks with the same name. 75 76 The status page has several filters which can be used to show only a subset of 77 task specs: 78 79 * Interesting: Task specs which have both successes and failures within the 80 visible commit window. 81 * Failures: Task specs which have failures within the visible commit window. 82 * Comments: Task specs which have comments. 83 * Failing w/o comment: task specs which have failures within the visible commit 84 window but have no comments. 85 * All: Display all tasks. 86 * Search: Enter a search string. Substrings and regular expressions may be 87 used, per the Javascript String Match() rules: 88 http://www.w3schools.com/jsref/jsref_match.asp 89 90 91