-
Notifications
You must be signed in to change notification settings - Fork 772
feat(load2): add contract tests #4071
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
base: master
Are you sure you want to change the base?
Conversation
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.
Commenting for context.
@@ -48,5 +114,231 @@ func (z ZeroTransferTest) Run( | |||
}) | |||
require.NoError(err) | |||
|
|||
require.NoError(wallet.SendTx(ctx, tx, z.PollFrequency)) | |||
require.NoError(wallet.SendTx(ctx, tx, time.Millisecond)) |
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.
Waiting on #4059 to be merged in to remove PollFrequency
parameter.
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.
Pull Request Overview
This PR migrates contract tests from the original load framework to load 2.0, replacing the simple ZeroTransferTest
with a comprehensive RandomTest
that can execute multiple test types with configurable weights.
- Introduces a new
RandomTest
struct that uses weighted sampling to select from multiple test types - Adds 10 new contract test implementations (ReadTest, WriteTest, StateModificationTest, etc.)
- Updates the main load generator to deploy a contract and use the new random test selection
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
tests/load2/tests.go | Adds RandomTest implementation and 10 contract test types with shared utility functions |
tests/load2/main/main.go | Updates main function to deploy contract and configure RandomTest with equal weights |
Why this should be merged
This PR migrates over the existing contract tests from the original load framework into load 2.0. This PR also replaces the type of test used in load 2.0 testing (
ZeroTransferTest
=>RandomTest
).How this works
Migration with the following caveats:
How this was tested
CI
Need to be documented in RELEASES.md?
N/A