Skip to content
This repository has been archived by the owner on Oct 27, 2023. It is now read-only.

Commit

Permalink
enable configurable versions (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnieeG committed Oct 12, 2023
1 parent 12a59b7 commit d2043d4
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 4 deletions.
14 changes: 14 additions & 0 deletions e2e/common/test_common.go
Expand Up @@ -186,6 +186,20 @@ func TestWithSingleNodeEnv(t *testing.T) {
})
}

func TestMultipleNodeWithDiffDBVersionEnv(t *testing.T) {
t.Parallel()
testEnvConfig := GetTestEnvConfig(t)
e := presets.EVMMultipleNodesWithDiffDBVersion(testEnvConfig)
err := e.Run()
require.NoError(t, err)
if e.WillUseRemoteRunner() {
return
}
t.Cleanup(func() {
assert.NoError(t, e.Shutdown())
})
}

func TestMinResources5NodesEnv(t *testing.T) {
t.Parallel()
testEnvConfig := GetTestEnvConfig(t)
Expand Down
4 changes: 4 additions & 0 deletions e2e/local-runner/envs_test.go
Expand Up @@ -22,6 +22,10 @@ func TestWithSingleNodeEnv(t *testing.T) {
common.TestWithSingleNodeEnv(t)
}

func TestMultipleNodeWithDiffDBVersionEnv(t *testing.T) {
common.TestMultipleNodeWithDiffDBVersionEnv(t)
}

func TestMinResources5NodesEnv(t *testing.T) {
common.TestMinResources5NodesEnv(t)
}
Expand Down
9 changes: 7 additions & 2 deletions e2e/remote-runner/remote_runner_envs_test.go
Expand Up @@ -7,15 +7,16 @@ import (

"github.com/go-resty/resty/v2"
"github.com/rs/zerolog/log"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink-env/e2e/common"
"github.com/smartcontractkit/chainlink-env/environment"
"github.com/smartcontractkit/chainlink-env/pkg/helm/chainlink"
"github.com/smartcontractkit/chainlink-env/pkg/helm/ethereum"
"github.com/smartcontractkit/chainlink-env/pkg/helm/mockserver"
mockservercfg "github.com/smartcontractkit/chainlink-env/pkg/helm/mockserver-cfg"
"github.com/smartcontractkit/chainlink-env/presets"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestMultiStageMultiManifestConnection(t *testing.T) {
Expand All @@ -34,6 +35,10 @@ func TestWithSingleNodeEnv(t *testing.T) {
common.TestWithSingleNodeEnv(t)
}

func TestMultipleNodeWithDiffDBVersionEnv(t *testing.T) {
common.TestMultipleNodeWithDiffDBVersionEnv(t)
}

func TestMinResources5NodesEnv(t *testing.T) {
common.TestMinResources5NodesEnv(t)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/helm/chainlink/chainlink.go
Expand Up @@ -185,9 +185,9 @@ func NewVersioned(index int, helmVersion string, props map[string]any) environme
if props["replicas"] != nil && props["replicas"] != "1" {
p.HasReplicas = true
replicas := props["replicas"].(int)
var nodesMap []map[string]string
var nodesMap []map[string]any
for i := 0; i < replicas; i++ {
nodesMap = append(nodesMap, map[string]string{
nodesMap = append(nodesMap, map[string]any{
"name": fmt.Sprintf("node-%d", i+1),
})
}
Expand Down
40 changes: 40 additions & 0 deletions presets/presets.go
Expand Up @@ -47,6 +47,46 @@ func EVMMinimalLocal(config *environment.Config) *environment.Environment {
}))
}

// EVMMinimalLocal local development Chainlink deployment,
// 1 bootstrap + 4 oracles (minimal requirements for OCR)
func EVMMultipleNodesWithDiffDBVersion(config *environment.Config) *environment.Environment {
return environment.New(config).
AddHelm(mockservercfg.New(nil)).
AddHelm(mockserver.New(nil)).
AddHelm(ethereum.New(nil)).
AddHelm(chainlink.New(0, map[string]interface{}{
"nodes": []map[string]any{
{
"name": "node-1",
"db": map[string]any{
"image": map[string]any{
"image": "postgres",
"version": "13.12",
},
},
},
{
"name": "node-2",
"db": map[string]any{
"image": map[string]any{
"image": "postgres",
"version": "14.9",
},
},
},
{
"name": "node-3",
"db": map[string]any{
"image": map[string]any{
"image": "postgres",
"version": "15.4",
},
},
},
},
}))
}

// EVMReorg deployment for two Ethereum networks re-org test
func EVMReorg(config *environment.Config) (*environment.Environment, error) {
var clToml = `[[EVM]]
Expand Down

0 comments on commit d2043d4

Please sign in to comment.