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
tests: modernize tests.session and port everything using it #8781
Merged
Conversation
This file contains 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
According to the tools agreement, the program is now called tests.session. The bulk of the rename was done with: find -type f -exec sed -i -e 's/session-tool/tests.session/g' {} \ In addition, the related tests were renamed to match. Note that this change breaks compatibility and requires incoming patches to be adjusted. Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
According to the tools agreement, this is one of the commonly used tools, that lives on PATH. Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
According to the tools agreement, actions are proper sub-commands, not options. This is a partial change, more is done in subsequent patches. This is an entirely automatic change: find -type f -exec sed -i -e 's/tests.session -u test --prepare/tests.session -u test prepare/g' {} \; Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
According to the tools agreement, actions are proper sub-commands, not options. This is a partial change, more is done in subsequent patches. This is an entirely automatic change: find -type f -exec sed -i -e 's/tests.session -u test --restore/tests.session -u test restore/g' {} \; Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
According to the tools agreement, executing a command in a session needs to be a proper sub-command. This is an almost entirely automatic change. The result was hand-edited to replace "tests.session ... exec -p ARG" with "tests.session ... -p ARG exec": find -type f -exec perl -pi -e 's/tests.session -u (\S+) (?!prepare|restore|exec)/tests.session -u \1 exec \2/g' {} \; The use of perl is to allow for negative lookahead, which sed does not support. Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
This completes the transition, capturing rarely used sub-commands like, dump, kill-leaked and a few of the query-type commands. This is an entirely automatic change: find -type f -exec perl -pi -e 's/tests.session --/tests.session /g' {} \; Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
All existing invocations of tests.session --foo were replaced with tests.session foo, compatibility code can now be dropped. Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
Use explicit "tests.session exec" instead. Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
This test was merged after I completed the patches in this branch so I just ported it manually for simplicity. Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
pedronis
approved these changes
Jun 2, 2020
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.
thank you
mvo5
approved these changes
Jun 2, 2020
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.
Thank you
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The main intent is to make tests.session match the specification in the tools
directory. Apart from the new name, "exec" is now required to run anything and
all actions are invoked as sub-commands, not as long options.
Bulk of the changes are entirely automatic and are documented in particular
commit messages. There's a handful of hand-edits and one test was ported by
hand entirely, after re-basing on top of new master.