Skip to content

Commit

Permalink
fix automation load test - pyroscope config
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhwarrier committed Jan 25, 2024
1 parent e9f138c commit 14165e0
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions integration-tests/load/automationv2_1/automationv2_1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"math"
"math/big"
"os"
"strconv"
"strings"
"testing"
Expand All @@ -30,15 +31,15 @@ import (
"github.com/smartcontractkit/chainlink-testing-framework/logging"
"github.com/smartcontractkit/chainlink-testing-framework/networks"

ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config"
ctfconfig "github.com/smartcontractkit/chainlink-testing-framework/config"

"github.com/smartcontractkit/chainlink/integration-tests/actions"
"github.com/smartcontractkit/chainlink/integration-tests/actions/automationv2"
"github.com/smartcontractkit/chainlink/integration-tests/client"
"github.com/smartcontractkit/chainlink/integration-tests/contracts"
contractseth "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum"
tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig"
a_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/automation"
aconfig "github.com/smartcontractkit/chainlink/integration-tests/testconfig/automation"
"github.com/smartcontractkit/chainlink/integration-tests/testreporters"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_utils_2_1"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_emitter"
Expand Down Expand Up @@ -142,15 +143,15 @@ func TestLogTrigger(t *testing.T) {
Msg("Test Config")

testConfigFormat := `Number of Nodes: %d
Duration: %d
Block Time: %d
Spec Type: %s
Log Level: %s
Image: %s
Tag: %s
Duration: %d
Block Time: %d
Spec Type: %s
Log Level: %s
Image: %s
Tag: %s
Load Config:
%s`
Load Config:
%s`

prettyLoadConfig, err := toml.Marshal(loadedTestConfig.Automation.Load)
require.NoError(t, err, "Error marshalling load config")
Expand Down Expand Up @@ -230,7 +231,11 @@ func TestLogTrigger(t *testing.T) {
}

if *loadedTestConfig.Pyroscope.Enabled {
serverUrl := os.Getenv("PYROSCOPE_SERVER")
serverKey := os.Getenv("PYROSCOPE_KEY")
loadedTestConfig.Pyroscope.Environment = &testEnvironment.Cfg.Namespace
loadedTestConfig.Pyroscope.ServerUrl = &serverUrl
loadedTestConfig.Pyroscope.Key = &serverKey
}

numberOfUpkeeps := *loadedTestConfig.Automation.General.NumberOfNodes
Expand All @@ -245,8 +250,8 @@ func TestLogTrigger(t *testing.T) {
nodeTOML = networks.AddNetworksConfig(nodeTOML, loadedTestConfig.Pyroscope, testNetwork)

var overrideFn = func(_ interface{}, target interface{}) {
ctf_config.MustConfigOverrideChainlinkVersion(loadedTestConfig.ChainlinkImage, target)
ctf_config.MightConfigOverridePyroscopeKey(loadedTestConfig.Pyroscope, target)
ctfconfig.MustConfigOverrideChainlinkVersion(loadedTestConfig.ChainlinkImage, target)
ctfconfig.MightConfigOverridePyroscopeKey(loadedTestConfig.Pyroscope, target)
}

cd := chainlink.NewWithOverride(i, map[string]any{
Expand Down Expand Up @@ -336,7 +341,7 @@ func TestLogTrigger(t *testing.T) {
}

upkeepConfigs := make([]automationv2.UpkeepConfig, 0)
loadConfigs := make([]a_config.Load, 0)
loadConfigs := make([]aconfig.Load, 0)
cEVMClient, err := blockchain.ConcurrentEVMClient(testNetwork, testEnvironment, chainClient, l)
require.NoError(t, err, "Error building concurrent chain client")

Expand All @@ -351,7 +356,7 @@ func TestLogTrigger(t *testing.T) {
Int("Out Of", *u.NumberOfUpkeeps).
Msg("Deployed Automation Log Trigger Consumer Contract")

loadCfg := a_config.Load{
loadCfg := aconfig.Load{
NumberOfEvents: u.NumberOfEvents,
NumberOfSpamMatchingEvents: u.NumberOfSpamMatchingEvents,
NumberOfSpamNonMatchingEvents: u.NumberOfSpamNonMatchingEvents,
Expand Down

0 comments on commit 14165e0

Please sign in to comment.