-
Notifications
You must be signed in to change notification settings - Fork 4
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
Andrew7234/e2e extension #627
Conversation
c0017a4
to
0d22ce0
Compare
If we do that (I think Warren has a good use case; roothash events were quite different in cobalt), it should be a separate PR. It's a nontrivial task to identify a good range and relevant queries for that range. I recently did that for Eden and was surprised at how long it took me.
Without looking, my guess is that they query stuff from the genesis. I'll just note that it's possibly still valuable to keep those seemingly duplicated tests because genesis parsing has some code that is specific to each of the three "generations" (eden, damask, cobalt). |
The cause of this weird status is that test-e2e-regression is a merge blocker for this github repo. You can't tell github "all checks have to pass"; you have to instead list the required tests. So when tests change names, it's a minor PITA. I'll disable the requirement right before your PR goes in, and re-enable (with new names) after that. |
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 Andy! I just have some minor comments around code organization, overall this looks good! Looking forward to more robust tests :)
Makefile
Outdated
accept-e2e-regression-eden: | ||
@# Delete all old expected files first, in case any test cases were renamed or removed. | ||
rm -rf ./tests/e2e_regression/eden/expected | ||
@# Copy the actual outputs to the expected outputs. | ||
cp -r ./tests/e2e_regression/eden/{actual,expected} | ||
@# The result of the "spec" test is a special case. It should always match the | ||
@# current openAPI spec file, so we symlink it to avoid having to update the expected | ||
@# output every time the spec changes. | ||
rm ./tests/e2e_regression/eden/expected/spec.body | ||
ln -s ../../../../api/spec/v1.yaml ./tests/e2e_regression/eden/expected/spec.body |
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.
Hm this really is pushing it for duplication :(. Especially with the finicky stuff in this recipe it feels risky that we'll update one recipe but not its near-copy.
I suggest we do one of two things:
- wrap this into a shell script, call it with different args.
accept-e2e-regression-eden
andaccept-e2e-regression-damask
can go away then. - use env variables to parametrize makefile targets. sth like
accept-e2e-regression-single:
ifndef SUITE
$(error Env variable SUITE must be defined)
endif
rm -rf ./tests/e2e_regression/$(EDEN)/expected
etc
accept-e2e-regression:
SUITE=eden make accept-e2e-regression-single
SUITE=damask make accept-e2e-regression-single
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.
Hmm I'd prefer not to split the logic into multiple files, esp if we end up doing the same for fill-cache
and test-e2e
.
Makefile doesn't pass the shell vars to the subcommands though. I'll keep poking at it. Edit* it also doesn't pass env vars to sub-make commands.
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.
Makefile (or rather make
) doesn't technically pass env variables to bash; it substitutes them into the command before the command reaches bash. Note that my snippet above has $(EDEN)
, not ${EDEN}
. The former is make
syntax for var substitution. Does that work? I have toy examples locally that work but I might be missing something.
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.
Hm I think the main issue I'm seeing rn is that the makefile ifndef
needs to be at the top level and not within a recipe. To check whether a variable is defined within a recipe, we'd use the shell scripting, but bash and zsh have different syntax for doing this and having conditional logic based on the shell in a makefile seems to be a cardinal sin. (Side note: Recent versions of bash/zsh both use the [[ -v SUITE ]]
syntax, but it isn't supported in the default bash version on macs (3.2))
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.
Well we can just unindent the ifndef
block and it works.. though it looks messy:
accept-e2e-regression-suite:
ifndef SUITE
$(error SUITE is undefined)
endif
@# Delete all old expected files first, in case any test cases were renamed or removed.
rm -rf ./tests/e2e_regression/$(SUITE)/expected
We could instead define a separate recipe to check that the env var is set:
check-suite:
ifndef SUITE
$(error SUITE is undefined)
endif
Edit**: Went with the first option
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.
Huh I've certainly learned more about Makefiles through this :). Sorry it's such a time-consuming process. Nice solution in the end IMO!
though it looks messy
Fun fact: make
is from the 70s. It's amazing it won't die.
The syntax is about as charming as the tan-striped nicotine-stained couches of the 70s ...
0d22ce0
to
f81c82d
Compare
f81c82d
to
4390d46
Compare
script tweaks for multiple regression ranges add/rename test files for eden/damask ranges add/rename test files for eden/damask ranges update ci remove outdated script undo tweaks to run on local machine nits address comments fix makefile check address comments rebase e2e test updates remove /actual
4390d46
to
c8e417d
Compare
Task
We'd like to run e2e_regression against multiple block ranges. The first range we'd like to add is the old Damask one.
Implementation details TBD. A possible approach we were brainstorming with @pro-wh in the office yesterday:
e2e_regression
target just runs all the new targets.tests/e2e_regression/<range_name>/{actual,expected,rpc_cache}
.This PR
This PR extends the e2e_regression tests to accommodate multiple block ranges. Broadly speaking, it
tests/e2e_regression
. The current block range is stored intests/e2e_regression/eden
.run.sh
are now binned by their target block range.For reviewers: Going commit by commit might be helpful.
Todo: