-
Notifications
You must be signed in to change notification settings - Fork 110
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
β¨ feat(et): add et make test
for interactively creating new tests
#950
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.
Love it, really fun to use. Few minor changes.
I'll get back to the fork options in a bit π
52896cb
to
1a877dd
Compare
@danceratopz I have patched in all your feedback. The
|
test
command to interactively new create test files
test
command to interactively new create test filestest
command for interactively creating new tests
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.
Thanks, I really like the idea of a more generalized command structure!
As we discussed async, @spencer-tb proposed an eest
namespace in #461. Inspired by uv
I would personally propose a shorter top-level command et
and add make
as a sub-command of that. Then we'd have uv run et make test
. I'm not a fan of using "make
" without a top-level command (as GNU Make is a very popular command - GNU Make), but not if it's a sub-command. Should we add et
in the scope of this PR with the sole sub-command et
and then add other sub-commands in follow-up PRs?
I'm enjoying the flair ποΈ, I'm not sure I like it in the context of make test
, as I want to prominently see the module name I'm creating (and perhaps the command to fill it, including --until=<fork>
if <fork>
is a development fork). Could you remove the quotes from the make test
output for now and we see where we can add something like this later on? But, feel free to leave src/cli/make/commands/quotes.py
as part of the PR if you like.
There's a couple of comments below, I'm starting to have more ideas, but perhaps we should try and not get too carried away for now π
re: command structureStrongly agree with re: quotesI wasn't too sure if this is the right place. We could either:
OR
For this CLI, we could show a message like so: π Success! Test file created at: {file_path}
π Get started with tests: https://ethereum.github.io/execution-spec-tests/v3.0.0/writing_tests
β½ To fill this test, run: `uv run fill {file_path} --until={fork}` |
This sounds good! I would prefer
This looks great. Please note that, since we fixed the the test module path in the reviews above,
For now we can populate these expected global variables with dummy values to make allow |
Done
Pending1. UX with test module nameI'm not too sure how this should be because I haven't had a lot of experience writing tests. 2. Ensure the new test file passes fill command.Unsure how to get the fill to pass. But I'm looking into it. |
Niiice! The fully populated fork selection menu is so nice.
We can leave this for now, gather feedback from the team & close collaborators and iterate in follow-up PR(s).
Had a quick look, sorry to gatecrash. It looks like the default env = Environment()
sender = pre.fund_eoa()
tx = Transaction(to=sender, sender=sender)
post: dict[str, dict] = {}
state_test(env=env, pre=pre, post=post, tx=tx) I don't understand why this triggers the exception it does ( I got this far quite quickly by running the generated test with the
More info here: |
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.
Thanks a lot for adding et
up front here. @spencer-tb gonna love it!
Just a couple of quick comments after trying the CLI out.
dac9049
to
c93a9bf
Compare
Fill now passes for all forks. This PR is now ready. |
Most tests will define a smart contract in the pre-state, include it in the template by default
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.
@raxhvl this is looking great. Love the et
umbrella command and uv run et make test
rolls off the fingers well. It's a fun feature that contributors will really love imo. Thanks for all your efforts on this!
I tested it out today and had a few small ideas. As we've already iterated so much on this I thought I'd join the party and add a few suggestions up front. I put them here:
raxhvl#1
β¦d-post-check feat(make): add a contract to templates and a few other nits
@danceratopz the top tier documentation made me feel as if I wrote these enhancements! I have merged these nice additions. |
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.
LGTM! π
test
command for interactively creating new testset make test
for interactively creating new tests (#950)
et make test
for interactively creating new tests (#950)et make test
for interactively creating new tests
ποΈ Description
Scaffold tests using CLI.
π Related Issues
closes #926, closes #946
β Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.