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

-r flag not working in Travis CI #409

Closed
oreqizer opened this issue Nov 18, 2017 · 17 comments
Closed

-r flag not working in Travis CI #409

oreqizer opened this issue Nov 18, 2017 · 17 comments

Comments

@oreqizer
Copy link

https://travis-ci.org/oreqizer/creepx

Somehow tape thinks that -r is meant to be a file. When I tried -r=babel-register, it also complained that it's not a module. It works fine locally, only broken in Travis CI.

Here's the error report:

$ npm run clean && npm test && npm run test:flow && npm run lint && npm run build
> creepx@0.2.0 clean /home/travis/build/oreqizer/creepx
> rimraf es lib
> creepx@0.2.0 test /home/travis/build/oreqizer/creepx
> npm run test:base | faucet
module.js:544
    throw err;
    ^
Error: Cannot find module '/home/travis/build/oreqizer/creepx/-r'
    at Function.Module._resolveFilename (module.js:542:15)
    at Function.Module._load (module.js:472:25)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at /home/travis/build/oreqizer/creepx/node_modules/faucet/node_modules/tape/bin/tape:5:5
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/home/travis/build/oreqizer/creepx/node_modules/faucet/node_modules/tape/bin/tape:4:23)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! creepx@0.2.0 test:base: `tape -r babel-register 'src/**/__tests__/*.spec.js'`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the creepx@0.2.0 test:base script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/travis/.npm/_logs/2017-11-18T06_53_29_241Z-debug.log
@ljharb
Copy link
Collaborator

ljharb commented Nov 18, 2017

(-r arg is the proper form, fwiw)

Can you share your travis.yml? It's pretty strange that it wouldn't interpret that properly.

@oreqizer
Copy link
Author

oreqizer commented Nov 18, 2017

language: node_js

node_js:
  - "stable"

script:
  - npm run test:coverage
  - npm run test:flow
  - npm run lint

after_success:
  - bash <(curl -s https://codecov.io/bash)

EDIT

My package.json scripts:

  "scripts": {
    "test": "tape -r babel-register 'src/**/__tests__/*.spec.js'",
    "test:nyan": "npm test | tap-nyan",
    "test:faucet": "npm test | faucet",
    "test:coverage": "nyc --reporter=lcov > coverage.lcov npm test",
    "test:flow": "flow check",
    "lint": "eslint './**/*.js'",
    "build": "gulp build",
    "clean": "rimraf es lib",
    "prepare": "npm run clean && npm test && npm run test:flow && npm run lint && npm run build"
  },

@ljharb
Copy link
Collaborator

ljharb commented Nov 18, 2017

and presumably you have babel-register in your package.json? If it's installed locally but not actually listed in your dependencies, that would cause it to not be installed in travis, which might mean it's treated as a file path instead.

@oreqizer
Copy link
Author

Yes, here's my whole package.json:

https://github.com/oreqizer/creepx/blob/master/package.json

Didn't want to paste the whole thing so it's not bloated here

@snuggs
Copy link
Contributor

snuggs commented Nov 19, 2017

HMM @oreqizer @ljharb will reach out to Travis and see what's good.

@jameswomack

This comment has been minimized.

@snuggs

This comment has been minimized.

@snuggs

This comment has been minimized.

@jameswomack

This comment has been minimized.

@snuggs

This comment has been minimized.

@snuggs

This comment has been minimized.

@snuggs

This comment has been minimized.

@ljharb
Copy link
Collaborator

ljharb commented Nov 29, 2017

ok this is getting a bit chatty; let's please keep the noise to a minimum.

If there's an update about this issue, please post it - if not, please quietly continue pursuing leads in separate channels :-)

@snuggs
Copy link
Contributor

snuggs commented Dec 1, 2017

@ljharb please take this over yourself since this seems to annoy you. Respectfully!. I've done all I can do. Do you have access to SSH? If so the ball is in your court. Please and thank you! Merely attempting to take light of a situation that has already taken up far more back and forth than need to be. Good luck with Travis sir. As they have already asked me if there has been any updates on tape's end.

@ljharb
Copy link
Collaborator

ljharb commented Dec 1, 2017

@snuggs i cant ssh into the build vm of “not my repo”, no. I appreciate your help here, but Github notifications are very noisy already, and light chatter makes it harder for actual work to get done.

If someone could provide a failing test case - that fails in travis-ci consistently - I’m happy to fix it, otherwise I’ll have to close this since it can’t be reproduced.

@oreqizer
Copy link
Author

oreqizer commented Dec 2, 2017

Try to run tape -r babel-register 'src/**/__tests__/*.spec.js' in Travis. This fails in all of my repos that have that script.

@ljharb
Copy link
Collaborator

ljharb commented Dec 2, 2017

https://travis-ci.org/ljharb/tape/builds/310646335 passes (efbf84c). That's not invoking tape directly, it's invoking node path/to/tape/bin, but I'm not sure how that would be different. I also ran https://travis-ci.org/ljharb/tape/builds/310653043 with babel-register specifically, and it still passes.

I then added a pre-script run of ./bin/tape -r babel-register test/require/a.js and that also passed: https://travis-ci.org/ljharb/tape/builds/310654127

@ljharb ljharb closed this as completed Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants