-
-
Notifications
You must be signed in to change notification settings - Fork 337
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
ci: add support for the CI env for e2e tests #5488
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
215f547
Add support for the CI env for e2e tests
nazarhussain b0d7f11
Update the port number e2e tests node
nazarhussain d2f43d5
Update the script
nazarhussain 0991ad1
Update the e2e script
nazarhussain 987d098
Stop the e2e tests env
nazarhussain f976adb
Update the script to stop env
nazarhussain f50acdb
Add a timeout for port
nazarhussain cd29d3e
Redirect nohup output
nazarhussain 27e5742
Redirect nohup output
nazarhussain 75ad9f0
Update the process signal
nazarhussain 2a55257
Merge branch 'unstable' into nh/e2e-ci-env
nazarhussain 1648409
Move the run bash script to a file
nazarhussain 530e3d2
Merge branch 'nh/e2e-ci-env' of github.com:ChainSafe/lodestar into nh…
nazarhussain 77f5f32
Remove the unwanted wait time
nazarhussain eee8ad4
Update the variaable name
nazarhussain 3e13905
Update the script name
nazarhussain 3fda47f
Update the test env
nazarhussain ade0c36
Update the e2e env to start from capella
nazarhussain 9813e46
Increase the genesis delay
nazarhussain 392cc54
Pass three epoch to fix the sync comittee availability
nazarhussain deb9e49
Increase the wait epoch
nazarhussain d264f42
Wait for the 3rd epoch
nazarhussain 954c154
Increase timeout
nazarhussain 6fbbd28
Add lodestar preset value
nazarhussain f3c68a7
Fix env variable
nazarhussain 49a603c
Set the forks in incremental sequence
nazarhussain 1a6122c
Increase the timeout
nazarhussain 5564ba8
Move wait logic to test file
nazarhussain 694fef5
Fix the geth version
nazarhussain 3d36bbb
Allow to pass custom config to support custom network
nazarhussain 0279d8c
Fix lint error
nazarhussain b536500
Add minimal preset for the e2e tests
nazarhussain 2580a87
Merge branch 'unstable' into nh/e2e-ci-env
nazarhussain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import path from "node:path"; | ||
import {CLClient, ELClient} from "../utils/simulation/interfaces.js"; | ||
import {SimulationEnvironment} from "../utils/simulation/SimulationEnvironment.js"; | ||
import {getEstimatedTTD, logFilesDir} from "../utils/simulation/utils/index.js"; | ||
import {connectAllNodes} from "../utils/simulation/utils/network.js"; | ||
|
||
const secondsPerSlot = 4; | ||
const cliqueSealingPeriod = 5; | ||
const genesisDelaySeconds = 30 * secondsPerSlot; | ||
const altairForkEpoch = 1; | ||
const bellatrixForkEpoch = 2; | ||
const capellaForkEpoch = 3; | ||
// Make sure bellatrix started before TTD reach | ||
const additionalSlotsForTTD = 2; | ||
|
||
const ttd = getEstimatedTTD({ | ||
genesisDelaySeconds, | ||
bellatrixForkEpoch, | ||
secondsPerSlot, | ||
cliqueSealingPeriod, | ||
additionalSlots: additionalSlotsForTTD, | ||
}); | ||
|
||
const env = await SimulationEnvironment.initWithDefaults( | ||
{ | ||
id: "e2e-test-env", | ||
logsDir: path.join(logFilesDir, "e2e-test-env"), | ||
chainConfig: { | ||
ALTAIR_FORK_EPOCH: altairForkEpoch, | ||
BELLATRIX_FORK_EPOCH: bellatrixForkEpoch, | ||
CAPELLA_FORK_EPOCH: capellaForkEpoch, | ||
GENESIS_DELAY: genesisDelaySeconds, | ||
TERMINAL_TOTAL_DIFFICULTY: ttd, | ||
}, | ||
}, | ||
[ | ||
{id: "node-1", cl: CLClient.Lodestar, el: ELClient.Geth, keysCount: 32, mining: true}, | ||
{id: "node-2", cl: CLClient.Lodestar, el: ELClient.Nethermind, keysCount: 32}, | ||
] | ||
); | ||
|
||
await env.start({runTimeoutMs: 0}); | ||
await connectAllNodes(env.nodes); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Does this approach leave a network alive for the entire duration of the tests? Which is going through forks? If yes, this means test outcomes of different e2e tests influence each other since they share global state, is that correct?
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.
Yes the network will be alive through out execution of all e2e tests. It's like connecting to external node, but with this the node is configured and running locally.
Every e2e tests should scaffold their specific network condition on this live network. e.g. If one test need to a contract, can deploy it. Or one network need a specific account, can transfer funds from genesis account. This way execution of tests would not effect each other.