diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-05-07 15:40:13 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-05-07 15:41:50 +0200 |
| commit | 6c70a1c220c1011a5b0d6e612dcb67d6dc36e80a (patch) | |
| tree | 63912998f08cd4579addb29a5e576f14a11dc235 | |
| parent | 413b991c26fa3ffadb04c4fe199dc3d1e1560232 (diff) | |
all: replace TRAVIS env var with CI
In preparation to running some tests as github actions.
Both Travis and Github define CI env var, while TRAVIS is, well,
too Travis-specific.
Update #1699
| -rw-r--r-- | Makefile | 6 | ||||
| -rw-r--r-- | pkg/csource/csource_test.go | 4 | ||||
| -rw-r--r-- | pkg/ifuzz/ifuzz_test.go | 2 | ||||
| -rw-r--r-- | pkg/ipc/ipc_test.go | 2 | ||||
| -rw-r--r-- | pkg/repro/repro_test.go | 2 | ||||
| -rw-r--r-- | prog/export_test.go | 2 | ||||
| -rw-r--r-- | sys/targets/targets.go | 2 |
7 files changed, 10 insertions, 10 deletions
@@ -24,7 +24,7 @@ define newline endef -ENV := $(subst \n,$(newline),$(shell TRAVIS=$(TRAVIS)\ +ENV := $(subst \n,$(newline),$(shell CI=$(CI)\ SOURCEDIR=$(SOURCEDIR) HOSTOS=$(HOSTOS) HOSTARCH=$(HOSTARCH) \ TARGETOS=$(TARGETOS) TARGETARCH=$(TARGETARCH) TARGETVMARCH=$(TARGETVMARCH) \ go run tools/syz-env/env.go)) @@ -334,8 +334,8 @@ presubmit: descriptions presubmit_parallel: test test_race arch test: descriptions -ifeq ("$(TRAVIS)$(shell go version | grep 1.13)", "true") - # Collect coverage report for codecov.io when testing Go 1.14 on travis (uploaded in .travis.yml). +ifeq ("$(CI)$(shell go version | grep 1.13)", "true") + # Collect coverage report for codecov.io when testing Go 1.14 on CI (uploaded in .travis.yml). env CGO_ENABLED=1 $(GO) test -short -coverprofile=coverage.txt ./... else # Executor tests use cgo. diff --git a/pkg/csource/csource_test.go b/pkg/csource/csource_test.go index 32ff9da28..d97833998 100644 --- a/pkg/csource/csource_test.go +++ b/pkg/csource/csource_test.go @@ -57,7 +57,7 @@ var executorOpts = Options{ func testTarget(t *testing.T, target *prog.Target, full bool) { seed := time.Now().UnixNano() - if os.Getenv("TRAVIS") != "" { + if os.Getenv( "CI") != "" { seed = 0 // required for deterministic coverage reports } rs := rand.NewSource(seed) @@ -98,7 +98,7 @@ func testOne(t *testing.T, p *prog.Prog, opts Options) { // Frequently lots of tests fail at the same, which produces/tmp/log // tens of thounds of lines of output. Limit amount of output. maxFailures := uint32(10) - if os.Getenv("TRAVIS") != "" { + if os.Getenv( "CI") != "" { maxFailures = 1 } if atomic.LoadUint32(&failedTests) > maxFailures { diff --git a/pkg/ifuzz/ifuzz_test.go b/pkg/ifuzz/ifuzz_test.go index 5a9af21c6..90ca2a440 100644 --- a/pkg/ifuzz/ifuzz_test.go +++ b/pkg/ifuzz/ifuzz_test.go @@ -37,7 +37,7 @@ func TestMode(t *testing.T) { func TestDecode(t *testing.T) { seed := time.Now().UnixNano() - if os.Getenv("TRAVIS") != "" { + if os.Getenv("CI") != "" { seed = 0 // required for deterministic coverage reports } t.Logf("seed=%v", seed) diff --git a/pkg/ipc/ipc_test.go b/pkg/ipc/ipc_test.go index 64632a98c..52e5ea7ab 100644 --- a/pkg/ipc/ipc_test.go +++ b/pkg/ipc/ipc_test.go @@ -38,7 +38,7 @@ func initTest(t *testing.T) (*prog.Target, rand.Source, int, bool, bool) { iters = 10 } seed := time.Now().UnixNano() - if os.Getenv("TRAVIS") != "" { + if os.Getenv( "CI") != "" { seed = 0 // required for deterministic coverage reports } rs := rand.NewSource(seed) diff --git a/pkg/repro/repro_test.go b/pkg/repro/repro_test.go index 37a938313..7cca35370 100644 --- a/pkg/repro/repro_test.go +++ b/pkg/repro/repro_test.go @@ -19,7 +19,7 @@ func initTest(t *testing.T) (*rand.Rand, int) { iters = 100 } seed := time.Now().UnixNano() - if os.Getenv("TRAVIS") != "" { + if os.Getenv( "CI") != "" { seed = 0 // required for deterministic coverage reports } rs := rand.NewSource(seed) diff --git a/prog/export_test.go b/prog/export_test.go index a6cdf358e..617c982a9 100644 --- a/prog/export_test.go +++ b/prog/export_test.go @@ -25,7 +25,7 @@ var ( func randSource(t *testing.T) rand.Source { seed := time.Now().UnixNano() - if os.Getenv("TRAVIS") != "" { + if os.Getenv( "CI") != "" { seed = 0 // required for deterministic coverage reports } t.Logf("seed=%v", seed) diff --git a/sys/targets/targets.go b/sys/targets/targets.go index e9450809d..61b5d298f 100644 --- a/sys/targets/targets.go +++ b/sys/targets/targets.go @@ -547,7 +547,7 @@ func checkFlagSupported(target *Target, flag string) bool { return cmd.Run() == nil } -var runningOnCI = os.Getenv("TRAVIS") != "" +var runningOnCI = os.Getenv( "CI") != "" // <algorithm> is included by executor, so we test is as well. const simpleProg = ` |
