Suggestion: add link to multi-shell test CLI 'shall' to the read-me #15
Loading…
Reference in New Issue
Block a user
No description provided.
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
shall
in 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
shallpg
with the following content:By using
shall
in 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-l
or theSHELLS
environment 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
shall
innvm
for 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_script
would need to useshall
in its shebang line for this to work at all.shall
isn'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 -P
works in principle, it has no output grouping (keeping output from the various processes grouped together). Conversely, while GNUparallel
does 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 ofurchin
would meanurchin -s <shell> -f test/install_script
Here's a sample GNU
parallel
commandsshall
invocation:urchin
:gotcha, i don't have
parallel
available 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.