Skip to content

Commit 8d93549

Browse files
committed
stub Loki in CI
1 parent fcded2d commit 8d93549

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

framework/chaos/chaos.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"strings"
1212
)
1313

14-
func NewPumbaChaos(command string) (func(), error) {
14+
func ExecPumba(command string) (func(), error) {
1515
ctx := context.Background()
1616
cmd := strings.Split(command, " ")
1717
pumbaReq := testcontainers.ContainerRequest{

framework/examples/myproject/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.22.7
55
replace (
66
github.com/smartcontractkit/chainlink-testing-framework/framework => ../..
77
github.com/smartcontractkit/chainlink-testing-framework/framework/cmd => ../../cmd/
8+
github.com/smartcontractkit/chainlink-testing-framework/framework/wasp => ../../wasp/
89
)
910

1011
require (

framework/examples/myproject/load_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
ns "github.com/smartcontractkit/chainlink-testing-framework/framework/components/simple_node_set"
1010
"github.com/smartcontractkit/chainlink-testing-framework/wasp"
1111
"github.com/stretchr/testify/require"
12+
"os"
1213
"testing"
1314
"time"
1415
)
@@ -30,6 +31,12 @@ func TestLoad(t *testing.T) {
3031
out, err := ns.NewSharedDBNodeSet(in.NodeSet, bc, dp.BaseURLDocker)
3132
require.NoError(t, err)
3233

34+
var lokiCfg *wasp.LokiConfig
35+
// temp fix, we can't reach shared Loki instance in CI
36+
if os.Getenv("CI") != "true" {
37+
lokiCfg = wasp.NewEnvLokiConfig()
38+
}
39+
3340
c, err := clclient.NewCLDefaultClients(out.CLNodes, framework.L)
3441
require.NoError(t, err)
3542

@@ -49,11 +56,11 @@ func TestLoad(t *testing.T) {
4956
"branch": "example",
5057
"commit": "example",
5158
},
52-
LokiConfig: wasp.NewEnvLokiConfig(),
59+
LokiConfig: lokiCfg,
5360
})).
5461
Run(false)
5562
require.NoError(t, err)
56-
_, err = chaos.NewPumbaChaos("netem --tc-image=gaiadocker/iproute2 --duration=1m delay --time=300 re2:node.*")
63+
_, err = chaos.ExecPumba("netem --tc-image=gaiadocker/iproute2 --duration=1m delay --time=300 re2:node.*")
5764
require.NoError(t, err)
5865
p.Wait()
5966
})

0 commit comments

Comments
 (0)