Skip to content
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

docker: improve NEWMAN_VERSION check in Dockerfiles #2720

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

lightmare
Copy link

There were a few issues with the check (plus a typo in comment).

echo $NEWMAN_VERSION wasn't quoted, so if it started with whitespace, the check would pass. Later the npm install would of course fail, but if there's a sanity check, it should catch corner cases as well.

The if condition had unnecessary square brackets (test). Replaced with direct use of grep -q result.

On Alpine, echo by default doesn't interpret escape sequences, so the error message didn't show up red, but surrounded with garbage. Replaced with printf.

I didn't touch the Dockerfiles in deprecated alpine33 and ubuntu1404, assuming it's not worth fixing those.

- check the result of grep -q instead of testing the output of grep -o;
  it's shorter, and in my opinion less cryptic

- in ash, echo doesn't interpret escape sequences; echo -e does, but
  printf is more portable anyway
@codecov
Copy link

codecov bot commented Apr 21, 2021

Codecov Report

Merging #2720 (07b09ec) into develop (2a57036) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #2720   +/-   ##
========================================
  Coverage    91.55%   91.55%           
========================================
  Files           21       21           
  Lines         1113     1113           
  Branches       339      339           
========================================
  Hits          1019     1019           
  Misses          94       94           
Flag Coverage Δ
cli 82.38% <ø> (ø)
integration 41.95% <ø> (ø)
library 60.10% <ø> (ø)
unit 77.08% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a57036...07b09ec. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants