-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Use all.sh and its component list in pre-push hook #2639
Use all.sh and its component list in pre-push hook #2639
Conversation
It brings no value and distracts us from the actual content. Signed-off-by: Manuel Pégourié-Gonnard <[email protected]>
The primary purpose is to use it to run all.sh -k -q in the pre-push hook, but this can be useful in any circumstance where you're not interested in the full output from each component and just want a short summary of which components were run (and if any failed). Note that only stdout from components is suppressed, stderr is preserved so that errors are reported. This means components should avoid printing to stderr in normal usage (ie in the absence of errors). Currently all the `check_*` components obey this convention except: - check_generate_test_code: unittest prints progress to stderr - check_test_cases: lots of non-fatal warnings printed to stderr These components will be fixed in follow-up commits. Signed-off-by: Manuel Pégourié-Gonnard <[email protected]>
Signed-off-by: Manuel Pégourié-Gonnard <[email protected]>
Signed-off-by: Manuel Pégourié-Gonnard <[email protected]>
The list in the pre-push hook was redundant with the list of `check_*` components in all.sh, and unsurprisingly it was outdated. Missing components were: - check_recursion - check_changelog - check_test_cases - check_python_files - check_generate_test_code Signed-off-by: Manuel Pégourié-Gonnard <[email protected]>
25c637f
to
129e13c
Compare
@gilles-peskine-arm I've force-pushed a version with a new history, as I don't think the initial fiddling in |
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.
There are still a few minor problems with output suppression in all.sh
.
I timed the old hook at 40s and the new one at 53s. It would be nice to only check what's change, but that would be a lot of work. I don't personally care since I don't use the hook anyway (let the CI take care of testing, that's my philosophy).
Since dd prints everything on stderr, both normal status update and actual errors when they occur, redirecting that to /dev/null is a trade-off that's acceptable in quiet mode (typically used on a developer's machine and the developer will re-run in non-quiet mode if anything fails without sufficient detail in the output), but not that much in non-quiet mode. For example, if our dd invocation fails because the disk in full on a CI machine, we want the error to be reported at the time we invoke dd, and not later when a seemingly unrelated test fails due to an incorrect seedfile. Signed-off-by: Manuel Pégourié-Gonnard <[email protected]>
While pure sh doesn't have a concept of local variables, we can partially emulate them by unsetting variables before we exit the function, and use the convention of giving them lowercase names to distinguish from global variables. Signed-off-by: Manuel Pégourié-Gonnard <[email protected]>
@gilles-peskine-arm I believe I've addressed all your feedback, except one that you indicated was not a blocker. This is ready for you to review again. |
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. Nice change, now I will use tests/scripts/all.sh -q -k 'check_*' to check my commits before to push them to the CI.
Description
Currently there is some level of duplication between all.sh and the pre-push hook: when a fast check is added to all.sh we have to remember to add it to the pre-push hook as well.
This commit adds five components that were previously not run:
check_recursion
check_changelog
check_test_cases
check_python_files
check_generate_test_code
It also changes the behaviour in case in-tree cmake was enabled before pushing or otherwise running the pre-push hook: previously the script failed because check_names is not compatible with cmake, now it silently disables cmake (and succeeds unless there is an actual issue).
Status
READY
Requires Backporting
Yes, as it's a test script.
Migrations
NO
Manuel testing
Though the most important case to test is
tests/scripts/all.sh -q -k 'check_*'
with and without errors, as that's what's used in the pre-push hook, I believe the full test matrix is 2x2x2:--quiet
/--no-quiet
--keep-going
/--no-keep-going
library/aes.c
)I don't think it's really useful at this point to test anything other that the
check_*
components with-q
.