Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
AnieeG committed Dec 9, 2024
1 parent dd31ca0 commit ea6796d
Show file tree
Hide file tree
Showing 21 changed files with 449 additions and 503 deletions.
12 changes: 2 additions & 10 deletions deployment/ccip/changeset/accept_ownership_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,14 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers"

commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset"
"github.com/smartcontractkit/chainlink/deployment/environment/memory"

"github.com/stretchr/testify/require"
"golang.org/x/exp/maps"

"github.com/smartcontractkit/chainlink/v2/core/logger"
commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset"
)

func Test_NewAcceptOwnershipChangeset(t *testing.T) {
e := NewMemoryEnvironmentWithJobsAndContracts(t, logger.TestLogger(t), memory.MemoryEnvironmentConfig{
Chains: 2,
NumOfUsersPerChain: 1,
Nodes: 4,
Bootstraps: 1,
}, &TestConfigs{})
e := NewMemoryEnvironment(t)
state, err := LoadOnchainState(e.Env)
require.NoError(t, err)

Expand Down
13 changes: 3 additions & 10 deletions deployment/ccip/changeset/cs_active_candidate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext"

"github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal"
"github.com/smartcontractkit/chainlink/deployment/environment/memory"
cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router"

Expand All @@ -22,20 +21,14 @@ import (

commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"

"github.com/smartcontractkit/chainlink/v2/core/logger"
)

func TestActiveCandidate(t *testing.T) {
t.Skipf("to be enabled after latest cl-ccip is compatible")

lggr := logger.TestLogger(t)
tenv := NewMemoryEnvironmentWithJobsAndContracts(t, lggr, memory.MemoryEnvironmentConfig{
Chains: 3,
NumOfUsersPerChain: 1,
Nodes: 5,
Bootstraps: 1,
}, nil)
tenv := NewMemoryEnvironment(t,
WithChains(3),
WithNodes(5))
e := tenv.Env
state, err := LoadOnchainState(tenv.Env)
require.NoError(t, err)
Expand Down
11 changes: 4 additions & 7 deletions deployment/ccip/changeset/cs_add_chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal"
commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset"
commontypes "github.com/smartcontractkit/chainlink/deployment/common/types"
"github.com/smartcontractkit/chainlink/deployment/environment/memory"
"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types"

"github.com/ethereum/go-ethereum/common"
Expand All @@ -34,12 +33,10 @@ import (

func TestAddChainInbound(t *testing.T) {
// 4 chains where the 4th is added after initial deployment.
e := NewMemoryEnvironmentWithJobs(t, logger.TestLogger(t), memory.MemoryEnvironmentConfig{
Chains: 4,
NumOfUsersPerChain: 1,
Nodes: 4,
Bootstraps: 1,
})
e := NewMemoryEnvironment(t,
WithChains(4),
WithJobsOnly(),
)
state, err := LoadOnchainState(e.Env)
require.NoError(t, err)
// Take first non-home chain as the new chain.
Expand Down
14 changes: 2 additions & 12 deletions deployment/ccip/changeset/cs_add_lane_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,12 @@ import (
"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext"

"github.com/smartcontractkit/chainlink/deployment"
"github.com/smartcontractkit/chainlink/deployment/environment/memory"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router"
"github.com/smartcontractkit/chainlink/v2/core/logger"
)

func TestAddLanesWithTestRouter(t *testing.T) {
e := NewMemoryEnvironmentWithJobsAndContracts(t, logger.TestLogger(t), memory.MemoryEnvironmentConfig{
Chains: 2,
Nodes: 4,
Bootstraps: 1,
}, nil)
e := NewMemoryEnvironment(t)
// Here we have CR + nodes set up, but no CCIP contracts deployed.
state, err := LoadOnchainState(e.Env)
require.NoError(t, err)
Expand Down Expand Up @@ -72,11 +66,7 @@ func TestAddLane(t *testing.T) {

t.Parallel()
// We add more chains to the chainlink nodes than the number of chains where CCIP is deployed.
e := NewMemoryEnvironmentWithJobsAndContracts(t, logger.TestLogger(t), memory.MemoryEnvironmentConfig{
Chains: 2,
Nodes: 4,
Bootstraps: 1,
}, nil)
e := NewMemoryEnvironment(t)
// Here we have CR + nodes set up, but no CCIP contracts deployed.
state, err := LoadOnchainState(e.Env)
require.NoError(t, err)
Expand Down
7 changes: 1 addition & 6 deletions deployment/ccip/changeset/cs_deploy_chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,7 @@ func TestDeployChainContractsChangeset(t *testing.T) {
}

func TestDeployCCIPContracts(t *testing.T) {
lggr := logger.TestLogger(t)
e := NewMemoryEnvironmentWithJobsAndContracts(t, lggr, memory.MemoryEnvironmentConfig{
Chains: 2,
Nodes: 4,
Bootstraps: 1,
}, nil)
e := NewMemoryEnvironment(t)
// Deploy all the CCIP contracts.
state, err := LoadOnchainState(e.Env)
require.NoError(t, err)
Expand Down
11 changes: 1 addition & 10 deletions deployment/ccip/changeset/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,10 @@ import (
"testing"

"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink/deployment/environment/memory"
"github.com/smartcontractkit/chainlink/v2/core/logger"
)

func TestSmokeState(t *testing.T) {
lggr := logger.TestLogger(t)
tenv := NewMemoryEnvironmentWithJobsAndContracts(t, lggr, memory.MemoryEnvironmentConfig{
Chains: 3,
Nodes: 4,
Bootstraps: 1,
NumOfUsersPerChain: 1,
}, nil)
tenv := NewMemoryEnvironment(t, WithChains(3))
state, err := LoadOnchainState(tenv.Env)
require.NoError(t, err)
_, err = state.View(tenv.Env.AllChainSelectors())
Expand Down
Loading

0 comments on commit ea6796d

Please sign in to comment.