Brad Fitzpatrick | f3c0193 | 2015-01-15 16:29:16 -0800 | [diff] [blame] | 1 | // Copyright 2015 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | package dashboard |
| 6 | |
| 7 | import ( |
Brad Fitzpatrick | aab8504 | 2019-10-16 06:02:29 +0000 | [diff] [blame] | 8 | "bytes" |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 9 | "fmt" |
Brad Fitzpatrick | aab8504 | 2019-10-16 06:02:29 +0000 | [diff] [blame] | 10 | "os/exec" |
| 11 | "path/filepath" |
| 12 | "runtime" |
| 13 | "sort" |
Brad Fitzpatrick | f3c0193 | 2015-01-15 16:29:16 -0800 | [diff] [blame] | 14 | "strings" |
| 15 | "testing" |
Brad Fitzpatrick | 34b995b | 2019-02-14 02:18:06 +0000 | [diff] [blame] | 16 | "time" |
Brad Fitzpatrick | f3c0193 | 2015-01-15 16:29:16 -0800 | [diff] [blame] | 17 | ) |
| 18 | |
| 19 | func TestOSARCHAccessors(t *testing.T) { |
| 20 | valid := func(s string) bool { return s != "" && !strings.Contains(s, "-") } |
| 21 | for _, conf := range Builders { |
| 22 | os := conf.GOOS() |
| 23 | arch := conf.GOARCH() |
| 24 | osArch := os + "-" + arch |
| 25 | if !valid(os) || !valid(arch) || !(conf.Name == osArch || strings.HasPrefix(conf.Name, osArch+"-")) { |
| 26 | t.Errorf("OS+ARCH(%q) = %q, %q; invalid", conf.Name, os, arch) |
| 27 | } |
| 28 | } |
| 29 | } |
Brad Fitzpatrick | c328d04 | 2017-04-12 00:35:37 +0000 | [diff] [blame] | 30 | |
Brad Fitzpatrick | 34b995b | 2019-02-14 02:18:06 +0000 | [diff] [blame] | 31 | func TestDistTestsExecTimeout(t *testing.T) { |
| 32 | tests := []struct { |
| 33 | c *BuildConfig |
| 34 | want time.Duration |
| 35 | }{ |
| 36 | { |
| 37 | &BuildConfig{ |
| 38 | env: []string{}, |
| 39 | testHostConf: &HostConfig{}, |
| 40 | }, |
| 41 | 20 * time.Minute, |
| 42 | }, |
| 43 | { |
| 44 | &BuildConfig{ |
| 45 | env: []string{"GO_TEST_TIMEOUT_SCALE=2"}, |
| 46 | testHostConf: &HostConfig{}, |
| 47 | }, |
| 48 | 40 * time.Minute, |
| 49 | }, |
| 50 | { |
| 51 | &BuildConfig{ |
| 52 | env: []string{}, |
| 53 | testHostConf: &HostConfig{ |
| 54 | env: []string{"GO_TEST_TIMEOUT_SCALE=3"}, |
| 55 | }, |
| 56 | }, |
| 57 | 60 * time.Minute, |
| 58 | }, |
| 59 | // BuildConfig's env takes precedence: |
| 60 | { |
| 61 | &BuildConfig{ |
| 62 | env: []string{"GO_TEST_TIMEOUT_SCALE=2"}, |
| 63 | testHostConf: &HostConfig{ |
| 64 | env: []string{"GO_TEST_TIMEOUT_SCALE=3"}, |
| 65 | }, |
| 66 | }, |
| 67 | 40 * time.Minute, |
| 68 | }, |
| 69 | } |
| 70 | for i, tt := range tests { |
| 71 | got := tt.c.DistTestsExecTimeout(nil) |
| 72 | if got != tt.want { |
| 73 | t.Errorf("%d. got %v; want %v", i, got, tt.want) |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 78 | // TestTrybots tests that a given repo & its branch yields the provided |
| 79 | // complete set of builders. See also: TestBuilders, which tests both trybots |
| 80 | // and post-submit builders, both at arbitrary branches. |
| 81 | func TestTrybots(t *testing.T) { |
| 82 | tests := []struct { |
| 83 | repo string // "go", "net", etc |
| 84 | branch string // of repo |
| 85 | want []string |
| 86 | }{ |
| 87 | { |
| 88 | repo: "go", |
| 89 | branch: "master", |
| 90 | want: []string{ |
Brad Fitzpatrick | 4e29d67 | 2019-04-18 19:45:32 +0000 | [diff] [blame] | 91 | "android-amd64-emu", |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 92 | "freebsd-amd64-12_0", |
| 93 | "js-wasm", |
| 94 | "linux-386", |
| 95 | "linux-amd64", |
| 96 | "linux-amd64-race", |
Brad Fitzpatrick | 95bc93b | 2019-05-10 19:28:40 +0000 | [diff] [blame] | 97 | "misc-compile-other", |
| 98 | "misc-compile-darwin", |
| 99 | "misc-compile-linuxarm", |
| 100 | "misc-compile-solaris", |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 101 | "misc-compile-freebsd", |
| 102 | "misc-compile-mips", |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 103 | "misc-compile-netbsd", |
| 104 | "misc-compile-openbsd", |
| 105 | "misc-compile-plan9", |
| 106 | "misc-compile-ppc", |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 107 | "openbsd-amd64-64", |
| 108 | "windows-386-2008", |
| 109 | "windows-amd64-2016", |
| 110 | }, |
| 111 | }, |
| 112 | { |
| 113 | repo: "go", |
Brad Fitzpatrick | 90670e1 | 2019-10-11 18:47:51 +0000 | [diff] [blame] | 114 | branch: "dev.link", |
| 115 | want: []string{ |
| 116 | "freebsd-amd64-12_0", |
| 117 | "js-wasm", |
| 118 | "linux-386", |
| 119 | "linux-amd64", |
| 120 | "linux-amd64-race", |
| 121 | "misc-compile-other", |
| 122 | "misc-compile-darwin", |
| 123 | "misc-compile-linuxarm", |
| 124 | "misc-compile-solaris", |
| 125 | "misc-compile-freebsd", |
| 126 | "misc-compile-mips", |
| 127 | "misc-compile-netbsd", |
| 128 | "misc-compile-openbsd", |
| 129 | "misc-compile-plan9", |
| 130 | "misc-compile-ppc", |
| 131 | "openbsd-amd64-64", |
| 132 | "windows-386-2008", |
| 133 | "windows-amd64-2016", |
| 134 | }, |
| 135 | }, |
| 136 | { |
| 137 | repo: "go", |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 138 | branch: "release-branch.go1.12", |
| 139 | want: []string{ |
| 140 | "freebsd-amd64-10_3", |
| 141 | "freebsd-amd64-12_0", |
| 142 | "js-wasm", |
| 143 | "linux-386", |
| 144 | "linux-amd64", |
| 145 | "linux-amd64-race", |
Brad Fitzpatrick | 95bc93b | 2019-05-10 19:28:40 +0000 | [diff] [blame] | 146 | "misc-compile-darwin", |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 147 | "misc-compile-freebsd", |
Brad Fitzpatrick | 95bc93b | 2019-05-10 19:28:40 +0000 | [diff] [blame] | 148 | "misc-compile-linuxarm", |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 149 | "misc-compile-mips", |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 150 | "misc-compile-netbsd", |
| 151 | "misc-compile-openbsd", |
Brad Fitzpatrick | 95bc93b | 2019-05-10 19:28:40 +0000 | [diff] [blame] | 152 | "misc-compile-other", |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 153 | "misc-compile-plan9", |
| 154 | "misc-compile-ppc", |
Brad Fitzpatrick | 95bc93b | 2019-05-10 19:28:40 +0000 | [diff] [blame] | 155 | "misc-compile-solaris", |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 156 | "nacl-amd64p32", |
| 157 | "openbsd-amd64-64", |
| 158 | "windows-386-2008", |
| 159 | "windows-amd64-2016", |
| 160 | }, |
| 161 | }, |
| 162 | { |
| 163 | repo: "mobile", |
| 164 | branch: "master", |
| 165 | want: []string{ |
| 166 | "android-amd64-emu", |
| 167 | "linux-amd64-androidemu", |
| 168 | }, |
| 169 | }, |
| 170 | { |
| 171 | repo: "sys", |
| 172 | branch: "master", |
| 173 | want: []string{ |
Brad Fitzpatrick | 6d867c8 | 2019-04-26 14:04:00 +0000 | [diff] [blame] | 174 | "android-amd64-emu", |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 175 | "freebsd-386-11_2", |
| 176 | "freebsd-amd64-11_2", |
| 177 | "freebsd-amd64-12_0", |
| 178 | "linux-386", |
| 179 | "linux-amd64", |
Brad Fitzpatrick | 8665028 | 2019-03-11 18:49:56 +0000 | [diff] [blame] | 180 | "linux-amd64-race", |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 181 | "netbsd-amd64-8_0", |
| 182 | "openbsd-386-64", |
| 183 | "openbsd-amd64-64", |
| 184 | "windows-386-2008", |
| 185 | "windows-amd64-2016", |
| 186 | }, |
| 187 | }, |
Brad Fitzpatrick | 83c6b6a | 2019-03-14 20:35:32 +0000 | [diff] [blame] | 188 | { |
| 189 | repo: "exp", |
| 190 | branch: "master", |
| 191 | want: []string{ |
Brad Fitzpatrick | 83c6b6a | 2019-03-14 20:35:32 +0000 | [diff] [blame] | 192 | "linux-amd64", |
| 193 | "linux-amd64-race", |
Brad Fitzpatrick | 83c6b6a | 2019-03-14 20:35:32 +0000 | [diff] [blame] | 194 | "windows-386-2008", |
| 195 | "windows-amd64-2016", |
| 196 | }, |
| 197 | }, |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 198 | } |
| 199 | for i, tt := range tests { |
| 200 | if tt.branch == "" || tt.repo == "" { |
| 201 | t.Errorf("incomplete test entry %d", i) |
| 202 | return |
| 203 | } |
| 204 | t.Run(fmt.Sprintf("%s/%s", tt.repo, tt.branch), func(t *testing.T) { |
| 205 | var got []string |
| 206 | goBranch := tt.branch // hard-code the common case for now |
| 207 | for _, bc := range TryBuildersForProject(tt.repo, tt.branch, goBranch) { |
| 208 | got = append(got, bc.Name) |
| 209 | } |
| 210 | m := map[string]bool{} |
| 211 | for _, b := range tt.want { |
| 212 | m[b] = true |
| 213 | } |
| 214 | for _, b := range got { |
| 215 | if _, ok := m[b]; !ok { |
| 216 | t.Errorf("got unexpected %q", b) |
| 217 | } |
| 218 | delete(m, b) |
| 219 | } |
| 220 | for b := range m { |
| 221 | t.Errorf("missing expected %q", b) |
Brad Fitzpatrick | c517aed | 2018-10-26 19:21:58 +0000 | [diff] [blame] | 222 | } |
| 223 | }) |
Brad Fitzpatrick | c328d04 | 2017-04-12 00:35:37 +0000 | [diff] [blame] | 224 | } |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 225 | } |
| 226 | |
| 227 | // TestBuilderConfig whether a given builder and repo at different |
| 228 | // branches is either a post-submit builder, trybot, neither, or both. |
| 229 | func TestBuilderConfig(t *testing.T) { |
| 230 | // builderConfigWant is bitmask of 4 different things to assert are wanted: |
| 231 | // - being a post-submit builder |
| 232 | // - NOT being a post-submit builder |
| 233 | // - being a trybot builder |
| 234 | // - NOT being a post-submit builder |
| 235 | type want uint8 |
| 236 | const ( |
| 237 | isTrybot want = 1 << iota |
| 238 | notTrybot |
| 239 | isBuilder // post-submit |
| 240 | notBuilder // not post-submit |
| 241 | |
| 242 | none = notTrybot + notBuilder |
| 243 | both = isTrybot + isBuilder |
| 244 | onlyPost = notTrybot + isBuilder |
| 245 | ) |
| 246 | |
| 247 | type builderAndRepo struct { |
| 248 | testName string |
| 249 | builder string |
| 250 | repo string |
| 251 | branch string |
| 252 | goBranch string |
| 253 | } |
Dmitri Shuralyov | 76fd6b5 | 2019-10-08 13:08:27 -0400 | [diff] [blame] | 254 | // builder may end in "@go1.N" or "@1.N" (as alias for "@release-branch.go1.N") or "@branch-name". |
| 255 | // repo (other than "go") may end in "@go1.N" or "@1.N" (as alias for "@release-branch.go1.N"). |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 256 | b := func(builder, repo string) builderAndRepo { |
| 257 | br := builderAndRepo{ |
| 258 | testName: builder + "," + repo, |
| 259 | builder: builder, |
| 260 | goBranch: "master", |
| 261 | repo: repo, |
| 262 | branch: "master", |
| 263 | } |
| 264 | if strings.Contains(builder, "@") { |
| 265 | f := strings.SplitN(builder, "@", 2) |
| 266 | br.builder = f[0] |
| 267 | br.goBranch = f[1] |
| 268 | } |
| 269 | if strings.Contains(repo, "@") { |
| 270 | f := strings.SplitN(repo, "@", 2) |
| 271 | br.repo = f[0] |
| 272 | br.branch = f[1] |
Dmitri Shuralyov | 76fd6b5 | 2019-10-08 13:08:27 -0400 | [diff] [blame] | 273 | if br.repo == "go" { |
| 274 | panic(fmt.Errorf(`b(%q, %q): for "go" repo, must use the @%s suffix on the builder, not on the repo`, builder, repo, br.branch)) |
| 275 | } |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 276 | } |
| 277 | expandBranch := func(s *string) { |
| 278 | if strings.HasPrefix(*s, "go1.") { |
| 279 | *s = "release-branch." + *s |
| 280 | } else if strings.HasPrefix(*s, "1.") { |
| 281 | *s = "release-branch.go" + *s |
| 282 | } |
| 283 | } |
| 284 | expandBranch(&br.branch) |
| 285 | expandBranch(&br.goBranch) |
| 286 | if br.repo == "go" { |
| 287 | br.branch = br.goBranch |
| 288 | } |
| 289 | return br |
| 290 | } |
| 291 | tests := []struct { |
| 292 | br builderAndRepo |
| 293 | want want |
| 294 | }{ |
| 295 | {b("linux-amd64", "go"), both}, |
| 296 | {b("linux-amd64", "net"), both}, |
| 297 | {b("linux-amd64", "sys"), both}, |
Dmitri Shuralyov | 7aef06b | 2019-05-16 16:04:34 -0400 | [diff] [blame] | 298 | {b("linux-amd64", "website"), both}, |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 299 | |
Brad Fitzpatrick | b8db43d | 2019-03-11 04:20:46 +0000 | [diff] [blame] | 300 | // Don't test all subrepos on all the builders. |
| 301 | {b("linux-amd64-ssacheck", "net"), none}, |
| 302 | {b("linux-amd64-ssacheck@go1.10", "net"), none}, |
| 303 | {b("linux-amd64-noopt@go1.11", "net"), none}, |
| 304 | {b("linux-386-387@go1.11", "net"), none}, |
| 305 | {b("linux-386-387@go1.11", "go"), onlyPost}, |
| 306 | {b("linux-386-387", "crypto"), onlyPost}, |
| 307 | {b("linux-arm-arm5spacemonkey@go1.11", "net"), none}, |
| 308 | {b("linux-arm-arm5spacemonkey@go1.12", "net"), none}, |
| 309 | |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 310 | // The mobile repo requires Go 1.13+. |
Brad Fitzpatrick | 4e29d67 | 2019-04-18 19:45:32 +0000 | [diff] [blame] | 311 | {b("android-amd64-emu", "go"), both}, |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 312 | {b("android-amd64-emu", "mobile"), both}, |
| 313 | {b("android-amd64-emu", "mobile@1.10"), none}, |
| 314 | {b("android-amd64-emu", "mobile@1.11"), none}, |
| 315 | {b("android-amd64-emu@go1.10", "mobile"), none}, |
| 316 | {b("android-amd64-emu@go1.11", "mobile"), none}, |
| 317 | {b("android-amd64-emu@go1.12", "mobile"), none}, |
| 318 | {b("android-amd64-emu@go1.13", "mobile"), both}, |
| 319 | {b("android-amd64-emu", "mobile@1.13"), both}, |
Brad Fitzpatrick | 6d867c8 | 2019-04-26 14:04:00 +0000 | [diff] [blame] | 320 | {b("android-amd64-emu", "crypto"), both}, |
| 321 | {b("android-amd64-emu", "net"), both}, |
| 322 | {b("android-amd64-emu", "sync"), both}, |
| 323 | {b("android-amd64-emu", "sys"), both}, |
| 324 | {b("android-amd64-emu", "text"), both}, |
| 325 | {b("android-amd64-emu", "time"), both}, |
| 326 | {b("android-amd64-emu", "tools"), both}, |
Dmitri Shuralyov | bb0f224 | 2019-08-29 09:22:13 -0400 | [diff] [blame] | 327 | {b("android-amd64-emu", "website"), none}, |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 328 | |
| 329 | {b("android-386-emu", "go"), onlyPost}, |
| 330 | {b("android-386-emu", "mobile"), onlyPost}, |
| 331 | {b("android-386-emu", "mobile@1.10"), none}, |
| 332 | {b("android-386-emu", "mobile@1.11"), none}, |
| 333 | {b("android-386-emu@go1.10", "mobile"), none}, |
| 334 | {b("android-386-emu@go1.11", "mobile"), none}, |
| 335 | {b("android-386-emu@go1.12", "mobile"), none}, |
| 336 | {b("android-386-emu@go1.13", "mobile"), onlyPost}, |
| 337 | {b("android-386-emu", "mobile@1.13"), onlyPost}, |
| 338 | |
| 339 | {b("linux-amd64", "net"), both}, |
| 340 | {b("linux-amd64", "net@1.12"), both}, |
| 341 | {b("linux-amd64@go1.12", "net@1.12"), both}, |
| 342 | {b("linux-amd64", "net@1.11"), both}, |
| 343 | {b("linux-amd64", "net@1.11"), both}, |
| 344 | {b("linux-amd64", "net@1.10"), none}, // too old |
| 345 | {b("linux-amd64@go1.10", "net"), none}, // too old |
| 346 | {b("linux-amd64@go1.11", "net"), both}, |
| 347 | {b("linux-amd64@go1.11", "net@1.11"), both}, |
| 348 | {b("linux-amd64@go1.12", "net@1.12"), both}, |
| 349 | |
Meng Zhuo | 8805279 | 2019-09-10 07:21:11 +0800 | [diff] [blame] | 350 | {b("linux-mips64le-mengzhuo", "go"), onlyPost}, |
| 351 | {b("linux-mips64le-mengzhuo", "sys"), onlyPost}, |
| 352 | {b("linux-mips64le-mengzhuo", "net"), onlyPost}, |
| 353 | |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 354 | // go1.12.html: "Go 1.12 is the last release that is |
| 355 | // supported on FreeBSD 10.x [... and 11.1]" |
Brad Fitzpatrick | b8db43d | 2019-03-11 04:20:46 +0000 | [diff] [blame] | 356 | {b("freebsd-386-10_3", "go"), none}, |
| 357 | {b("freebsd-386-10_3", "net"), none}, |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 358 | {b("freebsd-amd64-10_3", "go"), none}, |
| 359 | {b("freebsd-amd64-10_3", "net"), none}, |
| 360 | {b("freebsd-amd64-11_1", "go"), none}, |
| 361 | {b("freebsd-amd64-11_1", "net"), none}, |
| 362 | {b("freebsd-amd64-10_3@go1.12", "go"), both}, |
| 363 | {b("freebsd-amd64-10_3@go1.12", "net@1.12"), both}, |
| 364 | {b("freebsd-amd64-10_3@go1.11", "go"), both}, |
| 365 | {b("freebsd-amd64-10_3@go1.11", "net@1.11"), both}, |
| 366 | {b("freebsd-amd64-11_1@go1.13", "go"), none}, |
| 367 | {b("freebsd-amd64-11_1@go1.13", "net@1.12"), none}, |
| 368 | {b("freebsd-amd64-11_1@go1.12", "go"), isBuilder}, |
| 369 | {b("freebsd-amd64-11_1@go1.12", "net@1.12"), isBuilder}, |
| 370 | {b("freebsd-amd64-11_1@go1.11", "go"), isBuilder}, |
| 371 | {b("freebsd-amd64-11_1@go1.11", "net@1.11"), isBuilder}, |
| 372 | |
Brad Fitzpatrick | 9e52fce | 2019-03-12 21:13:50 +0000 | [diff] [blame] | 373 | // FreeBSD 12.0 |
| 374 | {b("freebsd-amd64-12_0", "go"), both}, |
| 375 | {b("freebsd-amd64-12_0", "net"), both}, |
| 376 | {b("freebsd-386-12_0", "go"), onlyPost}, |
| 377 | {b("freebsd-386-12_0", "net"), onlyPost}, |
| 378 | |
Brad Fitzpatrick | fcf7a58 | 2019-04-30 22:37:31 +0000 | [diff] [blame] | 379 | // NetBSD |
| 380 | {b("netbsd-amd64-8_0", "go"), onlyPost}, |
| 381 | {b("netbsd-amd64-8_0", "net"), onlyPost}, |
| 382 | {b("netbsd-386-8_0", "go"), none}, |
| 383 | {b("netbsd-386-8_0", "net"), none}, |
| 384 | |
Tobias Klauser | b7b6693 | 2019-03-13 09:29:15 +0100 | [diff] [blame] | 385 | // AIX starts at Go 1.12 |
| 386 | {b("aix-ppc64", "go"), onlyPost}, |
| 387 | {b("aix-ppc64", "net"), onlyPost}, |
Tobias Klauser | c2ec9e4 | 2019-06-04 10:14:55 +0200 | [diff] [blame] | 388 | {b("aix-ppc64", "mobile"), none}, |
| 389 | {b("aix-ppc64", "exp"), none}, |
Tobias Klauser | cbdd89b | 2019-10-14 11:31:13 +0200 | [diff] [blame] | 390 | {b("aix-ppc64", "term"), onlyPost}, |
Tobias Klauser | b7b6693 | 2019-03-13 09:29:15 +0100 | [diff] [blame] | 391 | {b("aix-ppc64@go1.12", "go"), onlyPost}, |
Brad Fitzpatrick | 0bbb12f | 2019-04-19 14:37:11 +0000 | [diff] [blame] | 392 | {b("aix-ppc64@go1.12", "net"), none}, |
Tobias Klauser | c2ec9e4 | 2019-06-04 10:14:55 +0200 | [diff] [blame] | 393 | {b("aix-ppc64@go1.12", "mobile"), none}, |
Brad Fitzpatrick | 0bbb12f | 2019-04-19 14:37:11 +0000 | [diff] [blame] | 394 | {b("aix-ppc64@go1.13", "net"), onlyPost}, |
Tobias Klauser | c2ec9e4 | 2019-06-04 10:14:55 +0200 | [diff] [blame] | 395 | {b("aix-ppc64@go1.13", "mobile"), none}, |
Tobias Klauser | b7b6693 | 2019-03-13 09:29:15 +0100 | [diff] [blame] | 396 | {b("aix-ppc64@go1.11", "go"), none}, |
| 397 | {b("aix-ppc64@go1.11", "net"), none}, |
Tobias Klauser | c2ec9e4 | 2019-06-04 10:14:55 +0200 | [diff] [blame] | 398 | {b("aix-ppc64@go1.11", "mobile"), none}, |
Tobias Klauser | b7b6693 | 2019-03-13 09:29:15 +0100 | [diff] [blame] | 399 | |
Brad Fitzpatrick | b8db43d | 2019-03-11 04:20:46 +0000 | [diff] [blame] | 400 | {b("linux-amd64-nocgo", "mobile"), none}, |
| 401 | |
Elias Naur | 4d0f77a | 2019-05-01 22:28:43 +0200 | [diff] [blame] | 402 | // Virtual mobiledevices |
Elias Naur | 6bebc8e | 2019-05-01 20:33:26 +0200 | [diff] [blame] | 403 | {b("darwin-arm64-corellium", "go"), isBuilder}, |
Elias Naur | 4d0f77a | 2019-05-01 22:28:43 +0200 | [diff] [blame] | 404 | {b("android-arm64-corellium", "go"), isBuilder}, |
Elias Naur | 7ae7539 | 2019-05-02 00:54:54 +0200 | [diff] [blame] | 405 | {b("android-arm-corellium", "go"), isBuilder}, |
Elias Naur | 6bebc8e | 2019-05-01 20:33:26 +0200 | [diff] [blame] | 406 | |
Brad Fitzpatrick | 13f1da9 | 2019-03-12 16:21:55 +0000 | [diff] [blame] | 407 | // Mobile builders that run with GOOS=linux/darwin and have |
| 408 | // a device attached. |
| 409 | {b("linux-amd64-androidemu", "mobile"), both}, |
Brad Fitzpatrick | 13f1da9 | 2019-03-12 16:21:55 +0000 | [diff] [blame] | 410 | |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 411 | // But the emulators run all: |
| 412 | {b("android-amd64-emu", "mobile"), isBuilder}, |
| 413 | {b("android-386-emu", "mobile"), isBuilder}, |
| 414 | {b("android-amd64-emu", "net"), isBuilder}, |
| 415 | {b("android-386-emu", "net"), isBuilder}, |
| 416 | {b("android-amd64-emu", "go"), isBuilder}, |
| 417 | {b("android-386-emu", "go"), isBuilder}, |
Brad Fitzpatrick | b8db43d | 2019-03-11 04:20:46 +0000 | [diff] [blame] | 418 | |
Bryan C. Mills | 4c2de3e | 2019-08-30 08:34:16 -0400 | [diff] [blame] | 419 | {b("nacl-386", "go"), none}, |
Brad Fitzpatrick | 90670e1 | 2019-10-11 18:47:51 +0000 | [diff] [blame] | 420 | {b("nacl-386@dev.link", "go"), none}, |
Bryan C. Mills | 4c2de3e | 2019-08-30 08:34:16 -0400 | [diff] [blame] | 421 | {b("nacl-386@go1.13", "go"), onlyPost}, |
Brad Fitzpatrick | b8db43d | 2019-03-11 04:20:46 +0000 | [diff] [blame] | 422 | {b("nacl-386", "net"), none}, |
Bryan C. Mills | 4c2de3e | 2019-08-30 08:34:16 -0400 | [diff] [blame] | 423 | {b("nacl-amd64p32", "go"), none}, |
Brad Fitzpatrick | 90670e1 | 2019-10-11 18:47:51 +0000 | [diff] [blame] | 424 | {b("nacl-amd64p32@dev.link", "go"), none}, |
Bryan C. Mills | 4c2de3e | 2019-08-30 08:34:16 -0400 | [diff] [blame] | 425 | {b("nacl-amd64p32@go1.13", "go"), both}, |
Brad Fitzpatrick | b8db43d | 2019-03-11 04:20:46 +0000 | [diff] [blame] | 426 | {b("nacl-amd64p32", "net"), none}, |
| 427 | |
Brad Fitzpatrick | 8665028 | 2019-03-11 18:49:56 +0000 | [diff] [blame] | 428 | // Only test tip for js/wasm, and only for some repos: |
Brad Fitzpatrick | b8db43d | 2019-03-11 04:20:46 +0000 | [diff] [blame] | 429 | {b("js-wasm", "go"), both}, |
Brad Fitzpatrick | 8665028 | 2019-03-11 18:49:56 +0000 | [diff] [blame] | 430 | {b("js-wasm", "arch"), onlyPost}, |
| 431 | {b("js-wasm", "crypto"), onlyPost}, |
| 432 | {b("js-wasm", "sys"), onlyPost}, |
Brad Fitzpatrick | b8db43d | 2019-03-11 04:20:46 +0000 | [diff] [blame] | 433 | {b("js-wasm", "net"), onlyPost}, |
| 434 | {b("js-wasm@go1.12", "net"), none}, |
Brad Fitzpatrick | 8665028 | 2019-03-11 18:49:56 +0000 | [diff] [blame] | 435 | {b("js-wasm", "benchmarks"), none}, |
| 436 | {b("js-wasm", "debug"), none}, |
| 437 | {b("js-wasm", "mobile"), none}, |
| 438 | {b("js-wasm", "perf"), none}, |
| 439 | {b("js-wasm", "talks"), none}, |
| 440 | {b("js-wasm", "tools"), none}, |
| 441 | {b("js-wasm", "tour"), none}, |
| 442 | {b("js-wasm", "website"), none}, |
| 443 | |
| 444 | // Race builders. Linux for all, GCE buidlers for |
| 445 | // post-submit, and only post-submit for "go" for |
| 446 | // Darwin (limited resources). |
| 447 | {b("linux-amd64-race", "go"), both}, |
| 448 | {b("linux-amd64-race", "net"), both}, |
| 449 | {b("windows-amd64-race", "go"), onlyPost}, |
| 450 | {b("windows-amd64-race", "net"), onlyPost}, |
| 451 | {b("freebsd-amd64-race", "go"), onlyPost}, |
| 452 | {b("freebsd-amd64-race", "net"), onlyPost}, |
| 453 | {b("darwin-amd64-race", "go"), onlyPost}, |
| 454 | {b("darwin-amd64-race", "net"), none}, |
| 455 | |
| 456 | // Long test. |
| 457 | {b("linux-amd64-longtest", "go"), onlyPost}, |
| 458 | {b("linux-amd64-longtest", "net"), onlyPost}, |
| 459 | {b("linux-amd64-longtest@go1.12", "go"), onlyPost}, |
| 460 | {b("linux-amd64-longtest@go1.12", "net"), none}, |
Brad Fitzpatrick | f9c537e | 2019-10-28 20:16:36 +0000 | [diff] [blame^] | 461 | {b("windows-amd64-longtest", "go"), onlyPost}, |
| 462 | {b("windows-amd64-longtest@go1.13", "go"), onlyPost}, |
| 463 | {b("windows-amd64-longtest", "net"), onlyPost}, |
| 464 | {b("windows-amd64-longtest", "exp"), onlyPost}, |
| 465 | {b("windows-amd64-longtest", "mobile"), none}, |
Brad Fitzpatrick | 83c6b6a | 2019-03-14 20:35:32 +0000 | [diff] [blame] | 466 | |
Brad Fitzpatrick | d6a8c27 | 2019-04-05 05:26:05 +0000 | [diff] [blame] | 467 | // Experimental exp repo runs in very few places. |
Brad Fitzpatrick | 83c6b6a | 2019-03-14 20:35:32 +0000 | [diff] [blame] | 468 | {b("linux-amd64", "exp"), both}, |
Brad Fitzpatrick | d6a8c27 | 2019-04-05 05:26:05 +0000 | [diff] [blame] | 469 | {b("linux-amd64-race", "exp"), both}, |
| 470 | {b("linux-amd64-longtest", "exp"), onlyPost}, |
Brad Fitzpatrick | 83c6b6a | 2019-03-14 20:35:32 +0000 | [diff] [blame] | 471 | {b("windows-386-2008", "exp"), both}, |
Brad Fitzpatrick | d6a8c27 | 2019-04-05 05:26:05 +0000 | [diff] [blame] | 472 | {b("windows-amd64-2016", "exp"), both}, |
Brad Fitzpatrick | d6a8c27 | 2019-04-05 05:26:05 +0000 | [diff] [blame] | 473 | {b("darwin-amd64-10_14", "exp"), onlyPost}, |
| 474 | // ... but not on most others: |
Dmitri Shuralyov | 3b77b3a | 2019-09-28 17:43:42 +0000 | [diff] [blame] | 475 | {b("darwin-amd64-10_12", "exp"), none}, |
Brad Fitzpatrick | d6a8c27 | 2019-04-05 05:26:05 +0000 | [diff] [blame] | 476 | {b("freebsd-386-11_2", "exp"), none}, |
| 477 | {b("freebsd-386-12_0", "exp"), none}, |
| 478 | {b("freebsd-amd64-11_2", "exp"), none}, |
| 479 | {b("freebsd-amd64-12_0", "exp"), none}, |
| 480 | {b("openbsd-amd64-62", "exp"), none}, |
| 481 | {b("openbsd-amd64-64", "exp"), none}, |
| 482 | {b("js-wasm", "exp"), none}, |
| 483 | |
| 484 | // exp is experimental; it doesn't test against release branches. |
| 485 | {b("linux-amd64@go1.11", "exp"), none}, |
| 486 | {b("linux-amd64@go1.12", "exp"), none}, |
Brad Fitzpatrick | 8a071d4 | 2019-03-18 16:48:22 +0000 | [diff] [blame] | 487 | |
| 488 | // Only use latest macOS for subrepos, and only amd64: |
| 489 | {b("darwin-amd64-10_12", "net"), onlyPost}, |
| 490 | {b("darwin-amd64-10_12@go1.11", "net"), onlyPost}, |
| 491 | {b("darwin-amd64-10_11", "net"), none}, |
| 492 | {b("darwin-amd64-10_11@go1.11", "net"), none}, |
| 493 | {b("darwin-amd64-10_11@go1.12", "net"), none}, |
Brad Fitzpatrick | d5a7640 | 2019-04-29 16:41:45 +0000 | [diff] [blame] | 494 | {b("darwin-386-10_14@go1.11", "net"), none}, |
Brad Fitzpatrick | 8bd8e0e | 2019-03-26 23:04:31 +0000 | [diff] [blame] | 495 | |
| 496 | {b("darwin-amd64-10_14", "go"), onlyPost}, |
| 497 | {b("darwin-amd64-10_12", "go"), onlyPost}, |
| 498 | {b("darwin-amd64-10_11", "go"), onlyPost}, |
| 499 | {b("darwin-amd64-10_10", "go"), none}, |
| 500 | {b("darwin-amd64-10_10@go1.12", "go"), onlyPost}, |
| 501 | {b("darwin-amd64-10_10@go1.11", "go"), onlyPost}, |
Brad Fitzpatrick | d5a7640 | 2019-04-29 16:41:45 +0000 | [diff] [blame] | 502 | {b("darwin-386-10_14", "go"), onlyPost}, |
Alexander Rakoczy | 2fe64f7 | 2019-08-26 16:40:35 -0400 | [diff] [blame] | 503 | {b("darwin-386-10_14@go1.12", "go"), none}, |
| 504 | {b("darwin-386-10_14@go1.13", "go"), onlyPost}, |
Brad Fitzpatrick | 85a73d7 | 2019-04-03 04:45:29 +0000 | [diff] [blame] | 505 | |
Brad Fitzpatrick | 67073b9 | 2019-04-18 19:33:19 +0000 | [diff] [blame] | 506 | // plan9 only lived at master. We didn't support any past releases. |
| 507 | // But it's off for now as it's always failing. |
| 508 | {b("plan9-386", "go"), none}, // temporarily disabled |
| 509 | {b("plan9-386", "net"), none}, // temporarily disabled |
Brad Fitzpatrick | f7a5fcf | 2019-04-03 05:03:37 +0000 | [diff] [blame] | 510 | {b("plan9-386@go1.11", "go"), none}, |
| 511 | {b("plan9-386@go1.12", "go"), none}, |
Brad Fitzpatrick | f7a5fcf | 2019-04-03 05:03:37 +0000 | [diff] [blame] | 512 | {b("plan9-386@go1.11", "net"), none}, |
| 513 | {b("plan9-386@go1.12", "net"), none}, |
| 514 | {b("plan9-amd64-9front", "go"), onlyPost}, |
| 515 | {b("plan9-amd64-9front@go1.11", "go"), none}, |
| 516 | {b("plan9-amd64-9front@go1.12", "go"), none}, |
| 517 | {b("plan9-amd64-9front", "net"), onlyPost}, |
| 518 | {b("plan9-amd64-9front@go1.11", "net"), none}, |
| 519 | {b("plan9-amd64-9front@go1.12", "net"), none}, |
| 520 | {b("plan9-arm", "go"), onlyPost}, |
| 521 | {b("plan9-arm@go1.11", "go"), none}, |
| 522 | {b("plan9-arm@go1.12", "go"), none}, |
| 523 | {b("plan9-arm", "net"), onlyPost}, |
| 524 | {b("plan9-arm@go1.11", "net"), none}, |
| 525 | {b("plan9-arm@go1.12", "net"), none}, |
Brad Fitzpatrick | d6a8c27 | 2019-04-05 05:26:05 +0000 | [diff] [blame] | 526 | |
| 527 | // x/net master with Go 1.11 doesn't work on our builders |
| 528 | // on 32-bit FreeBSD. Remove distracting red from the dashboard |
| 529 | // that'll never be fixed. |
| 530 | {b("freebsd-386-11_2@go1.11", "net"), none}, |
| 531 | {b("freebsd-386-12_0@go1.11", "net"), none}, |
Brad Fitzpatrick | 5877195 | 2019-10-21 15:00:32 +0000 | [diff] [blame] | 532 | |
| 533 | {b("dragonfly-amd64", "go"), onlyPost}, |
| 534 | {b("dragonfly-amd64", "net"), onlyPost}, |
| 535 | {b("dragonfly-amd64@go1.13", "net"), none}, // Dragonfly ABI changes only supported by Go 1.14+ |
| 536 | {b("dragonfly-amd64@go1.13", "go"), none}, // Dragonfly ABI changes only supported by Go 1.14+ |
| 537 | {b("dragonfly-amd64-5_6", "go"), onlyPost}, |
| 538 | {b("dragonfly-amd64-5_6", "net"), onlyPost}, |
| 539 | {b("dragonfly-amd64-5_6@go1.13", "net"), onlyPost}, |
Brad Fitzpatrick | 756764c | 2019-03-07 17:44:41 +0000 | [diff] [blame] | 540 | } |
| 541 | for _, tt := range tests { |
| 542 | t.Run(tt.br.testName, func(t *testing.T) { |
| 543 | bc, ok := Builders[tt.br.builder] |
| 544 | if !ok { |
| 545 | t.Fatalf("unknown builder %q", tt.br.builder) |
| 546 | } |
| 547 | gotPost := bc.BuildsRepoPostSubmit(tt.br.repo, tt.br.branch, tt.br.goBranch) |
| 548 | if tt.want&isBuilder != 0 && !gotPost { |
| 549 | t.Errorf("not a post-submit builder, but expected") |
| 550 | } |
| 551 | if tt.want¬Builder != 0 && gotPost { |
| 552 | t.Errorf("unexpectedly a post-submit builder") |
| 553 | } |
| 554 | |
| 555 | gotTry := bc.BuildsRepoTryBot(tt.br.repo, tt.br.branch, tt.br.goBranch) |
| 556 | if tt.want&isTrybot != 0 && !gotTry { |
| 557 | t.Errorf("not trybot, but expected") |
| 558 | } |
| 559 | if tt.want¬Trybot != 0 && gotTry { |
| 560 | t.Errorf("unexpectedly a trybot") |
| 561 | } |
| 562 | |
| 563 | if t.Failed() { |
| 564 | t.Logf("For: %+v", tt.br) |
| 565 | } |
| 566 | }) |
| 567 | } |
Brad Fitzpatrick | c328d04 | 2017-04-12 00:35:37 +0000 | [diff] [blame] | 568 | } |
| 569 | |
| 570 | func TestHostConfigsAllUsed(t *testing.T) { |
| 571 | used := map[string]bool{} |
| 572 | for _, conf := range Builders { |
| 573 | used[conf.HostType] = true |
| 574 | } |
| 575 | for hostType := range Hosts { |
| 576 | if !used[hostType] { |
| 577 | // Currently host-linux-armhf-cross and host-linux-armel-cross aren't |
| 578 | // referenced, but the coordinator hard-codes them, so don't make |
| 579 | // this an error for now. |
| 580 | t.Logf("warning: host type %q is not referenced from any build config", hostType) |
| 581 | } |
| 582 | } |
| 583 | } |
Brad Fitzpatrick | 8665028 | 2019-03-11 18:49:56 +0000 | [diff] [blame] | 584 | |
| 585 | // tests that goBranch is optional for repo == "go" |
| 586 | func TestBuildsRepoAtAllImplicitGoBranch(t *testing.T) { |
| 587 | builder := Builders["android-amd64-emu"] |
| 588 | got := builder.buildsRepoAtAll("go", "master", "") |
| 589 | if !got { |
| 590 | t.Error("got = false; want true") |
| 591 | } |
| 592 | } |
Brad Fitzpatrick | 43eb39e | 2019-04-02 15:27:10 +0000 | [diff] [blame] | 593 | |
| 594 | func TestShouldRunDistTest(t *testing.T) { |
| 595 | type buildMode int |
| 596 | const ( |
| 597 | tryMode buildMode = 0 |
| 598 | postSubmit buildMode = 1 |
| 599 | ) |
| 600 | |
| 601 | tests := []struct { |
| 602 | builder string |
| 603 | test string |
| 604 | mode buildMode |
| 605 | want bool |
| 606 | }{ |
| 607 | {"linux-amd64", "api", postSubmit, true}, |
| 608 | {"linux-amd64", "api", tryMode, true}, |
| 609 | |
| 610 | {"linux-amd64", "reboot", tryMode, true}, |
| 611 | {"linux-amd64-race", "reboot", tryMode, false}, |
| 612 | |
| 613 | {"darwin-amd64-10_10", "test:foo", postSubmit, false}, |
| 614 | {"darwin-amd64-10_11", "test:foo", postSubmit, false}, |
| 615 | {"darwin-amd64-10_12", "test:foo", postSubmit, false}, |
| 616 | {"darwin-amd64-10_14", "test:foo", postSubmit, false}, |
| 617 | {"darwin-amd64-10_14", "test:foo", postSubmit, false}, |
| 618 | {"darwin-amd64-10_14", "reboot", postSubmit, false}, |
| 619 | {"darwin-amd64-10_14", "api", postSubmit, false}, |
| 620 | {"darwin-amd64-10_14", "codewalk", postSubmit, false}, |
| 621 | } |
| 622 | for _, tt := range tests { |
| 623 | bc, ok := Builders[tt.builder] |
| 624 | if !ok { |
| 625 | t.Errorf("unknown builder %q", tt.builder) |
| 626 | continue |
| 627 | } |
| 628 | isTry := tt.mode == tryMode |
| 629 | if isTry && !bc.BuildsRepoTryBot("go", "master", "master") { |
| 630 | t.Errorf("builder %q is not a trybot, so can't run test %q in try mode", tt.builder, tt.test) |
| 631 | continue |
| 632 | } |
| 633 | got := bc.ShouldRunDistTest(tt.test, isTry) |
| 634 | if got != tt.want { |
| 635 | t.Errorf("%q.ShouldRunDistTest(%q, try %v) = %v; want %v", tt.builder, tt.test, isTry, got, tt.want) |
| 636 | } |
| 637 | } |
| 638 | } |
Dmitri Shuralyov | 01fd299 | 2019-09-09 16:48:08 -0400 | [diff] [blame] | 639 | |
| 640 | func TestShouldTestPackageInGOPATHMode(t *testing.T) { |
| 641 | // This function doesn't change behavior depending on the builder |
| 642 | // at this time, so just use a common one. |
| 643 | bc, ok := Builders["linux-amd64"] |
| 644 | if !ok { |
| 645 | t.Fatal("unknown builder") |
| 646 | } |
| 647 | |
| 648 | tests := []struct { |
| 649 | importPath string |
| 650 | want bool |
| 651 | }{ |
| 652 | {"golang.org/x/image/bmp", true}, |
| 653 | {"golang.org/x/tools/go/ast/astutil", true}, |
| 654 | {"golang.org/x/tools/go/packages", true}, |
| 655 | {"golang.org/x/tools", true}, // Three isn't a package there, but if there was, it should be tested. |
| 656 | {"golang.org/x/tools/gopls", false}, |
| 657 | {"golang.org/x/tools/gopls/internal/foobar", false}, |
| 658 | } |
| 659 | for _, tt := range tests { |
| 660 | got := bc.ShouldTestPackageInGOPATHMode(tt.importPath) |
| 661 | if got != tt.want { |
| 662 | t.Errorf("ShouldTestPackageInGOPATHMode(%q) = %v; want %v", tt.importPath, got, tt.want) |
| 663 | } |
| 664 | } |
| 665 | } |
Brad Fitzpatrick | aab8504 | 2019-10-16 06:02:29 +0000 | [diff] [blame] | 666 | |
| 667 | func TestSlowBotAliases(t *testing.T) { |
| 668 | for term, name := range slowBotAliases { |
| 669 | if name == "" { |
| 670 | // Empty string means known missing builder. |
| 671 | continue |
| 672 | } |
| 673 | if _, ok := Builders[name]; !ok { |
| 674 | t.Errorf("slowbot term %q references unknown builder %q", term, name) |
| 675 | } |
| 676 | } |
| 677 | |
| 678 | out, err := exec.Command(filepath.Join(runtime.GOROOT(), "bin", "go"), "tool", "dist", "list").Output() |
| 679 | if err != nil { |
| 680 | t.Errorf("dist list: %v", err) |
| 681 | } |
| 682 | ports := strings.Fields(string(out)) |
| 683 | |
| 684 | done := map[string]bool{} |
| 685 | var add bytes.Buffer |
| 686 | check := func(term string, isArch bool) { |
| 687 | if done[term] { |
| 688 | return |
| 689 | } |
| 690 | done[term] = true |
| 691 | _, isBuilderName := Builders[term] |
| 692 | _, hasAlias := slowBotAliases[term] |
| 693 | if !isBuilderName && !hasAlias { |
| 694 | prefix := term |
| 695 | if isArch { |
| 696 | prefix = "linux-" + term |
| 697 | } |
| 698 | var matches []string |
| 699 | for name := range Builders { |
| 700 | if strings.HasPrefix(name, prefix) { |
| 701 | matches = append(matches, name) |
| 702 | } |
| 703 | } |
| 704 | sort.Strings(matches) |
| 705 | t.Errorf("term %q has no match in slowBotAliases", term) |
| 706 | if len(matches) == 1 { |
| 707 | fmt.Fprintf(&add, "%q: %q,\n", term, matches[0]) |
| 708 | } else if len(matches) > 1 { |
| 709 | t.Errorf("maybe add: %q: %q, (matches=%q)", term, matches[len(matches)-1], matches) |
| 710 | } |
| 711 | } |
| 712 | } |
| 713 | |
| 714 | for _, port := range ports { |
| 715 | slash := strings.IndexByte(port, '/') |
| 716 | if slash == -1 { |
| 717 | t.Fatalf("unexpected port %q", port) |
| 718 | } |
| 719 | goos, goarch := port[:slash], port[slash+1:] |
| 720 | check(goos+"-"+goarch, false) |
| 721 | check(goos, false) |
| 722 | check(goarch, true) |
| 723 | } |
| 724 | |
| 725 | if add.Len() > 0 { |
| 726 | t.Errorf("Missing items from slowBotAliases:\n%s", add.String()) |
| 727 | } |
| 728 | } |
Brad Fitzpatrick | ad7af46 | 2019-10-19 02:49:53 +0000 | [diff] [blame] | 729 | |
| 730 | func TestCrossCompileConfigs(t *testing.T) { |
| 731 | // Verify that Builders.CrossCompileConfig have valid host types. |
| 732 | for name, bc := range Builders { |
| 733 | cc := bc.CrossCompileConfig |
| 734 | if cc == nil { |
| 735 | continue |
| 736 | } |
| 737 | if _, ok := Hosts[cc.CompileHostType]; !ok { |
| 738 | t.Errorf("unknown host type %q for builder %q", cc.CompileHostType, name) |
| 739 | } |
| 740 | } |
| 741 | } |