-
-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cross-shell tests mistakenly run everything with sh #551
Comments
sh
cc @koenpunt |
@ljharb: If the urchin PR gets merged and published, then the only change required on the |
Awesome, thanks! |
Just remove the |
@drj11: Unfortunately, as I noted above, not all POSIX-like shells work this way:
|
@ljharb Unfortunately, my approach to solving this problem by adding a new feature to urchin was misguided. However, the good news is that there is a solution that works with urchin's current version. It is outlined at scraperwiki/urchin#9 I will take a closer look soon, in conjunction with further makefile changes. |
So all our test files need to have a shell line at the top?? That seems pretty onerous. |
Indeed, it's not pretty, but it's the only solution I see at the moment. My original approach - the I'm not sure the maintainers of urchin (@drj11) would go for adding a feature with such limited scope, especially given that it can mislead people into thinking (as it did me originally) that it also works for directly invoking scripts to test. That said, @tlevine has said at https://github.com/scraperwiki/urchin/pull/9#issuecomment-59350954 that he's thinking about a better solution - I'll post more thoughts there. |
I like the -s option for its simplicity, and I think it's fine to My current thinking for Urchin is to make a separate executable that See the ./all-shells file in the "multiple-shells" branch of I think this would work for the situation where shell scripts are run On 16 Oct 06:35, Michael Klement wrote:
|
@tlevine Let's continue the discussion at scraperwiki/urchin#11. @ljharb Just to get a sense: Should the urchin maintainers decide not to implement support for cross-shell tests, we're left with 2 options:
If we had to make this choice, what would be your preference? |
If we had to fork urchin, I'd absolutely want it to be a separate published module on npm. If we require that preamble, we'd need another test that would fail if any files inside the test dir were missing it. I'm really not happy with either one. I'd use the former, if there's a likelihood we'd switch off of urchin at some point (#429), but otherwise I'd probably go with the latter. |
@ljharb The outlook is promising, fortunately: After rethinking the original approach, I've submitted a new PR (scraperwiki/urchin#12), which not only would help the nvm tests but is a worthwhile addition to urchin itself, I think; the feedback is encouraging so far. If implemented, the only change required on the Re replacing urchin: I quite like its simplicity - based on conventions, no DSL to learn; the only notable missing feature is TAP (machine-parseable) output. |
Awesome, thanks so much for your persistence on this, and for discovering the problem! This is one of the blockers for v1.0 :-) |
@ljharb: My pleasure; let's hope it proceeds as planned. |
This is now fixed; thanks to @mklement0 for recognizing and unilaterally fixing this problem! |
The cross-shell tests specified in
.travis.yml
/ runnable withmake test
do not work as intended, because it is onlyurchin
itself that gets invoked with the various shells, not the test scripts:urchin
invokes test scripts directly, so that each script's shebang line is respected, and they're all set to#!/bin/sh
.In other words: irrespective of what shell
urchin
was invoked with, the test scripts are always run withsh
.Seems to me that you'd have to change
urchin
itself in order to support invocation of test scripts with a specifiable shell.Note that simply removing the shebang lines from the test scripts is NOT an option, because different shells have different default behavior (some process shebang-less files as themselves, others default to
sh
).The text was updated successfully, but these errors were encountered: