Skip to content

Commit

Permalink
[AUTO-7451] Move load test and smoke test to use new actions (smartco…
Browse files Browse the repository at this point in the history
…ntractkit#11364)

* move load test to use new common action

* move smoke test to use common action

* fix smoke tests

* decrease batch size in load test report prep

* add info logs in TestAutomationKeeperNodesDown

* remove duplicate registry config in smoke test

* use AutomationTest struct in setupAutomationTestDocker

* add and use SetupMercuryMock
  • Loading branch information
anirudhwarrier authored Dec 1, 2023
1 parent 5969e1f commit 15e7b79
Show file tree
Hide file tree
Showing 3 changed files with 346 additions and 291 deletions.
23 changes: 23 additions & 0 deletions integration-tests/actions/automationv2/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"testing"
"time"

"github.com/smartcontractkit/chainlink/integration-tests/docker/test_env"

"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
"github.com/lib/pq"
Expand All @@ -36,6 +38,8 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype"
"github.com/smartcontractkit/chainlink/v2/core/store/models"
"github.com/smartcontractkit/chainlink/v2/core/utils"

ctfTestEnv "github.com/smartcontractkit/chainlink-testing-framework/docker/test_env"
)

type NodeDetails struct {
Expand Down Expand Up @@ -70,6 +74,8 @@ type AutomationTest struct {
ChainlinkNodesk8s []*client.ChainlinkK8sClient
ChainlinkNodes []*client.ChainlinkClient

DockerEnv *test_env.CLClusterTestEnv

NodeDetails []NodeDetails
DefaultP2Pv2Bootstrapper string
MercuryCredentialName string
Expand Down Expand Up @@ -135,6 +141,10 @@ func (a *AutomationTest) SetUpkeepPrivilegeManager(address string) {
a.UpkeepPrivilegeManager = common.HexToAddress(address)
}

func (a *AutomationTest) SetDockerEnv(env *test_env.CLClusterTestEnv) {
a.DockerEnv = env
}

func (a *AutomationTest) DeployLINK() error {
linkToken, err := a.Deployer.DeployLinkTokenContract()
if err != nil {
Expand Down Expand Up @@ -646,6 +656,19 @@ func (a *AutomationTest) AddJobsAndSetConfig(t *testing.T) {
l.Info().Str("Registry Address", a.Registry.Address()).Msg("Successfully setConfig on registry")
}

func (a *AutomationTest) SetupMercuryMock(t *testing.T, imposters []ctfTestEnv.KillgraveImposter) {
if a.IsOnk8s {
t.Error("mercury mock is not supported on k8s")
}
if a.DockerEnv == nil {
t.Error("docker env is not set")
}
err := a.DockerEnv.MockAdapter.AddImposter(imposters)
if err != nil {
require.NoError(t, err, "Error adding mock imposter")
}
}

func (a *AutomationTest) SetupAutomationDeployment(t *testing.T) {
l := logging.GetTestLogger(t)
err := a.CollectNodeDetails()
Expand Down
Loading

0 comments on commit 15e7b79

Please sign in to comment.