-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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-3428 Enabling ccip smoke test for testnet #14452
Changes from 17 commits
df3df9d
9106334
65efde9
99ab4c1
357acdc
e5385f7
09bd660
471f296
c1cea87
1ab2860
792dd3b
3a11caa
55abd7e
919694f
b8bd80a
89211b9
6d75aa6
fd7d29b
66e937f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,7 +72,15 @@ func ConfirmCommitWithExpectedSeqNumRange( | |
} | ||
|
||
defer subscription.Unsubscribe() | ||
timer := time.NewTimer(5 * time.Minute) | ||
var duration time.Duration | ||
deadline, ok := t.Deadline() | ||
if ok { | ||
// add a minute to the deadline to ensure we don't miss it | ||
duration = deadline.Sub(time.Now().Add(-1 * time.Minute)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the downside of hitting the deadline other than failing with a timeout which will happen anyways? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no real downside other than log output after the test times out, the test runtime will print all running goroutines and their stack |
||
} else { | ||
duration = 5 * time.Minute | ||
} | ||
timer := time.NewTimer(duration) | ||
defer timer.Stop() | ||
ticker := time.NewTicker(2 * time.Second) | ||
defer ticker.Stop() | ||
|
@@ -91,8 +99,8 @@ func ConfirmCommitWithExpectedSeqNumRange( | |
case subErr := <-subscription.Err(): | ||
return fmt.Errorf("subscription error: %w", subErr) | ||
case <-timer.C: | ||
return fmt.Errorf("timed out waiting for commit report on chain selector %d from source selector %d expected seq nr range %s", | ||
dest.Selector, src.Selector, expectedSeqNumRange.String()) | ||
return fmt.Errorf("timed out after waiting %s duration for commit report on chain selector %d from source selector %d expected seq nr range %s", | ||
duration.String(), dest.Selector, src.Selector, expectedSeqNumRange.String()) | ||
case report := <-sink: | ||
if len(report.Report.MerkleRoots) > 0 { | ||
// Check the interval of sequence numbers and make sure it matches | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
## Overview | ||
|
||
This package is used to create ephemeral environment for local/CI testing. | ||
It sets up an environment with local Docker containers running Chainlink nodes and a job distributor. | ||
It can either create new simulated private Ethereum network containers or connect to existing testnets/mainnets. | ||
|
||
### Run Tests with Devenv | ||
|
||
The tests created with this environment are run as [end-to-end integration smoke tests](../../smoke). | ||
|
||
#### Setting Up Testconfig with Simulated Private Ethereum Network | ||
|
||
To run tests (e.g., [ccip-test](../../smoke/ccip_test.go)), | ||
you need to set up the testconfig following the [testconfig setup instructions](../../testconfig/README.md). | ||
The testconfig specifies the details of the different configurations to set up the environment and run the tests. | ||
Generally, tests are run with the [default](../../testconfig/default.toml) config unless overridden by product-specific config. | ||
For example, the [ccip-test](../../smoke/ccip_test.go) uses [ccip.toml](../../testconfig/ccip/ccip.toml) to specify | ||
CCIP-specific test environment details. | ||
|
||
There are additional secret configuration parameters required by the `devenv` environment that are not stored in the testconfig. | ||
These are read from environment variables. For example, Chainlink image, Job-Distributor image, etc. | ||
All such environment variables are listed in the [sample.env](./.sample.env) file. | ||
You can create a `.env` file in the same directory of the test and set the required environment variables. | ||
|
||
#### Setting Up Testconfig for Running Tests with Existing Testnet/Mainnet | ||
|
||
To run tests with existing testnet/mainnet, set up the testconfig with the details of the testnet/mainnet networks. | ||
Following the integration-test [testconfig framework](../../testconfig/README.md#configuration-and-overrides), | ||
create a new `overrides.toml` file with testnet/mainnet network details and place it under any location in the `integration-tests` directory. | ||
By default, tests are run with private Ethereum network containers set up in the same Docker network as | ||
the Chainlink nodes and job distributor. To run tests against existing testnet/mainnet, | ||
set the `selected_network` field in the testconfig with the specific network names. | ||
|
||
For example, if running [ccip-smoke](../../smoke/ccip_test.go) tests with Sepolia, Avax, and Binance testnets, | ||
copy the contents of [sepolia_avax_binance.toml](../../testconfig/ccip/overrides/sepolia_avax_binance.toml) | ||
to the `overrides.toml` file. | ||
|
||
Before running the test, ensure that RPC and wallet secrets are set as environment variables. | ||
Refer to the environment variables pattern in the [sample.env](./.sample.env) file to | ||
provide necessary secrets applicable to the network you are running the tests against: | ||
- `E2E_TEST_<networkName>_WALLET_KEY_<sequence_number>` | ||
- `E2E_TEST_<networkName>_RPC_HTTP_URL_<sequence_number>` | ||
- `E2E_TEST_<networkName>_RPC_WS_URL_<sequence_number>` | ||
|
||
Now you are all set to run the tests with the existing testnet/mainnet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure you can tweak a deadline this way - I believe the Go test runner will just kill the test once its past the deadline. Is this what you want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I think this comment is a bit misleading, maybe "make the timer end a minute before the deadline so we don't miss it"