mirror of
https://github.com/golang/go
synced 2024-11-20 09:44:45 -07:00
abb2aa2085
$GOTESTONLY controls which set of tests gets run. Only "std" is supported. This should bring the time of plan9 builder down from 90 minutes to a maybe 10-15 minutes when running on GCE. (Plan 9 has performance problems when running on GCE, and/or with the os/exec package) This is a temporary workaround for one builder. The other Plan 9 builders will continue to do full builds. The plan9 buidler will be renamed plan9-386-gcepartial or something to indicate it's not running the 'test/*' directory, or API tests. Go on Plan 9 has bigger problems for now. This lets us get trybots going sooner including Plan 9, without waiting 90+ minutes. Update #9491 Change-Id: Ic505e9169c6b304ed4029b7bdfb77bb5c8fa8daa Reviewed-on: https://go-review.googlesource.com/2522 Reviewed-by: Rob Pike <r@golang.org>
74 lines
1.8 KiB
Bash
Executable File
74 lines
1.8 KiB
Bash
Executable File
#!/bin/rc -e
|
|
# Copyright 2012 The Go Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style
|
|
# license that can be found in the LICENSE file.
|
|
|
|
rfork e
|
|
|
|
eval `{go env}
|
|
|
|
GOPATH = () # we disallow local import for non-local packages, if $GOROOT happens
|
|
# to be under $GOPATH, then some tests below will fail
|
|
|
|
# allow all.rc to avoid double-build of everything
|
|
rebuild = true
|
|
if(~ $1 --no-rebuild)
|
|
shift
|
|
if not {
|
|
# Run only one process at a time on 9vx.
|
|
if(~ $sysname vx32)
|
|
pflag = (-p 1)
|
|
echo '# Building packages and commands.'
|
|
time go install -a -v $pflag std
|
|
echo
|
|
}
|
|
|
|
# we must unset GOROOT_FINAL before tests, because runtime/debug requires
|
|
# correct access to source code, so if we have GOROOT_FINAL in effect,
|
|
# at least runtime/debug test will fail.
|
|
GOROOT_FINAL = ()
|
|
|
|
echo '# Testing packages.'
|
|
time go test std -short -timeout 240s
|
|
echo
|
|
|
|
# Temporary GCE builder hack until Plan 9 on GCE is fast enough.
|
|
# See https://golang.org/issue/9491
|
|
if(~ $GOTESTONLY std) {
|
|
echo
|
|
echo PARTIAL TESTS PASSED: std
|
|
exit
|
|
}
|
|
|
|
# We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code,
|
|
# creation of first goroutines and first garbage collections in the parallel setting.
|
|
# TODO(bradfitz,0intro): make this not be 15 minutes once Plan 9 runs quickly on GCE.
|
|
# Linux does 63 seconds on GCE, but Plan 9 was failing with 8 minutes.
|
|
# See issue 8393 and 9491.
|
|
# TODO(bradfitz,0intro): remove -v once we see some a successful build.
|
|
echo '# GOMAXPROCS=2 runtime -cpu=1,2,4'
|
|
GOMAXPROCS=2 go test runtime -v -short -timeout 15m -cpu 1,2,4
|
|
echo
|
|
|
|
echo '# sync -cpu=10'
|
|
go test sync -short -timeout 120s -cpu 10
|
|
echo
|
|
|
|
fn xcd {
|
|
echo
|
|
echo '#' $1
|
|
cd $"GOROOT/src/$1
|
|
}
|
|
|
|
echo
|
|
echo '#' ../test/bench/go1
|
|
go test ../test/bench/go1
|
|
|
|
@{
|
|
xcd ../test
|
|
GOMAXPROCS='' time go run run.go -v
|
|
}
|
|
|
|
echo
|
|
echo ALL TESTS PASSED
|