-
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
Improve outcome-analysis.sh
script
#8011
Improve outcome-analysis.sh
script
#8011
Conversation
The Docker container used for the CI has Git version 2.7.4 which does not support the "git branch --show-current" command since this was added in version 2.22. Therefore this commit adds an alternative version for old Git versions. Signed-off-by: Valerio Setti <[email protected]>
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.
Please don't impose make -j
.
@@ -34,7 +34,7 @@ record() { | |||
export MBEDTLS_TEST_OUTCOME_FILE="$PWD/outcome-$1.csv" | |||
rm -f $MBEDTLS_TEST_OUTCOME_FILE | |||
|
|||
make check | |||
make -j check |
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.
Please don't use make -j
in CI scripts. That does unbridled parallelism which creates load spikes and seems to decrease CI performance overall. Even where load isn't a problem and the sole goal is processing time for this single build, increasing parallelism has diminishing returns: -j2
is significantly faster than single threading, -jNUMBER_OF_PROCESSORS
is a little faster than -j2
, going beyond that is pretty much no win.
We set MAKEFLAGS
to a reasonable -j
in our CI environments, so it's best to call make
without an explicit -j
in scripts.
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.
Ok, understood. Thanks for the explanation ;)
if dpkg --compare-versions "$GIT_VERSION" "gt" "2.22.0"; then | ||
HEAD=$(git branch --show-current) | ||
else | ||
HEAD=$(git rev-parse --abbrev-ref HEAD) |
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.
Why not always use this command? Is there a case where git branch --show-current
is better in some non-critical way?
We're planning to move most of our CI from Ubuntu 16.04 to 22.04 in the next quarter. We can move outcome analysis sooner if there's a strong benefit.
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 makes for slightly more understandable code if you can see that git rev-parse --abbrev-ref HEAD
is equivalent to git branch --show-current
for older versions of git. I did not personally know that before reviewing this PR for example. I think it is ok to leave it as is.
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 comment explaining what the command do would serve the same purpose and would reduce the complexity of the code.
The version check has added a dependency on dpkg
, so it will fail for developers who work on non-Debian-based systems (e.g. Fedora, macOS, ...). Also, it's wrong if someone has installed a more recent git
in their PATH
.
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.
The version check has added a dependency on dpkg, so it will fail for developers who work on non-Debian-based systems (e.g. Fedora, macOS, ...). Also, it's wrong if someone has installed a more recent git in their PATH
Ops, sorry, I didn't thought about these limitations. I will modify it as suggested
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 comment explaining what the command do would serve the same purpose and would reduce the complexity of the code.
The version check has added a dependency on
dpkg
, so it will fail for developers who work on non-Debian-based systems (e.g. Fedora, macOS, ...). Also, it's wrong if someone has installed a more recentgit
in theirPATH
.
Yep, fair enough on the dpkg
part, I agree.
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 agree about the make -j
comment so once that is changed I will approve. Thanks
Signed-off-by: Valerio Setti <[email protected]>
c030ace
to
ab02d39
Compare
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 - Pending CI. Will approve now but mark with "needs-ci" until CI completes just in case of an unforeseen issue.
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
Incidentally, I don't understand why you need this patch. (But it's a good patch anyway, it makes the script a bit more robust in case we turn out to want it.) We currently don't run |
Yes, correct, but when working on the ECC/BIGNUM EPICs I used 2 scripts:
I don't know if it's worth to add also the 2nd script to the CI since:
However the combination of the 2 scripts was/is useful for my activity in order to ensure that I don't break some support from the past. |
To add to what Valerio said, I'm not sure
|
outcome-analysis.sh
scripts should be run on the same Docker instance that is used by the CI in order to have also tests included byssl-opt
script to be executed with the proper OpenSSL/GnuTLS versions.Unfortunately that Docker instance have an old version of Git (2.7.4) which does not support a command used in this script:
This was added only in Git version 2.22.
As a consequence this PR:
PR checklist