Skip to content

Commit

Permalink
stub Loki in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
skudasov committed Nov 6, 2024
1 parent fcded2d commit 8d93549
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion framework/chaos/chaos.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
)

func NewPumbaChaos(command string) (func(), error) {
func ExecPumba(command string) (func(), error) {
ctx := context.Background()
cmd := strings.Split(command, " ")
pumbaReq := testcontainers.ContainerRequest{
Expand Down
1 change: 1 addition & 0 deletions framework/examples/myproject/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.22.7
replace (
github.com/smartcontractkit/chainlink-testing-framework/framework => ../..
github.com/smartcontractkit/chainlink-testing-framework/framework/cmd => ../../cmd/
github.com/smartcontractkit/chainlink-testing-framework/framework/wasp => ../../wasp/
)

require (
Expand Down
11 changes: 9 additions & 2 deletions framework/examples/myproject/load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
ns "github.com/smartcontractkit/chainlink-testing-framework/framework/components/simple_node_set"
"github.com/smartcontractkit/chainlink-testing-framework/wasp"
"github.com/stretchr/testify/require"
"os"
"testing"
"time"
)
Expand All @@ -30,6 +31,12 @@ func TestLoad(t *testing.T) {
out, err := ns.NewSharedDBNodeSet(in.NodeSet, bc, dp.BaseURLDocker)
require.NoError(t, err)

var lokiCfg *wasp.LokiConfig
// temp fix, we can't reach shared Loki instance in CI
if os.Getenv("CI") != "true" {
lokiCfg = wasp.NewEnvLokiConfig()
}

c, err := clclient.NewCLDefaultClients(out.CLNodes, framework.L)
require.NoError(t, err)

Expand All @@ -49,11 +56,11 @@ func TestLoad(t *testing.T) {
"branch": "example",
"commit": "example",
},
LokiConfig: wasp.NewEnvLokiConfig(),
LokiConfig: lokiCfg,
})).
Run(false)
require.NoError(t, err)
_, err = chaos.NewPumbaChaos("netem --tc-image=gaiadocker/iproute2 --duration=1m delay --time=300 re2:node.*")
_, err = chaos.ExecPumba("netem --tc-image=gaiadocker/iproute2 --duration=1m delay --time=300 re2:node.*")
require.NoError(t, err)
p.Wait()
})
Expand Down

0 comments on commit 8d93549

Please sign in to comment.