Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Remove dependency on travis package from go-libp2p-testing #569

Merged
merged 1 commit into from
Jul 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions bitswap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"context"
"fmt"
"os"
"sync"
"testing"
"time"
Expand All @@ -25,10 +26,14 @@ import (
ipld "github.com/ipfs/go-ipld-format"
peer "github.com/libp2p/go-libp2p-core/peer"
p2ptestutil "github.com/libp2p/go-libp2p-netutil"
travis "github.com/libp2p/go-libp2p-testing/ci/travis"
tu "github.com/libp2p/go-libp2p-testing/etc"
)

func isCI() bool {
// https://github.blog/changelog/2020-04-15-github-actions-sets-the-ci-environment-variable-to-true/
return os.Getenv("CI") != ""
}

// FIXME the tests are really sensitive to the network delay. fix them to work
// well under varying conditions
const kNetworkDelay = 0 * time.Millisecond
Expand Down Expand Up @@ -248,7 +253,7 @@ func TestLargeSwarm(t *testing.T) {
// when running with the race detector, 500 instances launches
// well over 8k goroutines. This hits a race detector limit.
numInstances = 20
} else if travis.IsRunning() {
} else if isCI() {
numInstances = 200
} else {
t.Parallel()
Expand All @@ -261,7 +266,7 @@ func TestLargeFile(t *testing.T) {
t.SkipNow()
}

if !travis.IsRunning() {
if !isCI() {
t.Parallel()
}

Expand Down