mbland / go-script-bash

Framework for writing modular, discoverable, testable Bash scripts
ISC License
95 stars 16 forks source link

tests/template: Make fake tarball with BusyBox, and skip tests if programs are missing #185

Closed mbland closed 7 years ago

mbland commented 7 years ago

Making fake tarball with BusyBox

After thinking about it, I realized the tar: lseek: Invalid seek error produced by the BusyBox tar on Alpine Linux might be eliminated by having tar read from standard input rather than using -f to access directly the /dev/fd file created by the process substitution.

Also updated all the tar commands to make their invocations more consistent with one another.

Skipping test cases

Most of the test cases will now be skipped if any of the required programs are missing, rather than failing and requiring the user to investigate.

Whereas skip_if_system_missing will skip a test case if any of the specified programs are missing, skip_if_none_present_on_system will skip a test case only if all of the programs are missing. I'll move it to lib/bats/helpers in a future commit.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 94.605% when pulling 80452101498559a9869940a51d84e800fcca883b on skip-template-test into de7ce6ccdc6a592e255bc01635c6df4b8ddd2f63 on master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 94.605% when pulling 80452101498559a9869940a51d84e800fcca883b on skip-template-test into de7ce6ccdc6a592e255bc01635c6df4b8ddd2f63 on master.