Skip to content

Commit

Permalink
CCIP-4014 enable rmn tests in ci (#15276)
Browse files Browse the repository at this point in the history
* enable rmn tests in ci

* update references

* test.parallel

* try with one test

* fix

* fix tests

* comment

* remove parallel

* rename image

* disable flakey test
  • Loading branch information
AnieeG authored Nov 19, 2024
1 parent afa4ac1 commit 91f1609
Show file tree
Hide file tree
Showing 6 changed files with 164 additions and 19 deletions.
100 changes: 100 additions & 0 deletions .github/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,106 @@ runner-test-matrix:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.4.0

- id: smoke/ccip_rmn_test.go:^TestRMN_TwoMessagesOnTwoLanesIncludingBatching$
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_TwoMessagesOnTwoLanesIncludingBatching$ -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

# Enable after flaking issue is resolved
# - 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

# Enable after flaking issue is resolved
# - id: smoke/ccip_rmn_test.go:^TestRMN_NotEnoughSigners$
# 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 @@ -137,10 +138,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 @@ -156,14 +163,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.GetAFN2ProxyImage(),
testCfg.CCIP.RMNConfig.GetAFN2ProxyVersion(),
dockerenv.LogStream,
)
require.NoError(t, err)
Expand Down
7 changes: 1 addition & 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,9 +27,6 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/logger"
)

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

func TestRMN_TwoMessagesOnTwoLanesIncludingBatching(t *testing.T) {
runRmnTestCase(t, rmnTestCase{
name: "messages on two lanes including batching",
Expand Down Expand Up @@ -177,9 +175,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) GetAFN2ProxyImage() string {
image := pointer.GetString(r.AFNImage)
if image == "" {
return ctfconfig.MustReadEnvVar_String(E2E_RMN_AFN2PROXY_IMAGE)
}
return image
}

func (r *RMNConfig) GetAFN2ProxyVersion() string {
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

0 comments on commit 91f1609

Please sign in to comment.