-
Notifications
You must be signed in to change notification settings - Fork 167
fix(consume): consume_direct.sh
files contained invalid commands because value after --filter
flag was not enclosed in parenthesis (issue reported by flcl42)
#1987
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
Open
felix314159
wants to merge
3
commits into
ethereum:main
Choose a base branch
from
felix314159:consume-direct-sh-fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 hidden or 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.
Afaik, all parameters that contain spaces need to be enclosed in double-quotes, not only the ones after filter, and not only for the nethermind commands.
Should we look into pre-processing the
command
parameter before it's passed to this function?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.
A quick gpt-query yields that we should use
shlex.quote
on every parameter to handle this automatically:Output:
And
shlex
is included in the default libraries so no new package dependencies.Uh oh!
There was an error while loading. Please reload this page.
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 have not heard of shlex before, so I think it will be harder to read the code if someone sees
shlex.quote()
because chances are the reader is not familar with that function. But the current solution is just a few lines of trivial code. I also saw in shlex docs that that function seems to be incompatible with windows, I know that windows support itsn't a prio but why make potential future support harder for no reason.We could add pre-processing to
command
but we need separate logic for fixing the sh command produced by geth's evm anyway, so its simpler to have separate fixes for nethtest and geth and then decide to not add support for more execution clients. For geth's evm specifically we create faulty .sh files for blockchain tests, I will add another commit to fix it too. All problems are just results from our decision to allow weird chars like:
,[
and]
in filenames which makes escaping of names ugly and error-prone.Uh oh!
There was an error while loading. Please reload this page.
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.
Working on this takes me longer than expected because I can't get logging to work for some reason. Edit: found temporary workaround
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.
Just for clarification, they are part of the test names, not file names, this is a pytest intrinsic issue.
This will end up in a
.sh
file anyway, which needs bash to run. If required it we could build a windows script in the future but I feel like that's out of scope for this PR.That's true, I haven't heard of it before but (a) this is deep into the weeds of the code anyway, I would be more concerned if this was part of a test, and (b) it's really easy to look it up.
Uh oh!
There was an error while loading. Please reload this page.
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.
Yeah good point with the
.sh
lol.. I would not be against shlex if I didn't already build a solution. Can re-do this PR and start from scratch (and use shlex) if you want