diff --git a/.changeset/chilly-stingrays-press.md b/.changeset/chilly-stingrays-press.md new file mode 100644 index 00000000000..1fe2e80f2b0 --- /dev/null +++ b/.changeset/chilly-stingrays-press.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +Removing ccip-tests/\* dependencies and moving ccip tests under a directory in smoke diff --git a/.github/e2e-tests.yml b/.github/e2e-tests.yml index 17765f13732..edde8da8162 100644 --- a/.github/e2e-tests.yml +++ b/.github/e2e-tests.yml @@ -935,66 +935,66 @@ runner-test-matrix: # START: CCIPv1.6 tests - - id: smoke/ccip_test.go:* - path: integration-tests/smoke/ccip_test.go + - id: smoke/ccip/ccip_test.go:* + path: integration-tests/smoke/ccip/ccip_test.go test_env_type: docker runs_on: ubuntu-latest triggers: - PR E2E Core Tests - Nightly E2E Tests - test_cmd: cd integration-tests/ && go test smoke/ccip_test.go -timeout 12m -test.parallel=2 -count=1 -json + test_cmd: cd integration-tests/smoke/ccip && go test ccip_test.go -timeout 12m -test.parallel=2 -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.6.0 - - id: smoke/ccip_messaging_test.go:* - path: integration-tests/smoke/ccip_messaging_test.go + - id: smoke/ccip/ccip_messaging_test.go:* + path: integration-tests/smoke/ccip/ccip_messaging_test.go test_env_type: docker runs_on: ubuntu-latest triggers: - PR E2E Core Tests - Nightly E2E Tests - test_cmd: cd integration-tests/ && go test smoke/ccip_messaging_test.go -timeout 12m -test.parallel=1 -count=1 -json + test_cmd: cd integration-tests/smoke/ccip && go test ccip_messaging_test.go -timeout 15m -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.6.0 - - id: smoke/ccip_usdc_test.go:* - path: integration-tests/smoke/ccip_usdc_test.go + - id: smoke/ccip/ccip_usdc_test.go:* + path: integration-tests/smoke/ccip/ccip_usdc_test.go test_env_type: docker runs_on: ubuntu-latest triggers: - PR E2E Core Tests - Nightly E2E Tests - test_cmd: cd integration-tests/ && go test smoke/ccip_usdc_test.go -timeout 12m -test.parallel=1 -count=1 -json + test_cmd: cd integration-tests/smoke/ccip && go test ccip_usdc_test.go -timeout 18m -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.6.0 - - id: smoke/fee_boosting_test.go:* - path: integration-tests/smoke/fee_boosting_test.go + - id: smoke/ccip/fee_boosting_test.go:* + path: integration-tests/smoke/ccip/fee_boosting_test.go test_env_type: docker runs_on: ubuntu-latest triggers: - PR E2E Core Tests - Nightly E2E Tests - test_cmd: cd integration-tests/ && go test smoke/fee_boosting_test.go -timeout 15m -test.parallel=1 -count=1 -json + test_cmd: cd integration-tests/smoke/ccip && go test fee_boosting_test.go -timeout 15m -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.6.0 - - id: smoke/ccip_rmn_test.go:^TestRMN_TwoMessagesOnTwoLanesIncludingBatching$ - path: integration-tests/smoke/ccip_rmn_test.go + - id: smoke/ccip/ccip_rmn_test.go:^TestRMN_TwoMessagesOnTwoLanesIncludingBatching$ + path: integration-tests/smoke/ccip/ccip_rmn_test.go test_env_type: docker runs_on: ubuntu-latest triggers: - PR 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 + test_cmd: cd integration-tests/smoke/ccip && 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 @@ -1002,14 +1002,14 @@ runner-test-matrix: 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 + - id: smoke/ccip/ccip_rmn_test.go:^TestRMN_MultipleMessagesOnOneLaneNoWaitForExec$ + path: integration-tests/smoke/ccip/ccip_rmn_test.go test_env_type: docker runs_on: ubuntu-latest triggers: - PR 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 + test_cmd: cd integration-tests/smoke/ccip && 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 @@ -1018,14 +1018,14 @@ runner-test-matrix: 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 +# - id: smoke/ccip/ccip_rmn_test.go:^TestRMN_NotEnoughObservers$ +# path: integration-tests/smoke/ccip/ccip_rmn_test.go # test_env_type: docker # runs_on: ubuntu-latest # triggers: # - PR 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 +# test_cmd: cd integration-tests/smoke/ccip && 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 @@ -1033,14 +1033,14 @@ runner-test-matrix: # 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 + - id: smoke/ccip/ccip_rmn_test.go:^TestRMN_DifferentSigners$ + path: integration-tests/smoke/ccip/ccip_rmn_test.go test_env_type: docker runs_on: ubuntu-latest triggers: - PR 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 + test_cmd: cd integration-tests/smoke/ccip && 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 @@ -1049,14 +1049,14 @@ runner-test-matrix: 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 +# - id: smoke/ccip/ccip_rmn_test.go:^TestRMN_NotEnoughSigners$ +# path: integration-tests/smoke/ccip/ccip_rmn_test.go # test_env_type: docker # runs_on: ubuntu-latest # triggers: # - PR 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 +# test_cmd: cd integration-tests/smoke/ccip && 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 @@ -1065,14 +1065,14 @@ runner-test-matrix: # E2E_RMN_AFN2PROXY_VERSION: master-5208d09 - - id: smoke/ccip_rmn_test.go:^TestRMN_DifferentRmnNodesForDifferentChains$ - path: integration-tests/smoke/ccip_rmn_test.go + - id: smoke/ccip/ccip_rmn_test.go:^TestRMN_DifferentRmnNodesForDifferentChains$ + path: integration-tests/smoke/ccip/ccip_rmn_test.go test_env_type: docker runs_on: ubuntu-latest triggers: - PR 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 + test_cmd: cd integration-tests/smoke/ccip && 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 diff --git a/integration-tests/actions/ccip_helpers.go b/integration-tests/actions/ccip_helpers.go new file mode 100644 index 00000000000..cdfd343eaa5 --- /dev/null +++ b/integration-tests/actions/ccip_helpers.go @@ -0,0 +1,45 @@ +package actions + +import ( + "fmt" + "net/http" + + "github.com/rs/zerolog/log" + + ctfClient "github.com/smartcontractkit/chainlink-testing-framework/lib/client" + ctftestenv "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env" +) + +// SetMockServerWithUSDCAttestation responds with a mock attestation for any msgHash +// The path is set with regex to match any path that starts with /v1/attestations +func SetMockServerWithUSDCAttestation( + killGrave *ctftestenv.Killgrave, + mockserver *ctfClient.MockserverClient, +) error { + path := "/v1/attestations" + response := struct { + Status string `json:"status"` + Attestation string `json:"attestation"` + Error string `json:"error"` + }{ + Status: "complete", + Attestation: "0x9049623e91719ef2aa63c55f357be2529b0e7122ae552c18aff8db58b4633c4d3920ff03d3a6d1ddf11f06bf64d7fd60d45447ac81f527ba628877dc5ca759651b08ffae25a6d3b1411749765244f0a1c131cbfe04430d687a2e12fd9d2e6dc08e118ad95d94ad832332cf3c4f7a4f3da0baa803b7be024b02db81951c0f0714de1b", + } + if killGrave == nil && mockserver == nil { + return fmt.Errorf("both killgrave and mockserver are nil") + } + log.Info().Str("path", path).Msg("setting attestation-api response for any msgHash") + if killGrave != nil { + err := killGrave.SetAnyValueResponse(fmt.Sprintf("%s/{_hash:.*}", path), []string{http.MethodGet}, response) + if err != nil { + return fmt.Errorf("failed to set killgrave server value: %w", err) + } + } + if mockserver != nil { + err := mockserver.SetAnyValueResponse(fmt.Sprintf("%s/.*", path), response) + if err != nil { + return fmt.Errorf("failed to set mockserver value: %w URL = %s", err, fmt.Sprintf("%s/%s/.*", mockserver.LocalURL(), path)) + } + } + return nil +} diff --git a/integration-tests/smoke/ccip_messaging_test.go b/integration-tests/smoke/ccip/ccip_messaging_test.go similarity index 99% rename from integration-tests/smoke/ccip_messaging_test.go rename to integration-tests/smoke/ccip/ccip_messaging_test.go index 654946d620a..cd9a1f0c6d8 100644 --- a/integration-tests/smoke/ccip_messaging_test.go +++ b/integration-tests/smoke/ccip/ccip_messaging_test.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" - "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testsetups" + "github.com/smartcontractkit/chainlink/integration-tests/testsetups" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/onramp" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" diff --git a/integration-tests/smoke/ccip_rmn_test.go b/integration-tests/smoke/ccip/ccip_rmn_test.go similarity index 99% rename from integration-tests/smoke/ccip_rmn_test.go rename to integration-tests/smoke/ccip/ccip_rmn_test.go index 6b7d54e0224..c49d227b410 100644 --- a/integration-tests/smoke/ccip_rmn_test.go +++ b/integration-tests/smoke/ccip/ccip_rmn_test.go @@ -22,7 +22,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_remote" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" - "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testsetups" + "github.com/smartcontractkit/chainlink/integration-tests/testsetups" "github.com/smartcontractkit/chainlink/v2/core/logger" ) diff --git a/integration-tests/smoke/ccip_test.go b/integration-tests/smoke/ccip/ccip_test.go similarity index 98% rename from integration-tests/smoke/ccip_test.go rename to integration-tests/smoke/ccip/ccip_test.go index 7996a4ccf0a..84f705b77e1 100644 --- a/integration-tests/smoke/ccip_test.go +++ b/integration-tests/smoke/ccip/ccip_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" - "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testsetups" + "github.com/smartcontractkit/chainlink/integration-tests/testsetups" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" "github.com/smartcontractkit/chainlink/v2/core/logger" ) diff --git a/integration-tests/smoke/ccip_usdc_test.go b/integration-tests/smoke/ccip/ccip_usdc_test.go similarity index 99% rename from integration-tests/smoke/ccip_usdc_test.go rename to integration-tests/smoke/ccip/ccip_usdc_test.go index aef2c916842..675ced9bc84 100644 --- a/integration-tests/smoke/ccip_usdc_test.go +++ b/integration-tests/smoke/ccip/ccip_usdc_test.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" - "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testsetups" + "github.com/smartcontractkit/chainlink/integration-tests/testsetups" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" diff --git a/integration-tests/smoke/fee_boosting_test.go b/integration-tests/smoke/ccip/fee_boosting_test.go similarity index 98% rename from integration-tests/smoke/fee_boosting_test.go rename to integration-tests/smoke/ccip/fee_boosting_test.go index 087715a80a2..8c9f3339267 100644 --- a/integration-tests/smoke/fee_boosting_test.go +++ b/integration-tests/smoke/ccip/fee_boosting_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" - "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testsetups" + "github.com/smartcontractkit/chainlink/integration-tests/testsetups" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router" "github.com/smartcontractkit/chainlink/v2/core/logger" ) diff --git a/integration-tests/ccip-tests/testsetups/test_helpers.go b/integration-tests/testsetups/test_helpers.go similarity index 94% rename from integration-tests/ccip-tests/testsetups/test_helpers.go rename to integration-tests/testsetups/test_helpers.go index 4700c6fd14f..8ff7ea79a63 100644 --- a/integration-tests/ccip-tests/testsetups/test_helpers.go +++ b/integration-tests/testsetups/test_helpers.go @@ -1,6 +1,7 @@ package testsetups import ( + "bytes" "fmt" "math/big" "os" @@ -25,6 +26,10 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" + integrationnodes "github.com/smartcontractkit/chainlink/integration-tests/types/config/node" + evmcfg "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" + corechainlink "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" + "github.com/smartcontractkit/chainlink/deployment/environment/devenv" clclient "github.com/smartcontractkit/chainlink/deployment/environment/nodeclient" "github.com/smartcontractkit/chainlink/integration-tests/actions" @@ -647,3 +652,40 @@ func CreateChainConfigFromNetworks( } return chains } + +func SetNodeConfig(nets []blockchain.EVMNetwork, nodeConfig, commonChain string, configByChain map[string]string) (*corechainlink.Config, string, error) { + var tomlCfg *corechainlink.Config + var err error + var commonChainConfig *evmcfg.Chain + if commonChain != "" { + err = commonconfig.DecodeTOML(bytes.NewReader([]byte(commonChain)), &commonChainConfig) + if err != nil { + return nil, "", err + } + } + configByChainMap := make(map[int64]evmcfg.Chain) + for k, v := range configByChain { + var chain evmcfg.Chain + err = commonconfig.DecodeTOML(bytes.NewReader([]byte(v)), &chain) + if err != nil { + return nil, "", err + } + chainId, err := strconv.ParseInt(k, 10, 64) + if err != nil { + return nil, "", err + } + configByChainMap[chainId] = chain + } + if nodeConfig == "" { + tomlCfg = integrationnodes.NewConfig( + integrationnodes.NewBaseConfig(), + integrationnodes.WithPrivateEVMs(nets, commonChainConfig, configByChainMap)) + } else { + tomlCfg, err = integrationnodes.NewConfigFromToml([]byte(nodeConfig), integrationnodes.WithPrivateEVMs(nets, commonChainConfig, configByChainMap)) + if err != nil { + return nil, "", err + } + } + tomlStr, err := tomlCfg.TOMLString() + return tomlCfg, tomlStr, err +}