some fixes for ci/notci

This commit is contained in:
херетик
2023-06-15 15:29:24 +01:00
parent ba1e877064
commit dbd32c2b29
6 changed files with 40 additions and 36 deletions

View File

@@ -5,7 +5,6 @@ import (
"github.com/docker/docker/client"
"github.com/indra-labs/indra"
"github.com/indra-labs/indra/pkg/docker"
"github.com/indra-labs/indra/pkg/proc/app"
"github.com/indra-labs/indra/pkg/proc/cmds"

View File

@@ -2,6 +2,10 @@ package dispatcher
import (
"context"
"math/big"
"sync"
"time"
"github.com/VividCortex/ewma"
"github.com/gookit/color"
"github.com/indra-labs/indra/pkg/crypto"
@@ -17,9 +21,6 @@ import (
"github.com/indra-labs/indra/pkg/util/splice"
"github.com/libp2p/go-libp2p/p2p/protocol/ping"
"go.uber.org/atomic"
"math/big"
"sync"
"time"
)
const (
@@ -641,7 +642,7 @@ func NewDispatcher(l *transport.Conn, ctx context.Context,
d.rekeying.Store(false)
d.ip = blue(d.Conn.RemoteMultiaddr())
var e error
prk := d.Conn.LocalPrivateKey()
prk := d.Conn.RemotePublicKey()
var rprk slice.Bytes
if rprk, e = prk.Raw(); fails(e) {
return

View File

@@ -2,14 +2,15 @@ package dispatcher
import (
"context"
"os"
"testing"
"time"
"github.com/indra-labs/indra"
"github.com/indra-labs/indra/pkg/engine"
"github.com/indra-labs/indra/pkg/onions/confirmation"
"github.com/indra-labs/indra/pkg/onions/ont"
"github.com/indra-labs/indra/pkg/onions/response"
"os"
"testing"
"time"
"github.com/indra-labs/indra/pkg/util/slice"
"github.com/indra-labs/indra/pkg/util/splice"
@@ -23,6 +24,7 @@ import (
)
func TestDispatcher(t *testing.T) {
t.Log(indra.CI)
if indra.CI=="false" {
log2.SetLogLevel(log2.Trace)
log.D.Ln("debug")

View File

@@ -4,6 +4,8 @@ import (
"context"
"errors"
"fmt"
"reflect"
"github.com/indra-labs/indra/pkg/ad"
"github.com/indra-labs/indra/pkg/onions/adaddress"
"github.com/indra-labs/indra/pkg/onions/adintro"
@@ -13,17 +15,18 @@ import (
"github.com/indra-labs/indra/pkg/onions/reg"
"github.com/indra-labs/indra/pkg/util/splice"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"reflect"
)
func (ng *Engine) SendAd(a ad.Ad) (e error) {
return ng.topic.Publish(ng.ctx, ont.Encode(a).GetAll())
}
func (ng *Engine) RunAdHandler(handler func(p *pubsub.Message, ctx context.Context) (e error)) {
// Since the frequency of updates should be around 1 hour we run here only one
// thread here. Relays indicate their loading as part of the response message
// protocol for ranking in the session cache.
func (ng *Engine) RunAdHandler(handler func(p *pubsub.Message,
ctx context.Context) (e error)) {
// Since the frequency of updates should be around 1 hour we run here only
// one thread here. Relays indicate their loading as part of the response
// message protocol for ranking in the session cache.
go func(ng *Engine) {
out:
for {

View File

@@ -1,7 +1,8 @@
package adpeer
import (
"fmt"
"testing"
"github.com/indra-labs/indra"
"github.com/indra-labs/indra/pkg/crypto"
"github.com/indra-labs/indra/pkg/crypto/nonce"
@@ -9,13 +10,11 @@ import (
"github.com/indra-labs/indra/pkg/onions/reg"
log2 "github.com/indra-labs/indra/pkg/proc/log"
"github.com/indra-labs/indra/pkg/util/splice"
"testing"
)
func TestPeerAd(t *testing.T) {
if indra.CI != "false" {
log2.SetLogLevel(log2.Trace)
fmt.Println("logging")
}
var e error
pr, ks, _ := crypto.NewSigner()

View File

@@ -34,7 +34,7 @@ const (
Patch = 14
)
var CI = "false"
var CI = "true"
// Version returns a pretty printed version information string.
func Version() string {