From 1a2401a8161c43e9d9fb0d1b3737195fcb48d56f Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Mon, 9 Dec 2019 16:49:46 +0100 Subject: [PATCH] Add short tests License: MIT Signed-off-by: Jakub Sztandera --- .circleci/config.yml | 10 +++++++--- lib/sectorbuilder/sectorbuilder_test.go | 9 +++++++++ node/node_test.go | 3 +++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1ad761862..c5bdeaa1b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -76,7 +76,7 @@ jobs: - store_artifacts: path: lotus-storage-miner - test: + test: &test description: | Run tests with gotestsum. parameters: @@ -154,6 +154,9 @@ jobs: - "~/go/src/github.com" - "~/go/src/golang.org" + test-short: + <<: *test + build_macos: description: build darwin lotus binary macos: @@ -254,8 +257,9 @@ workflows: jobs: - lint-changes: args: "--new-from-rev origin/master" - - test: - codecov-upload: true + - test + - test-short: + go-test-flags: "--timeout 10m --short" - mod-tidy-check - build-all - build_macos: diff --git a/lib/sectorbuilder/sectorbuilder_test.go b/lib/sectorbuilder/sectorbuilder_test.go index 13c80f0fc..5aa03b447 100644 --- a/lib/sectorbuilder/sectorbuilder_test.go +++ b/lib/sectorbuilder/sectorbuilder_test.go @@ -124,6 +124,9 @@ func post(t *testing.T, sb *sectorbuilder.SectorBuilder, seals ...seal) time.Tim } func TestSealAndVerify(t *testing.T) { + if testing.Short() { + t.Skip("skipping test in short mode") + } if runtime.NumCPU() < 10 && os.Getenv("CI") == "" { // don't bother on slow hardware t.Skip("this is slow") } @@ -193,6 +196,9 @@ func TestSealAndVerify(t *testing.T) { } func TestSealPoStNoCommit(t *testing.T) { + if testing.Short() { + t.Skip("skipping test in short mode") + } if runtime.NumCPU() < 10 && os.Getenv("CI") == "" { // don't bother on slow hardware t.Skip("this is slow") } @@ -259,6 +265,9 @@ func TestSealPoStNoCommit(t *testing.T) { } func TestSealAndVerify2(t *testing.T) { + if testing.Short() { + t.Skip("skipping test in short mode") + } if runtime.NumCPU() < 10 && os.Getenv("CI") == "" { // don't bother on slow hardware t.Skip("this is slow") } diff --git a/node/node_test.go b/node/node_test.go index 28d66a013..0fe2ac7f9 100644 --- a/node/node_test.go +++ b/node/node_test.go @@ -292,5 +292,8 @@ func TestAPIRPC(t *testing.T) { } func TestAPIDealFlow(t *testing.T) { + if testing.Short() { + t.Skip("skipping test in short mode") + } test.TestDealFlow(t, builder) }