Skip to content
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

nyc fails with "Unexpected token ILLEGAL" when execing shell script #34

Closed
boennemann opened this issue Jul 10, 2015 · 7 comments
Closed
Labels

Comments

@boennemann
Copy link

As first reported via https://twitter.com/boennemann/status/619103847043203072

I'm trying to instrument the integration tests for https://github.com/semantic-release/semantic-release.
They are running a shell script to start the npm-registry-couchapp before tap/nixt tests are running against it. Everything works fine, but once I run them with nyc I get this error (multiple times):

[eval]:1
/private/tmp/node-spawn-wrap-17602-9d862ee799ec/node
                                   ^
SyntaxError: Unexpected token ILLEGAL
    at Object.exports.runInThisContext (vm.js:53:16)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:426:26)
    at node.js:567:27
    at doNTCallback0 (node.js:408:9)
    at process._tickCallback (node.js:337:13)

Steps to reproduce:

git clone [email protected]:semantic-release/semantic-release.git
cd semantic-release
git fetch origin  next:next
git checkout next
npm install
npm run build && npm run test:build
npm run test:unit # nyc built in, passes and reports coverage
npm run test:integration # passes
nyc npm run test:integration # fails

You need couchdb installed. Sorry for the bloated test case, will try to reduce it if this doesn't get you anywhere.

The relevant script is here: https://github.com/semantic-release/semantic-release/blob/next/test/registry/start.sh
Which gets execd here: https://github.com/semantic-release/semantic-release/blob/next/test/registry/index.js#L9

@bcoe
Copy link
Member

bcoe commented Jul 10, 2015

CC: @isaacs

@bcoe
Copy link
Member

bcoe commented Jul 25, 2015

@boennemann haven't forgotten about this issue, but have been absolutely swamped lately. The most likely source of this issue is probably going to be somewhere in:

https://github.com/isaacs/spawn-wrap

Thanks for the test case, will dig into this as soon as I pop a few things off my stack.

@bcoe
Copy link
Member

bcoe commented Jul 25, 2015

@boennemann hope the semantic-release project is going well, I really liked hearing about the project at NodeConf Adventure.

@boennemann
Copy link
Author

@bcoe Thanks for the update! I absolutely understand that things take their time 👍
I've updated the original post, because the repo location changed.

Also thank you for the kind words 😊 Things are shaping up nicely and talking to you and the other npm folks directly helped a lot with it!

@bcoe
Copy link
Member

bcoe commented Feb 28, 2016

@boennemann finally dug into this issue, see:

istanbuljs/spawn-wrap#10

By simply ignoring start.sh in spawn-wrap, I was able to run your integration tests:

screen shot 2016-02-28 at 11 56 59 am

@bcoe
Copy link
Member

bcoe commented Apr 11, 2016

@boennemann could you create an up-to-date reproduction of this issue? @addaleax offered to help dig into the issue.

Alternatively, if everything is working well now perhaps we can close this?

@bcoe bcoe closed this as completed Jun 27, 2016
@bcoe
Copy link
Member

bcoe commented Jun 27, 2016

@boennemann feel free to reopen if you bump into this again, or have a chance to dust off this old issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants