Skip to content

Commit

Permalink
stateful deployment for chaos tests (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
skudasov authored Jan 24, 2022
1 parent 4070124 commit c560125
Show file tree
Hide file tree
Showing 6 changed files with 340 additions and 10 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/gagliardetto/binary v0.5.2
github.com/gagliardetto/solana-go v1.0.4
github.com/smartcontractkit/chainlink v1.0.1-0.20211209223503-68928efa429a
github.com/smartcontractkit/helmenv v1.0.24
github.com/smartcontractkit/helmenv v1.0.26
github.com/smartcontractkit/integrations-framework v1.0.31
github.com/smartcontractkit/libocr v0.0.0-20220121130134-5d2b1d5f424b
github.com/stretchr/testify v1.7.0
Expand Down
322 changes: 320 additions & 2 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/e2e/chaos/chaos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var _ = Describe("Solana chaos suite", func() {
var state = &common.OCRv2TestState{}
BeforeEach(func() {
By("Deploying OCRv2 cluster", func() {
state.DeployCluster(19)
state.DeployCluster(19, true)
state.LabelChaosGroups()
state.ImitateSource(1*time.Second, 2, 10)
})
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/common/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ func (m *OCRv2TestState) LabelChaosGroups() {
m.LabelChaosGroup(10, 19, ChaosGroupRightHalf)
}

func (m *OCRv2TestState) DeployCluster(nodes int) {
m.DeployEnv(nodes)
func (m *OCRv2TestState) DeployCluster(nodes int, stateful bool) {
m.DeployEnv(nodes, stateful)
m.SetupClients()
if m.Networks.Default.ContractsDeployed() {
err := m.LoadContracts()
Expand Down Expand Up @@ -110,9 +110,9 @@ func (m *OCRv2TestState) UploadProgramBinaries() {
Expect(err).ShouldNot(HaveOccurred())
}

func (m *OCRv2TestState) DeployEnv(nodes int) {
func (m *OCRv2TestState) DeployEnv(nodes int, stateful bool) {
m.Env, m.err = environment.DeployOrLoadEnvironment(
solclient.NewChainlinkSolOCRv2(nodes),
solclient.NewChainlinkSolOCRv2(nodes, stateful),
tools.ChartsRoot,
)
Expect(m.err).ShouldNot(HaveOccurred())
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/smoke/ocr2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var _ = Describe("Solana OCRv2", func() {
var state = &common.OCRv2TestState{}
BeforeEach(func() {
By("Deploying OCRv2 cluster", func() {
state.DeployCluster(5)
state.DeployCluster(5, false)
state.ImitateSource(common.SourceChangeInterval, 2, 10)
})
})
Expand Down
14 changes: 13 additions & 1 deletion tests/e2e/solclient/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,18 @@ import (
)

// NewChainlinkSolOCRv2 returns a cluster config with Solana test validator
func NewChainlinkSolOCRv2(nodes int) *environment.Config {
func NewChainlinkSolOCRv2(nodes int, stateful bool) *environment.Config {
var db map[string]interface{}
if stateful {
db = map[string]interface{}{
"stateful": true,
"capacity": "2Gi",
}
} else {
db = map[string]interface{}{
"stateful": false,
}
}
return &environment.Config{
NamespacePrefix: "chainlink-sol",
Charts: environment.Charts{
Expand All @@ -28,6 +39,7 @@ func NewChainlinkSolOCRv2(nodes int) *environment.Config {
"version": "develop.f149ecd421a3667dcd4b603fa69bda05e34d602d",
},
},
"db": db,
"env": map[string]interface{}{
"eth_url": "ws://sol:8900",
"eth_disabled": "true",
Expand Down

0 comments on commit c560125

Please sign in to comment.