mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
cmd/swarm: use same cluster across ACT and SwarmUp tests
This commit is contained in:
parent
3722447fae
commit
eb0c5cf630
3 changed files with 19 additions and 14 deletions
|
|
@ -28,7 +28,9 @@ import (
|
|||
gorand "math/rand"
|
||||
"net/http"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
|
|
@ -48,11 +50,24 @@ const (
|
|||
|
||||
var DefaultCurve = crypto.S256()
|
||||
|
||||
var cluster *testCluster
|
||||
|
||||
const clusterSize = 3
|
||||
|
||||
var clusteronce sync.Once
|
||||
var cluster *testCluster
|
||||
|
||||
func initCluster(t *testing.T) {
|
||||
clusteronce.Do(func() {
|
||||
cluster = newTestCluster(t, clusterSize)
|
||||
})
|
||||
}
|
||||
|
||||
func TestACT(t *testing.T) {
|
||||
if runtime.GOOS == "windows" {
|
||||
t.Skip()
|
||||
}
|
||||
|
||||
initCluster(t)
|
||||
|
||||
cases := []struct {
|
||||
name string
|
||||
f func(t *testing.T)
|
||||
|
|
@ -63,9 +78,6 @@ func TestACT(t *testing.T) {
|
|||
{"ACTWithBogus", testACTWithBogus},
|
||||
}
|
||||
|
||||
cluster = newTestCluster(t, clusterSize)
|
||||
defer cluster.Shutdown()
|
||||
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, tc.f)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,14 +29,8 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
colorable "github.com/mattn/go-colorable"
|
||||
)
|
||||
|
||||
func init() {
|
||||
log.PrintOrigins(true)
|
||||
log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(*loglevel), log.StreamHandler(colorable.NewColorableStderr(), log.TerminalFormat(true))))
|
||||
}
|
||||
|
||||
type testFile struct {
|
||||
filePath string
|
||||
content string
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ func TestSwarmUp(t *testing.T) {
|
|||
t.Skip()
|
||||
}
|
||||
|
||||
initCluster(t)
|
||||
|
||||
cases := []struct {
|
||||
name string
|
||||
f func(t *testing.T)
|
||||
|
|
@ -57,9 +59,6 @@ func TestSwarmUp(t *testing.T) {
|
|||
{"DefaultPathAll", testDefaultPathAll},
|
||||
}
|
||||
|
||||
cluster = newTestCluster(t, clusterSize)
|
||||
defer cluster.Shutdown()
|
||||
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, tc.f)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue