Skip to content

Commit 9a5f5f0

Browse files
committed
fix tests pipelines
1 parent 31731fe commit 9a5f5f0

File tree

9 files changed

+171
-82
lines changed

9 files changed

+171
-82
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
run: go mod download
3131

3232
- name: Run unit tests
33-
run: go test ./... -v
33+
run: go test $(go list ./... | grep -v '/tests') -v
3434

3535
integration-tests:
3636
name: integration-tests
32 KB
Binary file not shown.
52.3 KB
Binary file not shown.

pkg/net/credentials/alts/conn/record_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"reflect"
1111
"testing"
1212

13-
"github.com/LumeraProtocol/supernode/pkg/net/grpc/grpctest"
1413
. "github.com/LumeraProtocol/supernode/pkg/net/credentials/alts/common"
14+
"github.com/LumeraProtocol/supernode/pkg/net/grpc/grpctest"
1515
)
1616

1717
type s struct {
@@ -79,7 +79,7 @@ func newTestALTSRecordConn(in, out *bytes.Buffer, side Side, rp string, protecte
7979
if err != nil {
8080
panic(fmt.Sprintf("Unexpected error getting test key for protocol %q: %v", rp, err))
8181
}
82-
82+
8383
tc := testConn{
8484
in: in,
8585
out: out,

pkg/net/credentials/alts/conn/register.go

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package conn
22

33
import (
44
. "github.com/LumeraProtocol/supernode/pkg/net/credentials/alts/common"
5+
"sync"
56
)
67

78
func init() {
@@ -12,26 +13,30 @@ var (
1213
// ALTS record protocol names.
1314
ALTSRecordProtocols = make([]string, 0)
1415
)
16+
var registerOnce sync.Once
1517

1618
func RegisterALTSRecordProtocols() {
17-
altsRecordFuncs := map[string]ALTSRecordFunc{
18-
// ALTS handshaker protocols.
19-
RecordProtocolAESGCM: func(s Side, keyData []byte) (ALTSRecordCrypto, error) {
20-
return NewAES128GCM(s, keyData)
21-
},
22-
RecordProtocolAESGCMReKey: func(s Side, keyData []byte) (ALTSRecordCrypto, error) {
23-
return NewAES128GCMRekey(s, keyData)
24-
},
25-
RecordProtocolXChaCha20Poly1305ReKey: func(s Side, keyData []byte) (ALTSRecordCrypto, error) {
26-
return NewXChaCha20Poly1305ReKey(s, keyData)
27-
},
28-
}
29-
for protocol, f := range altsRecordFuncs {
30-
if err := RegisterProtocol(protocol, f); err != nil {
31-
panic(err)
19+
registerOnce.Do(func() {
20+
altsRecordFuncs := map[string]ALTSRecordFunc{
21+
// ALTS handshaker protocols.
22+
RecordProtocolAESGCM: func(s Side, keyData []byte) (ALTSRecordCrypto, error) {
23+
return NewAES128GCM(s, keyData)
24+
},
25+
RecordProtocolAESGCMReKey: func(s Side, keyData []byte) (ALTSRecordCrypto, error) {
26+
return NewAES128GCMRekey(s, keyData)
27+
},
28+
RecordProtocolXChaCha20Poly1305ReKey: func(s Side, keyData []byte) (ALTSRecordCrypto, error) {
29+
return NewXChaCha20Poly1305ReKey(s, keyData)
30+
},
3231
}
33-
ALTSRecordProtocols = append(ALTSRecordProtocols, protocol)
34-
}
32+
33+
for protocol, f := range altsRecordFuncs {
34+
if err := RegisterProtocol(protocol, f); err != nil {
35+
panic(err) // safe: this will only run once
36+
}
37+
ALTSRecordProtocols = append(ALTSRecordProtocols, protocol)
38+
}
39+
})
3540
}
3641

3742
func UnregisterALTSRecordProtocols() {

pkg/net/credentials/alts/handshake/handshake_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func init() {
3232
}
3333

3434
type hsInterceptor struct {
35-
ctrl *gomock.Controller
35+
ctrl *gomock.Controller
3636
ke *lumeraidmocks.MockKeyExchanger
3737
conn net.Conn
3838
hs *secureHandshaker
@@ -792,7 +792,7 @@ func TestDefaultReadResponsetWithTimeout_EmptyResult(t *testing.T) {
792792
ti := newHSServerInterceptor(t, nil)
793793
defer ti.cleanup()
794794

795-
ti.setHandshakeTimeout(100*time.Millisecond)
795+
ti.setHandshakeTimeout(100 * time.Millisecond)
796796
ti.overrideReceiveHandshakeMessage(func(conn net.Conn) ([]byte, []byte, error) {
797797
time.Sleep(200 * time.Millisecond) // Simulate slow response
798798
return []byte(""), nil, nil
@@ -958,4 +958,3 @@ func TestServerHandshake_ComputeSharedSecretFailure(t *testing.T) {
958958
require.Error(t, err)
959959
require.Contains(t, err.Error(), "failed to compute shared secret")
960960
}
961-

pkg/testutil/lumera.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package testutil
22

33
import (
44
"context"
5+
"github.com/LumeraProtocol/supernode/pkg/lumera/modules/action_msg"
56
"strconv"
67

78
"github.com/LumeraProtocol/supernode/gen/lumera/action/types"
@@ -30,6 +31,11 @@ type MockLumeraClient struct {
3031
addresses []string // Store node addresses for testing
3132
}
3233

34+
func (c *MockLumeraClient) ActionMsg() action_msg.Module {
35+
//TODO implement me
36+
panic("implement me")
37+
}
38+
3339
// NewMockLumeraClient creates a new mock Lumera client for testing
3440
func NewMockLumeraClient(kr keyring.Keyring, addresses []string) (lumera.Client, error) {
3541
actionMod := &MockActionModule{}
@@ -95,6 +101,11 @@ func (m *MockAuthModule) Verify(ctx context.Context, accAddress string, data, si
95101
// MockActionModule implements the action.Module interface for testing
96102
type MockActionModule struct{}
97103

104+
func (m *MockActionModule) GetParams(ctx context.Context) (*types.QueryParamsResponse, error) {
105+
//TODO implement me
106+
panic("implement me")
107+
}
108+
98109
func (m *MockActionModule) GetAction(ctx context.Context, actionID string) (*types.QueryGetActionResponse, error) {
99110
return &types.QueryGetActionResponse{}, nil
100111
}
@@ -108,6 +119,11 @@ type MockSupernodeModule struct {
108119
addresses []string
109120
}
110121

122+
func (m *MockSupernodeModule) GetParams(ctx context.Context) (*supernodeTypes.QueryParamsResponse, error) {
123+
//TODO implement me
124+
panic("implement me")
125+
}
126+
111127
func (m *MockSupernodeModule) GetTopSuperNodesForBlock(ctx context.Context, blockHeight uint64) (*supernodeTypes.QueryGetTopSuperNodesForBlockResponse, error) {
112128
// Create supernodes with the actual node addresses supplied in the test
113129
supernodes := make([]*supernodeTypes.SuperNode, 0, len(m.addresses))

tests/system/go.mod

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ replace github.com/LumeraProtocol/supernode/sdk => ../../sdk
88

99
require (
1010
github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect
11-
github.com/cosmos/cosmos-sdk v0.50.13
11+
github.com/cosmos/cosmos-sdk v0.53.0
1212
github.com/cosmos/gogogateway v1.2.0 // indirect
1313
github.com/cosmos/gogoproto v1.7.0 // indirect
1414
github.com/cosmos/iavl v1.2.2 // indirect
@@ -17,52 +17,52 @@ require (
1717
github.com/gorilla/mux v1.8.1 // indirect
1818
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
1919
github.com/pkg/errors v0.9.1 // indirect
20-
github.com/prometheus/client_golang v1.20.5 // indirect
20+
github.com/prometheus/client_golang v1.22.0 // indirect
2121
github.com/spf13/cast v1.7.1 // indirect
22-
github.com/spf13/cobra v1.8.1 // indirect
23-
github.com/spf13/pflag v1.0.5 // indirect
22+
github.com/spf13/cobra v1.9.1 // indirect
23+
github.com/spf13/pflag v1.0.6 // indirect
2424
github.com/stretchr/testify v1.10.0
2525
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
26-
google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect
27-
google.golang.org/grpc v1.71.0 // indirect
26+
google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect
27+
google.golang.org/grpc v1.72.0 // indirect
2828
)
2929

3030
require (
31-
cosmossdk.io/math v1.4.0
31+
cosmossdk.io/math v1.5.3
3232
github.com/LumeraProtocol/supernode v0.0.0-00010101000000-000000000000
3333
github.com/LumeraProtocol/supernode/sdk v0.0.0-00010101000000-000000000000
34-
github.com/cometbft/cometbft v0.38.15
34+
github.com/cometbft/cometbft v0.38.17
3535
github.com/tidwall/gjson v1.14.2
3636
github.com/tidwall/sjson v1.2.5
37-
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8
37+
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394
3838
lukechampine.com/blake3 v1.4.0
3939
)
4040

4141
require (
42-
cosmossdk.io/api v0.7.6 // indirect
43-
cosmossdk.io/collections v0.4.0 // indirect
44-
cosmossdk.io/core v0.11.1 // indirect
45-
cosmossdk.io/depinject v1.1.0 // indirect
46-
cosmossdk.io/errors v1.0.1 // indirect
47-
cosmossdk.io/log v1.4.1 // indirect
48-
cosmossdk.io/store v1.1.1 // indirect
49-
cosmossdk.io/x/tx v0.13.7 // indirect
42+
cosmossdk.io/api v0.9.2 // indirect
43+
cosmossdk.io/collections v1.2.0 // indirect
44+
cosmossdk.io/core v0.11.3 // indirect
45+
cosmossdk.io/depinject v1.2.0 // indirect
46+
cosmossdk.io/errors v1.0.2 // indirect
47+
cosmossdk.io/log v1.5.1 // indirect
48+
cosmossdk.io/store v1.1.2 // indirect
49+
cosmossdk.io/x/tx v0.14.0 // indirect
5050
filippo.io/edwards25519 v1.1.0 // indirect
5151
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
52-
github.com/99designs/keyring v1.2.1 // indirect
52+
github.com/99designs/keyring v1.2.2 // indirect
5353
github.com/DataDog/datadog-go v3.2.0+incompatible // indirect
54-
github.com/DataDog/zstd v1.5.5 // indirect
55-
github.com/LumeraProtocol/lumera v0.4.3 // indirect
54+
github.com/DataDog/zstd v1.5.7 // indirect
55+
github.com/LumeraProtocol/lumera v0.4.4 // indirect
5656
github.com/LumeraProtocol/rq-go v0.2.1 // indirect
5757
github.com/beorn7/perks v1.0.1 // indirect
58-
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
58+
github.com/bgentry/speakeasy v0.2.0 // indirect
5959
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
6060
github.com/cespare/xxhash/v2 v2.3.0 // indirect
6161
github.com/cockroachdb/errors v1.11.3 // indirect
6262
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect
6363
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
64-
github.com/cockroachdb/pebble v1.1.2 // indirect
65-
github.com/cockroachdb/redact v1.1.5 // indirect
64+
github.com/cockroachdb/pebble v1.1.5 // indirect
65+
github.com/cockroachdb/redact v1.1.6 // indirect
6666
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
6767
github.com/cometbft/cometbft-db v0.14.1 // indirect
6868
github.com/cosmos/btcutil v1.0.5 // indirect
@@ -72,16 +72,16 @@ require (
7272
github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect
7373
github.com/danieljoos/wincred v1.2.1 // indirect
7474
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
75-
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
75+
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
7676
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
7777
github.com/dgraph-io/badger/v4 v4.2.0 // indirect
7878
github.com/dgraph-io/ristretto v0.1.1 // indirect
79-
github.com/dgraph-io/ristretto/v2 v2.1.0 // indirect
79+
github.com/dgraph-io/ristretto/v2 v2.2.0 // indirect
8080
github.com/dustin/go-humanize v1.0.1 // indirect
8181
github.com/emicklei/dot v1.6.2 // indirect
82-
github.com/fatih/color v1.15.0 // indirect
82+
github.com/fatih/color v1.16.0 // indirect
8383
github.com/felixge/httpsnoop v1.0.4 // indirect
84-
github.com/fsnotify/fsnotify v1.7.0 // indirect
84+
github.com/fsnotify/fsnotify v1.9.0 // indirect
8585
github.com/getsentry/sentry-go v0.27.0 // indirect
8686
github.com/go-errors/errors v1.5.1 // indirect
8787
github.com/go-kit/kit v0.13.0 // indirect
@@ -95,38 +95,38 @@ require (
9595
github.com/golang/glog v1.2.4 // indirect
9696
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
9797
github.com/golang/mock v1.6.0 // indirect
98-
github.com/golang/snappy v0.0.4 // indirect
98+
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
9999
github.com/google/btree v1.1.3 // indirect
100100
github.com/google/flatbuffers v1.12.1 // indirect
101-
github.com/google/go-cmp v0.6.0 // indirect
101+
github.com/google/go-cmp v0.7.0 // indirect
102102
github.com/google/orderedcode v0.0.1 // indirect
103103
github.com/google/uuid v1.6.0 // indirect
104104
github.com/gorilla/handlers v1.5.2 // indirect
105105
github.com/gorilla/websocket v1.5.3 // indirect
106106
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
107107
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
108-
github.com/hashicorp/go-hclog v1.5.0 // indirect
108+
github.com/hashicorp/go-hclog v1.6.3 // indirect
109109
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
110-
github.com/hashicorp/go-metrics v0.5.3 // indirect
111-
github.com/hashicorp/go-plugin v1.5.2 // indirect
110+
github.com/hashicorp/go-metrics v0.5.4 // indirect
111+
github.com/hashicorp/go-plugin v1.6.3 // indirect
112112
github.com/hashicorp/golang-lru v1.0.2 // indirect
113113
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
114114
github.com/hashicorp/hcl v1.0.0 // indirect
115-
github.com/hashicorp/yamux v0.1.1 // indirect
116-
github.com/hdevalence/ed25519consensus v0.1.0 // indirect
117-
github.com/huandu/skiplist v1.2.0 // indirect
115+
github.com/hashicorp/yamux v0.1.2 // indirect
116+
github.com/hdevalence/ed25519consensus v0.2.0 // indirect
117+
github.com/huandu/skiplist v1.2.1 // indirect
118118
github.com/iancoleman/strcase v0.3.0 // indirect
119119
github.com/improbable-eng/grpc-web v0.15.0 // indirect
120120
github.com/inconshreveable/mousetrap v1.1.0 // indirect
121121
github.com/jmhodges/levigo v1.0.0 // indirect
122-
github.com/klauspost/compress v1.17.11 // indirect
123-
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
122+
github.com/klauspost/compress v1.18.0 // indirect
123+
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
124124
github.com/kr/pretty v0.3.1 // indirect
125125
github.com/kr/text v0.2.0 // indirect
126126
github.com/lib/pq v1.10.9 // indirect
127-
github.com/linxGnu/grocksdb v1.8.14 // indirect
128-
github.com/magiconair/properties v1.8.7 // indirect
129-
github.com/mattn/go-colorable v0.1.13 // indirect
127+
github.com/linxGnu/grocksdb v1.9.8 // indirect
128+
github.com/magiconair/properties v1.8.10 // indirect
129+
github.com/mattn/go-colorable v0.1.14 // indirect
130130
github.com/mattn/go-isatty v0.0.20 // indirect
131131
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
132132
github.com/minio/highwayhash v1.0.3 // indirect
@@ -136,23 +136,23 @@ require (
136136
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
137137
github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect
138138
github.com/oklog/run v1.1.0 // indirect
139-
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
139+
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
140140
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect
141141
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
142142
github.com/prometheus/client_model v0.6.1 // indirect
143-
github.com/prometheus/common v0.60.1 // indirect
143+
github.com/prometheus/common v0.63.0 // indirect
144144
github.com/prometheus/procfs v0.15.1 // indirect
145145
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
146-
github.com/rogpeppe/go-internal v1.13.1 // indirect
146+
github.com/rogpeppe/go-internal v1.14.1 // indirect
147147
github.com/rs/cors v1.11.1 // indirect
148-
github.com/rs/zerolog v1.33.0 // indirect
149-
github.com/sagikazarmark/locafero v0.4.0 // indirect
148+
github.com/rs/zerolog v1.34.0 // indirect
149+
github.com/sagikazarmark/locafero v0.7.0 // indirect
150150
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
151151
github.com/sasha-s/go-deadlock v0.3.5 // indirect
152152
github.com/sirupsen/logrus v1.9.3 // indirect
153153
github.com/sourcegraph/conc v0.3.0 // indirect
154-
github.com/spf13/afero v1.11.0 // indirect
155-
github.com/spf13/viper v1.19.0 // indirect
154+
github.com/spf13/afero v1.12.0 // indirect
155+
github.com/spf13/viper v1.20.1 // indirect
156156
github.com/subosito/gotenv v1.6.0 // indirect
157157
github.com/tendermint/go-amino v0.16.0 // indirect
158158
github.com/tidwall/btree v1.7.0 // indirect
@@ -164,21 +164,21 @@ require (
164164
go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect
165165
go.opencensus.io v0.24.0 // indirect
166166
go.uber.org/multierr v1.11.0 // indirect
167-
golang.org/x/crypto v0.33.0 // indirect
168-
golang.org/x/net v0.35.0 // indirect
169-
golang.org/x/sync v0.11.0 // indirect
170-
golang.org/x/sys v0.30.0 // indirect
171-
golang.org/x/term v0.29.0 // indirect
172-
golang.org/x/text v0.22.0 // indirect
173-
google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 // indirect
174-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
175-
google.golang.org/protobuf v1.36.5 // indirect
167+
golang.org/x/crypto v0.37.0 // indirect
168+
golang.org/x/net v0.39.0 // indirect
169+
golang.org/x/sync v0.13.0 // indirect
170+
golang.org/x/sys v0.32.0 // indirect
171+
golang.org/x/term v0.31.0 // indirect
172+
golang.org/x/text v0.24.0 // indirect
173+
google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 // indirect
174+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250422160041-2d3770c4ea7f // indirect
175+
google.golang.org/protobuf v1.36.6 // indirect
176176
gopkg.in/ini.v1 v1.67.0 // indirect
177177
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
178178
gopkg.in/yaml.v3 v3.0.1 // indirect
179-
gotest.tools/v3 v3.5.1 // indirect
180-
nhooyr.io/websocket v1.8.6 // indirect
181-
pgregory.net/rapid v1.1.0 // indirect
179+
gotest.tools/v3 v3.5.2 // indirect
180+
nhooyr.io/websocket v1.8.10 // indirect
181+
pgregory.net/rapid v1.2.0 // indirect
182182
sigs.k8s.io/yaml v1.4.0 // indirect
183183
)
184184

0 commit comments

Comments
 (0)