Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stateful deployment for chaos tests #132

Merged
merged 1 commit into from
Jan 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -77,8 +77,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 @@ -109,9 +109,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.f20690e8ede0cfead9df7f808f56a14f26469aaa",
},
},
"db": db,
"env": map[string]interface{}{
"eth_url": "ws://sol:8900",
"eth_disabled": "true",
Expand Down