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

CCIP-4014 enable rmn tests in ci #15276

Merged
merged 15 commits into from
Nov 19, 2024
98 changes: 98 additions & 0 deletions .github/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,104 @@ runner-test-matrix:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.4.0

- id: smoke/ccip_rmn_test.go:^TestRMN_TwoMessagesOnTwoLanes$
path: integration-tests/smoke/ccip_rmn_test.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- PR E2E Core Tests
- Merge Queue E2E Core Tests
- Nightly E2E Tests
test_cmd: cd integration-tests/smoke && go test -test.run ^TestRMN_TwoMessagesOnTwoLanes$ -timeout 12m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.4.0
E2E_RMN_RAGEPROXY_VERSION: master-5208d09
E2E_RMN_AFN2PROXY_VERSION: master-5208d09

- id: smoke/ccip_rmn_test.go:^TestRMN_MultipleMessagesOnOneLaneNoWaitForExec$
path: integration-tests/smoke/ccip_rmn_test.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- PR E2E Core Tests
- Merge Queue E2E Core Tests
- Nightly E2E Tests
test_cmd: cd integration-tests/smoke && go test -test.run ^TestRMN_MultipleMessagesOnOneLaneNoWaitForExec$ -timeout 12m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.4.0
E2E_RMN_RAGEPROXY_VERSION: master-5208d09
E2E_RMN_AFN2PROXY_VERSION: master-5208d09

- id: smoke/ccip_rmn_test.go:^TestRMN_NotEnoughObservers$
path: integration-tests/smoke/ccip_rmn_test.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- PR E2E Core Tests
- Merge Queue E2E Core Tests
- Nightly E2E Tests
test_cmd: cd integration-tests/smoke && go test -test.run ^TestRMN_NotEnoughObservers$ -timeout 12m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.4.0
E2E_RMN_RAGEPROXY_VERSION: master-5208d09
E2E_RMN_AFN2PROXY_VERSION: master-5208d09

- id: smoke/ccip_rmn_test.go:^TestRMN_DifferentSigners$
path: integration-tests/smoke/ccip_rmn_test.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- PR E2E Core Tests
- Merge Queue E2E Core Tests
- Nightly E2E Tests
test_cmd: cd integration-tests/smoke && go test -test.run ^TestRMN_DifferentSigners$ -timeout 12m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.4.0
E2E_RMN_RAGEPROXY_VERSION: master-5208d09
E2E_RMN_AFN2PROXY_VERSION: master-5208d09

# - id: smoke/ccip_rmn_test.go:^TestRMN_NotEnoughSigners$
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a test like this in the repo, why do we comment it out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently failing @dimkouv is working on a PR to fix this. After that we will uncomment this

# path: integration-tests/smoke/ccip_rmn_test.go
# test_env_type: docker
# runs_on: ubuntu-latest
# triggers:
# - PR E2E Core Tests
# - Merge Queue E2E Core Tests
# - Nightly E2E Tests
# test_cmd: cd integration-tests/smoke && go test -test.run ^TestRMN_NotEnoughSigners$ -timeout 12m -test.parallel=1 -count=1 -json
# pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
# test_env_vars:
# E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
# E2E_JD_VERSION: 0.4.0
# E2E_RMN_RAGEPROXY_VERSION: master-5208d09
# E2E_RMN_AFN2PROXY_VERSION: master-5208d09


- id: smoke/ccip_rmn_test.go:^TestRMN_DifferentRmnNodesForDifferentChains$
path: integration-tests/smoke/ccip_rmn_test.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- PR E2E Core Tests
- Merge Queue E2E Core Tests
- Nightly E2E Tests
test_cmd: cd integration-tests/smoke/ && go test -test.run ^TestRMN_DifferentRmnNodesForDifferentChains$ -timeout 12m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.4.0
E2E_RMN_RAGEPROXY_VERSION: master-5208d09
E2E_RMN_AFN2PROXY_VERSION: master-5208d09


# END: CCIPv1.6 tests

# START: CCIP tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ jobs:
contents: read
needs: [build-chainlink, changes]
if: github.event_name == 'pull_request' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true')
uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@5412507526722a7b1c5d719fa686eed5a1bc4035 # ctf-run-tests@0.2.0
uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@27467f0073162e0ca77d33ce26f649b3d0f4c188 #ctf-run-tests@0.2.0
with:
workflow_name: Run Core E2E Tests For PR
chainlink_version: ${{ inputs.evm-ref || github.sha }}
Expand Down Expand Up @@ -251,7 +251,7 @@ jobs:
contents: read
needs: [build-chainlink, changes]
if: github.event_name == 'merge_group' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true')
uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@5412507526722a7b1c5d719fa686eed5a1bc4035 # ctf-run-tests@0.2.0
uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@27467f0073162e0ca77d33ce26f649b3d0f4c188 #ctf-run-tests@1.0.0
with:
workflow_name: Run Core E2E Tests For Merge Queue
chainlink_version: ${{ inputs.evm-ref || github.sha }}
Expand Down
6 changes: 6 additions & 0 deletions deployment/environment/devenv/.sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ E2E_JD_VERSION=<job-distributor-version>
E2E_TEST_CHAINLINK_IMAGE=public.ecr.aws/w0i8p0z9/chainlink-ccip
E2E_TEST_CHAINLINK_VERSION=2.14.0-ccip1.5.0

E2E_RMN_RAGEPROXY_IMAGE=<rmn-proxy-image>
E2E_RMN_RAGEPROXY_VERSION=master-5208d09
E2E_RMN_AFN2PROXY_IMAGE=<rmn-afn2proxy-image>
E2E_RMN_AFN2PROXY_VERSION=master-5208d09


# RPC Configuration
E2E_TEST_SEPOLIA_WALLET_KEY=<sepolia-wallet-key>
E2E_TEST_SEPOLIA_RPC_HTTP_URL_1=<sepolia-rpc-http-url>
Expand Down
18 changes: 13 additions & 5 deletions integration-tests/ccip-tests/testsetups/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

"github.com/smartcontractkit/chainlink/deployment"
ccipdeployment "github.com/smartcontractkit/chainlink/deployment/ccip"
"github.com/smartcontractkit/chainlink/deployment/ccip/changeset"
"github.com/smartcontractkit/chainlink/deployment/environment/devenv"
clclient "github.com/smartcontractkit/chainlink/deployment/environment/nodeclient"
"github.com/smartcontractkit/chainlink/integration-tests/actions"
Expand Down Expand Up @@ -138,10 +139,16 @@ func NewLocalDevEnvironmentWithRMN(
lggr logger.Logger,
numRmnNodes int,
) (ccipdeployment.DeployedEnv, devenv.RMNCluster) {
tenv, dockerenv, _ := NewLocalDevEnvironmentWithDefaultPrice(t, lggr)
tenv, dockerenv, testCfg := NewLocalDevEnvironmentWithDefaultPrice(t, lggr)
state, err := ccipdeployment.LoadOnchainState(tenv.Env)
require.NoError(t, err)

output, err := changeset.DeployPrerequisites(tenv.Env, changeset.DeployPrerequisiteConfig{
ChainSelectors: tenv.Env.AllChainSelectors(),
})
require.NoError(t, err)
require.NoError(t, tenv.Env.ExistingAddresses.Merge(output.AddressBook))

// Deploy CCIP contracts.
newAddresses := deployment.NewMemoryAddressBook()
err = ccipdeployment.DeployCCIPContracts(tenv.Env, newAddresses, ccipdeployment.DeployCCIPContractConfig{
Expand All @@ -157,14 +164,15 @@ func NewLocalDevEnvironmentWithRMN(

l := logging.GetTestLogger(t)
config := GenerateTestRMNConfig(t, numRmnNodes, tenv, MustNetworksToRPCMap(dockerenv.EVMNetworks))
require.NotNil(t, testCfg.CCIP)
rmnCluster, err := devenv.NewRMNCluster(
t, l,
[]string{dockerenv.DockerNetwork.ID},
config,
"rageproxy",
"latest",
"afn2proxy",
"latest",
testCfg.CCIP.RMNConfig.GetProxyImage(),
testCfg.CCIP.RMNConfig.GetProxyVersion(),
testCfg.CCIP.RMNConfig.GetAFNImage(),
testCfg.CCIP.RMNConfig.GetAFNVersion(),
dockerenv.LogStream,
)
require.NoError(t, err)
Expand Down
13 changes: 7 additions & 6 deletions integration-tests/smoke/ccip_rmn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
jobv1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/job"
"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/osutil"
"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext"

"github.com/smartcontractkit/chainlink/deployment"
ccipdeployment "github.com/smartcontractkit/chainlink/deployment/ccip"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_home"
Expand All @@ -26,10 +27,8 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/logger"
)

// Set false to run the RMN tests
const skipRmnTest = true

func TestRMN_TwoMessagesOnTwoLanes(t *testing.T) {
t.Parallel()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need t.Parallel() if every test is run as a separate CI job?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried parallel at first did not work. can remove it

runRmnTestCase(t, rmnTestCase{
name: "messages on two lanes",
waitForExec: true,
Expand All @@ -53,6 +52,7 @@ func TestRMN_TwoMessagesOnTwoLanes(t *testing.T) {
}

func TestRMN_MultipleMessagesOnOneLaneNoWaitForExec(t *testing.T) {
t.Parallel()
runRmnTestCase(t, rmnTestCase{
name: "multiple messages for rmn batching inspection and one rmn node down",
waitForExec: false, // do not wait for execution reports
Expand All @@ -75,6 +75,7 @@ func TestRMN_MultipleMessagesOnOneLaneNoWaitForExec(t *testing.T) {
}

func TestRMN_NotEnoughObservers(t *testing.T) {
t.Parallel()
runRmnTestCase(t, rmnTestCase{
name: "one message but not enough observers, should not get a commit report",
passIfNoCommitAfter: time.Minute, // wait for a minute and assert that commit report was not delivered
Expand All @@ -97,6 +98,7 @@ func TestRMN_NotEnoughObservers(t *testing.T) {
}

func TestRMN_DifferentSigners(t *testing.T) {
t.Parallel()
runRmnTestCase(t, rmnTestCase{
name: "different signers and different observers",
homeChainConfig: homeChainConfig{
Expand All @@ -121,6 +123,7 @@ func TestRMN_DifferentSigners(t *testing.T) {
}

func TestRMN_NotEnoughSigners(t *testing.T) {
t.Parallel()
runRmnTestCase(t, rmnTestCase{
name: "different signers and different observers",
passIfNoCommitAfter: time.Minute, // wait for a minute and assert that commit report was not delivered
Expand All @@ -146,6 +149,7 @@ func TestRMN_NotEnoughSigners(t *testing.T) {
}

func TestRMN_DifferentRmnNodesForDifferentChains(t *testing.T) {
t.Parallel()
runRmnTestCase(t, rmnTestCase{
name: "different rmn nodes support different chains",
waitForExec: false,
Expand Down Expand Up @@ -177,9 +181,6 @@ const (
)

func runRmnTestCase(t *testing.T, tc rmnTestCase) {
if skipRmnTest {
t.Skip("Local only")
}
require.NoError(t, os.Setenv("ENABLE_RMN", "true"))

envWithRMN, rmnCluster := testsetups.NewLocalDevEnvironmentWithRMN(t, logger.TestLogger(t), len(tc.rmnNodes))
Expand Down
48 changes: 42 additions & 6 deletions integration-tests/testconfig/ccip/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ import (
)

const (
E2E_JD_IMAGE = "E2E_JD_IMAGE"
E2E_JD_VERSION = "E2E_JD_VERSION"
E2E_JD_GRPC = "E2E_JD_GRPC"
E2E_JD_WSRPC = "E2E_JD_WSRPC"
DEFAULT_DB_NAME = "JD_DB"
DEFAULT_DB_VERSION = "14.1"
E2E_JD_IMAGE = "E2E_JD_IMAGE"
E2E_JD_VERSION = "E2E_JD_VERSION"
E2E_JD_GRPC = "E2E_JD_GRPC"
E2E_JD_WSRPC = "E2E_JD_WSRPC"
DEFAULT_DB_NAME = "JD_DB"
DEFAULT_DB_VERSION = "14.1"
E2E_RMN_RAGEPROXY_IMAGE = "E2E_RMN_RAGEPROXY_IMAGE"
E2E_RMN_RAGEPROXY_VERSION = "E2E_RMN_RAGEPROXY_VERSION"
E2E_RMN_AFN2PROXY_IMAGE = "E2E_RMN_AFN2PROXY_IMAGE"
E2E_RMN_AFN2PROXY_VERSION = "E2E_RMN_AFN2PROXY_VERSION"
)

var (
Expand All @@ -45,6 +49,38 @@ type RMNConfig struct {
AFNVersion *string `toml:",omitempty"`
}

func (r *RMNConfig) GetProxyImage() string {
image := pointer.GetString(r.ProxyImage)
if image == "" {
return ctfconfig.MustReadEnvVar_String(E2E_RMN_RAGEPROXY_IMAGE)
}
return image
}

func (r *RMNConfig) GetProxyVersion() string {
version := pointer.GetString(r.ProxyVersion)
if version == "" {
return ctfconfig.MustReadEnvVar_String(E2E_RMN_RAGEPROXY_VERSION)
}
return version
}

func (r *RMNConfig) GetAFNImage() string {
image := pointer.GetString(r.AFNImage)
if image == "" {
return ctfconfig.MustReadEnvVar_String(E2E_RMN_AFN2PROXY_IMAGE)
}
return image
}

func (r *RMNConfig) GetAFNVersion() string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we align with a new naming? I guess no one remembers what AFN was :P

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version := pointer.GetString(r.AFNVersion)
if version == "" {
return ctfconfig.MustReadEnvVar_String(E2E_RMN_AFN2PROXY_VERSION)
}
return version
}

type NodeConfig struct {
NoOfPluginNodes *int `toml:",omitempty"`
NoOfBootstraps *int `toml:",omitempty"`
Expand Down
Loading