mix-test.watch
mix-test.watch copied to clipboard
Improve zombie_killer compatability
Problem:
- Combination of zombie_killer and test command quotes are causing the unit tests to not run
Solution:
- Remove use of exec in sh script because it is being used incorrectly
- Change command quoting to match what is conventionally used with sh -c
Fixes #110
When I run this version of the script on MacOS it works (the tests run), but it re-raises the issue that https://github.com/lpil/mix-test.watch/pull/106 was intended to address—that is, it doesn't kill the test process when the watcher is killed. I can see this happen when I run mix test.watch
on a test suite that runs for about 20s, killing the watcher with Ctrl-C
, and then running ps -ef | grep mix
.
I don't think I understand the issue arising from using read
with no args (though I'm no shell scripting expert), and I wasn't able to reproduce it on my version of sh
on my machine, but when I run the script with only the while read UNUSED; do :; done
change, it still works for me. Does that solve the problem you were running into?
Another possibility would just be replacing #!/usr/sh
with #!/usr/bash
—I know that technically sh
is more portable than bash
, but what *nix system doesn't have bash
? Maybe bash would still be portable enough?