aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml2
-rw-r--r--core/consensus_test.go5
-rw-r--r--core/utils.go12
3 files changed, 17 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml
index faf9a24..e6f62f5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,7 +16,7 @@ script:
- dep ensure -v
- make dep
- |
- if [ "${TRAVIS_BRANCH}" == "master" ]; then
+ if [ "${TRAVIS_PULL_REQUEST_BRANCH}" == "" ] && [ "${TRAVIS_BRANCH}" == "master" ]; then
make test
else
make test-short
diff --git a/core/consensus_test.go b/core/consensus_test.go
index 65f4e36..5fb804b 100644
--- a/core/consensus_test.go
+++ b/core/consensus_test.go
@@ -533,6 +533,9 @@ func (s *ConsensusTestSuite) TestDKGCRS() {
n = 7
lambda = 100 * time.Millisecond
}
+ if isTravisCI() {
+ lambda *= 5
+ }
conn := s.newNetworkConnection()
prvKeys, pubKeys, err := test.NewKeys(n)
s.Require().NoError(err)
@@ -549,7 +552,7 @@ func (s *ConsensusTestSuite) TestDKGCRS() {
con.cfgModule.registerDKG(uint64(0), n/3+1)
}
for _, con := range cons {
- con.runDKG(0, gov.Configuration(0))
+ go con.runDKG(0, gov.Configuration(0))
}
for _, con := range cons {
func() {
diff --git a/core/utils.go b/core/utils.go
index bc5e336..2ef2437 100644
--- a/core/utils.go
+++ b/core/utils.go
@@ -219,3 +219,15 @@ func DiffUint64(a, b uint64) uint64 {
}
return b - a
}
+
+func isCI() bool {
+ return os.Getenv("CI") != ""
+}
+
+func isCircleCI() bool {
+ return isCI() && os.Getenv("CIRCLECI") == "true"
+}
+
+func isTravisCI() bool {
+ return isCI() && os.Getenv("TRAVIS") == "true"
+}