Suggestion: add link to multi-shell test CLI 'shall' to the read-me #15
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I've written a multi-shell testing CLI that I think complements Urchin nicely: shall.
(@ljharb, this may be of interest to you too.)
In short: by writing test scripts with
shallin the shebang line, they are automatically executed with multiple (specifiable) shells - see below for more.If you agree that it makes sense, I suggest adding a link to the Shall repo from Urchin's read-me.
I'm happy to suggest changes in a PR.
Example:
Say you have an executable script named
shallpgwith the following content:By using
shallin the shebang line, the script will be executed with multiple shells in sequence, by default - if installed - withsh,dash,bash,zsh,ksh, or as specified via option-lor theSHELLSenvironment variable; the exit code reflects the number of shells that reported failure (see the repo for more):@mklement0 This is very interesting. If you want to submit a PR that uses
shallinnvmfor multi-shell tests that would be awesome :-)Oh cool this was my idea with "#!/usr/bin/env urchin -x",
but I never got it working.
On 05 Jul 09:52, Jordan Harband wrote:
@ljharb Not sure when I can take a stab at this; let me know if you get around to it first.
@tlevine Do you want me to send a PR with proposed changes to the read-me?
Yes please, and I'll merge pretty much anything you write.
I already added two lines, but you'll write something better.
On 08 Jul 11:36, Michael Klement wrote:
Thanks for the vote of confidence, @tlevine - and thanks for what you've already added; hadn't noticed it. That's definitely a good start; let's see if inspiration strikes me...
@mklement0 i still haven't gotten around to this :-)
SHELLS=bash,sh,zsh,dash,ksh shall urchin -f test/install_script, for example, seems like it's working, but it's not running them in parallel, which makes it quite slow. Any chance there's a solution for that?@ljharb, note that
test/install_scriptwould need to useshallin its shebang line for this to work at all.shallisn't designed for parallel execution, and I've never tried it.You can use GNU
parallel, for instance, if you wanted to try it; whilexargs -Pworks in principle, it has no output grouping (keeping output from the various processes grouped together). Conversely, while GNUparalleldoes perform this grouping, it strips coloring from the output.Unless you care about
shall's output formatting, there's no good reason to run it in parallel with one shell each, because you can otherwise invoke the shells directly, which in the case ofurchinwould meanurchin -s <shell> -f test/install_scriptHere's a sample GNU
parallelcommandsshallinvocation:urchin:gotcha, i don't have
parallelavailable on every machine i need to test nvm on, so if shall doesn't have it directly, i might be best staying with just urchin for now.