-
Notifications
You must be signed in to change notification settings - Fork 122
feat(static tests) : do not compile test fillers source code while loading the models #1439
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: main
Are you sure you want to change the base?
Conversation
07588f0
to
65e4eee
Compare
65e4eee
to
8a295d3
Compare
Each legacy test filler has only 1 test per file if it's a !state test! So no need to create directory Add11/add11.json it can be plain add11.json
restored this logic |
needs to be called after filling of the fixtures has finished. or in case of exception or keyboard interrupt and we are exiting. |
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.
Looks great, just a few comments, let me know what you think about the docker alternative.
if raw_index != -1: | ||
compiled_code = self.code_raw[raw_index + len(raw_marker) :] | ||
|
||
# Prase :yul |
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.
# Prase :yul | |
# Parse :yul |
if not isinstance(self.code_raw, str): | ||
raise ValueError(f"parse_code(code: str) code is not string: {self.code_raw}") | ||
if len(self.code_raw) == 0: | ||
return bytes.fromhex("") |
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.
return bytes.fromhex("") | |
return b"" |
Tiny improvement.
# using lllc | ||
# result = subprocess.run(["lllc", tmp_path], capture_output=True, text=True) |
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.
I think it should be ok to just require this to be installed already.
At the moment, we prepare releases and fill tests using out external runners, and all of our current external runners point to our server that has already lllc
installed, so it should just work.
Downside would be that we would be unable to add unit tests for state static tests that contain lllc, but I think that should be ok.
yul_marker = ":yul" | ||
yul_index = self.code_raw.find(yul_marker) | ||
|
||
# Prase :raw |
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.
# Prase :raw | |
# Parse :raw |
optimize=options[1] if len(options) >= 2 else None, | ||
)[2:] | ||
|
||
# Prase :abi |
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.
# Prase :abi | |
# Parse :abi |
elif self.code_raw.lstrip().startswith("0x"): | ||
compiled_code = self.code_raw[2:].lower() | ||
|
||
# Prase lllc code |
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.
# Prase lllc code | |
# Parse lllc code |
@marioevz please don't merge there are bullet points to complete:
- [x] Make sure exceptions are working correctly after mapper refactoring (too many things to fix) #1440
the test generation is supported with lllc from docker hub.
https://hub.docker.com/r/winsvega/lllc
it works fast using docker exec. all we need is to pull a docker image in our CI