purpleidea / mgmt

Next generation distributed, event-driven, parallel config management!
https://purpleidea.com/tags/mgmtconfig/
GNU General Public License v3.0
3.67k stars 315 forks source link

test: Fix implicit test fail in test-markdownlint #619

Closed frebib closed 3 years ago

frebib commented 3 years ago

Fix the silent test failure by catching the uncaught error from command, handling the failure gracefully.

$ bash -x test/test-markdownlint.sh
...
++ command -v mdl
+ MDL=
$ echo $?
1

$ bash -x test/test-markdownlint.sh
...
++ command -v mdl
+ MDL=
+ true
+ '[' -z '' ']'
+ fail_test 'The '\''mdl'\'' utility can'\''t be found.'
+ echo -e 'FAIL: The '\''mdl'\'' utility can'\''t be found.'
FAIL: The 'mdl' utility can't be found.

Fix a couple of glaring shellcheck warnings and errors mostly surrounding variable quoting.

Signed-off-by: Joe Groocock me@frebib.net

purpleidea commented 3 years ago

LGTM. Please excuse all my terrible bash habits!

purpleidea commented 3 years ago

Merged, thanks!