From 3b0e2452ae4d2e445c75df166c22f8a28a57a013 Mon Sep 17 00:00:00 2001 From: connorwstein Date: Mon, 30 Sep 2024 16:08:31 -0400 Subject: [PATCH] Unorder --- integration-tests/deployment/README.md | 15 ++++++++------- .../ccip/changeset/{1_cap_reg.go => cap_reg.go} | 4 ++-- .../{2_initial_deploy.go => initial_deploy.go} | 2 +- ...tial_deploy_test.go => initial_deploy_test.go} | 6 +++--- 4 files changed, 14 insertions(+), 13 deletions(-) rename integration-tests/deployment/ccip/changeset/{1_cap_reg.go => cap_reg.go} (79%) rename integration-tests/deployment/ccip/changeset/{2_initial_deploy.go => initial_deploy.go} (88%) rename integration-tests/deployment/ccip/changeset/{2_initial_deploy_test.go => initial_deploy_test.go} (95%) diff --git a/integration-tests/deployment/README.md b/integration-tests/deployment/README.md index 000219c8aba..c0ac1bbc530 100644 --- a/integration-tests/deployment/README.md +++ b/integration-tests/deployment/README.md @@ -20,7 +20,6 @@ environments like testnet/mainnet. - EVM only /deployment/devenv -- Coming soon - package name `devenv` - Docker environment for higher fidelity testing - Support non-EVMs (yet to be implemented) @@ -36,20 +35,22 @@ environments like testnet/mainnet. - package name `changeset` imported as `ccipchangesets` - These function like scripts describing state transitions you wish to apply to _persistent_ environments like testnet/mainnet -- Ordered list of Go functions following the format +- They should be go functions where the first argument is an + environment and the second argument is a config struct which can be unique to the + changeset. The return value should be a `deployment.ChangesetOutput` and an error. ```Go -0001_descriptive_name.go -func Apply0001(env deployment.Environment, c ccipdeployment.Config) (deployment.ChangesetOutput, error) +do_something.go +func DoSomethingChangeSet(env deployment.Environment, c ccipdeployment.Config) (deployment.ChangesetOutput, error) { // Deploy contracts, generate MCMS proposals, generate // job specs according to contracts etc. return deployment.ChangesetOutput{}, nil } -0001_descriptive_name_test.go -func TestApply0001(t *testing.T) +do_something_test.go +func TestDoSomething(t *testing.T) { // Set up memory env - // Apply0001 function + // DoSomethingChangeSet function // Take the artifacts from ChangeSet output // Apply them to the memory env // Send traffic, run assertions etc. diff --git a/integration-tests/deployment/ccip/changeset/1_cap_reg.go b/integration-tests/deployment/ccip/changeset/cap_reg.go similarity index 79% rename from integration-tests/deployment/ccip/changeset/1_cap_reg.go rename to integration-tests/deployment/ccip/changeset/cap_reg.go index 1ca288321cd..99122979f96 100644 --- a/integration-tests/deployment/ccip/changeset/1_cap_reg.go +++ b/integration-tests/deployment/ccip/changeset/cap_reg.go @@ -7,8 +7,8 @@ import ( ccipdeployment "github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip" ) -// Separate migration because cap reg is an env var for CL nodes. -func Apply0001(env deployment.Environment, homeChainSel uint64) (deployment.ChangesetOutput, error) { +// Separated changset because cap reg is an env var for CL nodes. +func CapRegChangSet(env deployment.Environment, homeChainSel uint64) (deployment.ChangesetOutput, error) { // Note we also deploy the cap reg. ab, _, err := ccipdeployment.DeployCapReg(env.Logger, env.Chains[homeChainSel]) if err != nil { diff --git a/integration-tests/deployment/ccip/changeset/2_initial_deploy.go b/integration-tests/deployment/ccip/changeset/initial_deploy.go similarity index 88% rename from integration-tests/deployment/ccip/changeset/2_initial_deploy.go rename to integration-tests/deployment/ccip/changeset/initial_deploy.go index 99d16d21c40..9a97150ade7 100644 --- a/integration-tests/deployment/ccip/changeset/2_initial_deploy.go +++ b/integration-tests/deployment/ccip/changeset/initial_deploy.go @@ -12,7 +12,7 @@ import ( // TODO: Maybe there's a generics approach here? // Note if the change set is a deployment and it fails we have 2 options: // - Just throw away the addresses, fix issue and try again (potentially expensive on mainnet) -func Apply0002(env deployment.Environment, c ccipdeployment.DeployCCIPContractConfig) (deployment.ChangesetOutput, error) { +func InitialDeployChangeSet(env deployment.Environment, c ccipdeployment.DeployCCIPContractConfig) (deployment.ChangesetOutput, error) { ab, err := ccipdeployment.DeployCCIPContracts(env, c) if err != nil { env.Logger.Errorw("Failed to deploy CCIP contracts", "err", err, "addresses", ab) diff --git a/integration-tests/deployment/ccip/changeset/2_initial_deploy_test.go b/integration-tests/deployment/ccip/changeset/initial_deploy_test.go similarity index 95% rename from integration-tests/deployment/ccip/changeset/2_initial_deploy_test.go rename to integration-tests/deployment/ccip/changeset/initial_deploy_test.go index 5744dfbea95..6f40d41acb9 100644 --- a/integration-tests/deployment/ccip/changeset/2_initial_deploy_test.go +++ b/integration-tests/deployment/ccip/changeset/initial_deploy_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ) -func Test0002_InitialDeploy(t *testing.T) { +func TestInitialDeploy(t *testing.T) { lggr := logger.TestLogger(t) ctx := ccdeploy.Context(t) tenv := ccdeploy.NewMemoryEnvironment(t, lggr, 3) @@ -35,8 +35,8 @@ func Test0002_InitialDeploy(t *testing.T) { DeviationPPB: cciptypes.NewBigIntFromInt64(1e9), }, ) - // Apply migration - output, err := Apply0002(tenv.Env, ccdeploy.DeployCCIPContractConfig{ + // Apply changeset + output, err := InitialDeployChangeSet(tenv.Env, ccdeploy.DeployCCIPContractConfig{ HomeChainSel: tenv.HomeChainSel, FeedChainSel: tenv.FeedChainSel, ChainsToDeploy: tenv.Env.AllChainSelectors(),