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 - new integration tests #15473

Merged
merged 8 commits into from
Dec 3, 2024
Merged

ccip - new integration tests #15473

merged 8 commits into from
Dec 3, 2024

Conversation

dimkouv
Copy link
Contributor

@dimkouv dimkouv commented Dec 2, 2024

Add integration tests covering:

  • token price updates
  • chain fee price updates
  • message limits (data, tokens, gasLimit)

Copy link
Contributor

github-actions bot commented Dec 2, 2024

AER Report: CI Core

aer_workflow , commit , Scheduled Run Frequency , Clean Go Tidy & Generate , Detect Changes , Flakeguard Root Project / Get Tests To Run , lint , Core Tests (go_core_tests) , Core Tests (go_core_tests_integration) , Core Tests (go_core_ccip_deployment_tests) , Core Tests (go_core_race_tests) , Core Tests (go_core_fuzz) , Flakeguard Root Project / Run Tests , Flakeguard Deployment Project / Get Tests To Run , Flakeguard Root Project / Report , Flakeguard Deployment Project / Run Tests , Flakeguard Deployment Project / Report , Flakey Test Detection , SonarQube Scan

1. Missing module error: build

Source of Error:
[build] [install dependencies] [2023-10-01T12:34:56Z] ModuleNotFoundError: No module named 'requests'

Why: The error occurred because the 'requests' module is not installed in the environment where the build job is running.

Suggested fix: Add 'requests' to the dependencies list in the requirements file or install it directly in the build job script.

2. Syntax error in script: test

Source of Error:
[test] [run tests] [2023-10-01T12:35:10Z] SyntaxError: invalid syntax

Why: There is a syntax error in one of the scripts being executed during the test step. This could be due to a typo or incorrect code structure.

Suggested fix: Review the script for syntax errors and correct any typos or structural issues in the code.

3. Permission denied: deploy

Source of Error:
[deploy] [upload artifacts] [2023-10-01T12:36:45Z] PermissionError: [Errno 13] Permission denied: '/path/to/artifact'

Why: The error occurred because the script does not have the necessary permissions to access or modify the specified file or directory.

Suggested fix: Ensure that the script has the appropriate permissions to access the file or directory by modifying the permissions or running the script with elevated privileges.

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@dimkouv dimkouv marked this pull request as ready for review December 3, 2024 11:42
@dimkouv dimkouv requested review from a team as code owners December 3, 2024 11:42
@dimkouv dimkouv enabled auto-merge December 3, 2024 11:45
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2,SIMULATED_3
E2E_JD_VERSION: 0.6.0

- id: smoke/ccip/ccip_token_price_updates_test.go:*
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to define 3 chains if you need only 2 of them. Let's keep only as many chains as we need for tests, that will make them faster

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess same applied to other tests

feeQuoter2 := state.Chains[sourceChain2].FeeQuoter

// get initial chain fees
chainFee2, err := feeQuoter1.GetDestinationChainGasPrice(&bind.CallOpts{Context: ctx}, sourceChain2)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit, but it seems we use &bind.CallOpts{Context: ctx} multiple times, might be worth extracting to some variable or func

return false
}

chainFee2Now, err := feeQuoter1.GetDestinationChainGasPrice(&bind.CallOpts{Context: ctx}, sourceChain2)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just an idea, but maybe it would be easier to understand the code if we name these as sourceChain and destChain. I think it would be easier to read it than chain1 and chain2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's not really true though, because lanes are bidirectional so both are source/dest

// get initial chain fees
chainFee2, err := feeQuoter1.GetDestinationChainGasPrice(&bind.CallOpts{Context: ctx}, sourceChain2)
require.NoError(t, err)
chainFee1, err := feeQuoter2.GetDestinationChainGasPrice(&bind.CallOpts{Context: ctx}, sourceChain1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe something like initialChainFee and updatedChainFee after the price updates?

assert.GreaterOrEqual(t, len(allChainSelectors), 2, "test requires at least 2 chains")

sourceChain1 := allChainSelectors[0]
//sourceChain2 := allChainSelectors[1]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove if not needed

}, tests.WaitTimeout(t), 500*time.Millisecond)

// disable oracles to prevent price updates while we manually edit token prices
var disabledNodes []string
Copy link
Collaborator

Choose a reason for hiding this comment

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

disabling oracles could be extracted to a separate function, it would make the test easier to read

}, tests.WaitTimeout(t), 200*time.Millisecond)

// re-enable the oracles
for _, n := range disabledNodes {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similarly, probably you could extract disabling/enabling to separate functions

ExtraArgs: changeset.MakeEVMExtraArgsV2(uint64(chain0DestConfig.MaxPerMsgGasLimit), true),
},
},
//{ // TODO: exec plugin never executed this message.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please link the ticket in the comment

@mateusz-sekara mateusz-sekara self-requested a review December 3, 2024 13:22
Copy link
Contributor

@b-gopalswami b-gopalswami left a comment

Choose a reason for hiding this comment

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

Thanks for adding more tests!

@dimkouv dimkouv added this pull request to the merge queue Dec 3, 2024
Merged via the queue into develop with commit 8fa3cda Dec 3, 2024
180 of 183 checks passed
@dimkouv dimkouv deleted the dk/e2e-tests branch December 3, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants