created helper to enable tracing if not running in CI
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
package addresses
|
||||
|
||||
import (
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/reg"
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto"
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto/nonce"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/splice"
|
||||
"github.com/multiformats/go-multiaddr"
|
||||
"testing"
|
||||
@@ -14,9 +13,7 @@ import (
|
||||
)
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Trace)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
var e error
|
||||
pr, _, _ := crypto.NewSigner()
|
||||
id := nonce.NewID()
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
package intro
|
||||
|
||||
import (
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/reg"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/splice"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto"
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto/nonce"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
)
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Trace)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
var e error
|
||||
pr, ks, _ := crypto.NewSigner()
|
||||
introducer := ks.Next()
|
||||
|
||||
@@ -2,21 +2,18 @@ package load
|
||||
|
||||
import (
|
||||
"git.indra-labs.org/dev/ind/pkg/codec"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/reg"
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto"
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto/nonce"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/splice"
|
||||
)
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Trace)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
var e error
|
||||
pr, _, _ := crypto.NewSigner()
|
||||
id := nonce.NewID()
|
||||
|
||||
@@ -2,21 +2,18 @@ package peer
|
||||
|
||||
import (
|
||||
"git.indra-labs.org/dev/ind/pkg/codec"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/reg"
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto"
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto/nonce"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/splice"
|
||||
)
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Trace)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
var e error
|
||||
pr, _, _ := crypto.NewSigner()
|
||||
id := nonce.NewID()
|
||||
|
||||
@@ -1,25 +1,23 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/reg"
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto"
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto/nonce"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/splice"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestServiceAd(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Trace)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
var e error
|
||||
pr, _, _ := crypto.NewSigner()
|
||||
id := nonce.NewID()
|
||||
sv := New(id, pr, []Service{{80, 62346}, {443, 42216}}, time.Now().Add(time.Hour))
|
||||
sv := New(id, pr, []Service{{80, 62346}, {443, 42216}},
|
||||
time.Now().Add(time.Hour))
|
||||
log.D.S("service", sv)
|
||||
s := splice.New(sv.Len())
|
||||
if e = sv.Encode(s); fails(e) {
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
package balance
|
||||
|
||||
import (
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/ont"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/reg"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"testing"
|
||||
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto/nonce"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
)
|
||||
|
||||
func TestOnions_Balance(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Debug)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
id := nonce.NewID()
|
||||
sats := lnwire.MilliSatoshi(10000)
|
||||
on := ont.Assemble([]ont.Onion{New(id, sats)})
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
package confirmation
|
||||
|
||||
import (
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/ont"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/reg"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"testing"
|
||||
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto/nonce"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
)
|
||||
|
||||
func TestOnions_Confirmation(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Debug)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
id := nonce.NewID()
|
||||
on := ont.Assemble([]ont.Onion{New(id)})
|
||||
s := codec.Encode(on)
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
package crypt
|
||||
|
||||
import (
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/onion/cores/confirmation"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/ont"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/reg"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"testing"
|
||||
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto"
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto/nonce"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
)
|
||||
|
||||
func TestOnions_SimpleCrypt(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Debug)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
var e error
|
||||
n := nonce.NewID()
|
||||
n1 := nonce.New()
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
package delay
|
||||
|
||||
import (
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/ont"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/reg"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
)
|
||||
|
||||
func TestOnions_Delay(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Debug)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
dur := time.Second
|
||||
on := ont.Assemble([]ont.Onion{New(dur)})
|
||||
s := codec.Encode(on)
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package forward
|
||||
|
||||
import (
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/ont"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/reg"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/multi"
|
||||
"github.com/multiformats/go-multiaddr"
|
||||
"math/rand"
|
||||
@@ -18,9 +17,7 @@ import (
|
||||
)
|
||||
|
||||
func TestOnions_Forward(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Trace)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
ipSizes := []int{net.IPv6len, net.IPv4len}
|
||||
for i := range ipSizes {
|
||||
n := nonce.New()
|
||||
|
||||
@@ -1,25 +1,21 @@
|
||||
package introquery
|
||||
|
||||
import (
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/onion/cores/end"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/onion/exit"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/ont"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/reg"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"testing"
|
||||
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto"
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto/nonce"
|
||||
"git.indra-labs.org/dev/ind/pkg/engine/sessions"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
)
|
||||
|
||||
func TestOnions_IntroQuery(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Trace)
|
||||
}
|
||||
log2.App.Store("")
|
||||
ci.TraceIfNot()
|
||||
var e error
|
||||
prvs, pubs := crypto.GetCipherSet()
|
||||
ciphers := crypto.GenCiphers(prvs, pubs)
|
||||
|
||||
@@ -4,7 +4,6 @@ package services
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec"
|
||||
intro "git.indra-labs.org/dev/ind/pkg/codec/ad/intro"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/onion/exit"
|
||||
@@ -17,17 +16,13 @@ import (
|
||||
"git.indra-labs.org/dev/ind/pkg/engine/sessions"
|
||||
"git.indra-labs.org/dev/ind/pkg/engine/transport"
|
||||
headers2 "git.indra-labs.org/dev/ind/pkg/headers"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/slice"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestOnions_HiddenService(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
t.Log("ci not enabled")
|
||||
log2.SetLogLevel(log2.Trace)
|
||||
}
|
||||
ci.TraceIfNotCI()
|
||||
var e error
|
||||
n3 := crypto.Gen3Nonces()
|
||||
id := nonce.NewID()
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package reverse
|
||||
|
||||
import (
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/ont"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/reg"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/multi"
|
||||
"github.com/multiformats/go-multiaddr"
|
||||
"math/rand"
|
||||
@@ -18,9 +17,7 @@ import (
|
||||
)
|
||||
|
||||
func TestOnions_Reverse(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Trace)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
ipSizes := []int{net.IPv4len, net.IPv6len}
|
||||
for i := range ipSizes {
|
||||
n := nonce.New()
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
package session
|
||||
|
||||
import (
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/reg"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"testing"
|
||||
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
)
|
||||
|
||||
func TestOnions_Session(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Debug)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
sess := New(1)
|
||||
ss := sess.(*Session)
|
||||
s := codec.Encode(sess)
|
||||
|
||||
@@ -2,17 +2,14 @@ package crypto
|
||||
|
||||
import (
|
||||
rand2 "crypto/rand"
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"testing"
|
||||
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto/sha256"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
)
|
||||
|
||||
func TestFromBased32(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Trace)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
var rBytes sha256.Hash
|
||||
var n int
|
||||
var e error
|
||||
@@ -28,7 +25,7 @@ func TestFromBased32(t *testing.T) {
|
||||
if s, e = Sign(pr, rBytes); fails(e) {
|
||||
t.FailNow()
|
||||
}
|
||||
//fmt.Println("sig", s)
|
||||
// fmt.Println("sig", s)
|
||||
var sb SigBytes
|
||||
if sb, e = SigFromBased32(s.String()); fails(e) {
|
||||
t.FailNow()
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
package crypto
|
||||
|
||||
import (
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"testing"
|
||||
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
)
|
||||
|
||||
func TestBase32(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Debug)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
for i := 0; i < 10000; i++ {
|
||||
var k *Prv
|
||||
var e error
|
||||
@@ -21,7 +17,7 @@ func TestBase32(t *testing.T) {
|
||||
p := DerivePub(k)
|
||||
b32 := p.ToBased32()
|
||||
pr32 := k.ToBased32()
|
||||
//log.D.F("pub key: %d %s priv key: %d %s\n", len(b32), b32, len(pr32), pr32)
|
||||
// log.D.F("pub key: %d %s priv key: %d %s\n", len(b32), b32, len(pr32), pr32)
|
||||
var kk *Pub
|
||||
if kk, e = PubFromBased32(b32); fails(e) {
|
||||
t.Error(e)
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/onion/cores/confirmation"
|
||||
"git.indra-labs.org/dev/ind/pkg/codec/onion/cores/response"
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto/sha256"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -22,16 +23,12 @@ import (
|
||||
"git.indra-labs.org/dev/ind/pkg/engine/transport"
|
||||
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/tests"
|
||||
)
|
||||
|
||||
func TestDispatcher(t *testing.T) {
|
||||
t.Log(indra.CI)
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Trace)
|
||||
log.D.Ln("debug")
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
var e error
|
||||
var l1, l2 *transport.Listener
|
||||
_ = l2
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
///go:build failingtests
|
||||
// /go:build failingtests
|
||||
|
||||
package engine
|
||||
|
||||
//func TestEngine_Message(t *testing.T) {
|
||||
// if indra.CI == "false" {
|
||||
// log2.SetLogLevel(log2.Info)
|
||||
// }
|
||||
// func TestEngine_Message(t *testing.T) {
|
||||
// ci.TraceIfNot()
|
||||
// var clients []*Engine
|
||||
// var e error
|
||||
// const nCircuits = 10
|
||||
@@ -101,9 +99,7 @@ package engine
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
// if indra.CI == "false" {
|
||||
// log2.SetLogLevel(log2.Trace)
|
||||
// }
|
||||
// ci.TraceIfNot()
|
||||
// wg.Add(1)
|
||||
// counter.Inc()
|
||||
// svc := &services.Service{
|
||||
@@ -172,12 +168,10 @@ package engine
|
||||
// quit.Q()
|
||||
// cancel()
|
||||
// log.W.Ln("fin")
|
||||
//}
|
||||
// }
|
||||
|
||||
//func TestEngine_Route(t *testing.T) {
|
||||
// if indra.CI == "false" {
|
||||
// log2.SetLogLevel(log2.Debug)
|
||||
// }
|
||||
// func TestEngine_Route(t *testing.T) {
|
||||
// ci.TraceIfNot()
|
||||
// runtime.GOMAXPROCS(1)
|
||||
// var clients []*Engine
|
||||
// var e error
|
||||
@@ -293,9 +287,7 @@ package engine
|
||||
// })
|
||||
// wg.Wait()
|
||||
// time.Sleep(time.Second)
|
||||
// if indra.CI == "false" {
|
||||
// log2.SetLogLevel(log2.Debug)
|
||||
// }
|
||||
// ci.TraceIfNot()
|
||||
// wg.Add(1)
|
||||
// counter.Inc()
|
||||
// log.D.Ln("intro", ini.ID, ini.AddrPort.String(), ini.Key.ToBased32Abbreviated(),
|
||||
@@ -311,12 +303,10 @@ package engine
|
||||
// quit.Q()
|
||||
// cancel()
|
||||
// log.W.Ln("fin")
|
||||
//}
|
||||
// }
|
||||
|
||||
//func TestEngine_SendHiddenService(t *testing.T) {
|
||||
// if indra.CI == "false" {
|
||||
// log2.SetLogLevel(log2.Debug)
|
||||
// }
|
||||
// func TestEngine_SendHiddenService(t *testing.T) {
|
||||
// ci.TraceIfNot()
|
||||
// var clients []*Engine
|
||||
// var e error
|
||||
// const nCircuits = 10
|
||||
@@ -361,9 +351,7 @@ package engine
|
||||
// }
|
||||
// wg.Wait()
|
||||
// }
|
||||
// if indra.CI == "false" {
|
||||
// log2.SetLogLevel(log2.Debug)
|
||||
// }
|
||||
// ci.TraceIfNot()
|
||||
// var idPrv *crypto.Prv
|
||||
// if idPrv, e = crypto.GeneratePrvKey(); fails(e) {
|
||||
// return
|
||||
@@ -409,12 +397,10 @@ package engine
|
||||
// time.Sleep(time.Second)
|
||||
// quit.Q()
|
||||
// cancel()
|
||||
//}
|
||||
// }
|
||||
|
||||
//func TestDispatcher_Rekey(t *testing.T) {
|
||||
// if indra.CI == "false" {
|
||||
// log2.SetLogLevel(log2.Debug)
|
||||
// }
|
||||
// func TestDispatcher_Rekey(t *testing.T) {
|
||||
// ci.TraceIfNot()
|
||||
// var e error
|
||||
// var l1, l2 *transport.Listener
|
||||
// _ = l2
|
||||
@@ -512,12 +498,10 @@ package engine
|
||||
// if succ != countTo*3 {
|
||||
// t.Fatal("did not receive all messages correctly", succ, countTo*3)
|
||||
// }
|
||||
//}
|
||||
// }
|
||||
|
||||
//func TestClient_SendExit(t *testing.T) {
|
||||
// if indra.CI == "false" {
|
||||
// log2.SetLogLevel(log2.Debug)
|
||||
// }
|
||||
// func TestClient_SendExit(t *testing.T) {
|
||||
// ci.TraceIfNot()
|
||||
// var clients []*Engine
|
||||
// var e error
|
||||
// ctx, cancel := context.WithCancel(context.Background())
|
||||
@@ -557,7 +541,7 @@ package engine
|
||||
// quit.Q()
|
||||
// t.Error("Exit test failed")
|
||||
// }()
|
||||
//out:
|
||||
// out:
|
||||
// for i := 3; i < len(clients[0].Mgr().Sessions)-1; i++ {
|
||||
// wg.Add(1)
|
||||
// var msg slice.Bytes
|
||||
@@ -613,12 +597,10 @@ package engine
|
||||
// for _, v := range clients {
|
||||
// v.Shutdown()
|
||||
// }
|
||||
//}
|
||||
// }
|
||||
|
||||
//func TestClient_SendPing(t *testing.T) {
|
||||
// if indra.CI == "false" {
|
||||
// log2.SetLogLevel(log2.Debug)
|
||||
// }
|
||||
// func TestClient_SendPing(t *testing.T) {
|
||||
// ci.TraceIfNot()
|
||||
// var clients []*Engine
|
||||
// var e error
|
||||
// ctx, cancel := context.WithCancel(context.Background())
|
||||
@@ -642,7 +624,7 @@ package engine
|
||||
// quit.Q()
|
||||
// t.Error("SendPing test failed")
|
||||
// }()
|
||||
//out:
|
||||
// out:
|
||||
// for i := 3; i < len(clients[0].Mgr().Sessions)-1; i++ {
|
||||
// wg.Add(1)
|
||||
// var c sessions.Circuit
|
||||
@@ -666,12 +648,10 @@ package engine
|
||||
// for _, v := range clients {
|
||||
// v.Shutdown()
|
||||
// }
|
||||
//}
|
||||
// }
|
||||
|
||||
//func TestClient_SendSessionKeys(t *testing.T) {
|
||||
// if indra.CI == "false" {
|
||||
// log2.SetLogLevel(log2.Debug)
|
||||
// }
|
||||
// func TestClient_SendSessionKeys(t *testing.T) {
|
||||
// ci.TraceIfNot()
|
||||
// var clients []*Engine
|
||||
// var e error
|
||||
// ctx, cancel := context.WithCancel(context.Background())
|
||||
@@ -720,12 +700,10 @@ package engine
|
||||
// v.Shutdown()
|
||||
// }
|
||||
// cancel()
|
||||
//}
|
||||
// }
|
||||
|
||||
//func TestClient_SendGetBalance(t *testing.T) {
|
||||
// if indra.CI == "false" {
|
||||
// log2.SetLogLevel(log2.Trace)
|
||||
// }
|
||||
// func TestClient_SendGetBalance(t *testing.T) {
|
||||
// ci.TraceIfNot()
|
||||
// var clients []*Engine
|
||||
// var e error
|
||||
// ctx, cancel := context.WithCancel(context.Background())
|
||||
@@ -776,4 +754,4 @@ package engine
|
||||
// for _, v := range clients {
|
||||
// v.Shutdown()
|
||||
// }
|
||||
//}
|
||||
// }
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto/nonce"
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto/sha256"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/tests"
|
||||
"math/rand"
|
||||
"testing"
|
||||
@@ -75,9 +76,7 @@ func TestRemovePacket(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSplitJoin(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Debug)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
msgSize := 1 << 19
|
||||
segSize := 1382
|
||||
var e error
|
||||
@@ -137,9 +136,7 @@ func TestSplitJoin(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSplitJoinFEC(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Debug)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
msgSize := 1 << 18
|
||||
segSize := 1382
|
||||
var e error
|
||||
|
||||
@@ -2,8 +2,7 @@ package engine
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.indra-labs.org/dev/ind"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"github.com/dgraph-io/badger/v3"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -14,11 +13,8 @@ func pauza() {
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
|
||||
//
|
||||
// func TestEngine_PeerStore(t *testing.T) {
|
||||
// if indra.CI == "false" {
|
||||
// log2.SetLogLevel(log2.Trace)
|
||||
// }
|
||||
// ci.TraceIfNot()
|
||||
// const nTotal = 10
|
||||
// var e error
|
||||
// var engines []*Engine
|
||||
@@ -94,9 +90,7 @@ func pauza() {
|
||||
// }
|
||||
|
||||
func TestEngine_PeerStoreDiscovery(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Trace)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
const nTotal = 10
|
||||
var (
|
||||
e error
|
||||
@@ -117,9 +111,7 @@ func TestEngine_PeerStoreDiscovery(t *testing.T) {
|
||||
}
|
||||
}
|
||||
time.Sleep(time.Second * 3)
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Debug)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
var ec int
|
||||
entryCount := &ec
|
||||
for _, v := range engines {
|
||||
@@ -153,9 +145,7 @@ func TestEngine_PeerStoreDiscovery(t *testing.T) {
|
||||
t.Log("nodes did not gossip completely to each other, only",
|
||||
*entryCount, "nodes ad sets counted, not the expected",
|
||||
nTotal)
|
||||
if indra.CI == "false" {
|
||||
t.FailNow()
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
}
|
||||
cleanup()
|
||||
pauza()
|
||||
|
||||
@@ -3,21 +3,18 @@ package transport
|
||||
import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto/sha256"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"git.indra-labs.org/dev/ind/pkg/crypto"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/tests"
|
||||
)
|
||||
|
||||
func TestNewListener(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Trace)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
var e error
|
||||
var l1, l2 *Listener
|
||||
_ = l2
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"git.indra-labs.org/dev/ind/pkg/proc/cmds"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
)
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Debug)
|
||||
}
|
||||
|
||||
ci.TraceIfNot()
|
||||
args1 := "/random/path/to/server_binary --cafile ~/some/cafile --LC=cn node -addrindex --BD 48h30s"
|
||||
args1s := strings.Split(args1, " ")
|
||||
var a *App
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
package cmds
|
||||
|
||||
import (
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
)
|
||||
|
||||
func TestCommand_ParseCLIArgs(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Debug)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
ec := GetExampleCommands()
|
||||
o, _ := Init(ec, nil)
|
||||
args6 := "/random/path/to/server_binary --cafile ~/some/cafile --LC=cn " +
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package i32
|
||||
|
||||
import (
|
||||
indra "git.indra-labs.org/dev/ind"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -12,9 +12,7 @@ var (
|
||||
)
|
||||
|
||||
func TestS(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Trace)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
|
||||
t1, t2 := New(), New()
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package t64
|
||||
|
||||
import (
|
||||
indra "git.indra-labs.org/dev/ind"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
@@ -13,9 +13,7 @@ var (
|
||||
)
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Trace)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
|
||||
t1, t2 := New(), New()
|
||||
nao := time.Now()
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"git.indra-labs.org/dev/ind"
|
||||
"git.indra-labs.org/dev/ind/pkg/util/ci"
|
||||
"math/rand"
|
||||
"testing"
|
||||
|
||||
@@ -53,9 +54,7 @@ func TestCodec(t *testing.T) {
|
||||
}
|
||||
|
||||
generated += "}\n"
|
||||
if indra.CI == "false" {
|
||||
t.Log(generated)
|
||||
}
|
||||
ci.TraceIfNot()
|
||||
|
||||
expected := []string{
|
||||
"ee94d6cef460b180c995b2f8672e53006aced15fe4d5cc0da332d041feaa1514",
|
||||
|
||||
12
pkg/util/ci/trace.go
Normal file
12
pkg/util/ci/trace.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package ci
|
||||
|
||||
import (
|
||||
indra "git.indra-labs.org/dev/ind"
|
||||
log2 "git.indra-labs.org/dev/ind/pkg/proc/log"
|
||||
)
|
||||
|
||||
func TraceIfNot() {
|
||||
if indra.CI == "false" {
|
||||
log2.SetLogLevel(log2.Trace)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user