Skip to content
This repository was archived by the owner on Sep 14, 2022. It is now read-only.

Running test with Travis #527

Open
vadymhimself opened this issue Oct 18, 2017 · 3 comments
Open

Running test with Travis #527

vadymhimself opened this issue Oct 18, 2017 · 3 comments

Comments

@vadymhimself
Copy link

I'm trying to deploy my app through Travis CI, but it fails the test phase because of the error:

> swagger project test
sh: 1: swagger: not found
npm ERR! Test failed.  See above for more details.

Is there a way to run the tests without having the swagger module installed on the remote machine?

@arne-at-daten-und-bass
Copy link

Is the swagger module itself listed as a dependency in your package.json (and not only e.g. the swagger-express-mw module) ?

If I remember correctly I had this one too when deploying to Travis CI and could fix it by adding the swagger module (as a locally installed dependency ... and thus in the PATH) in my package.json.

@vadymhimself
Copy link
Author

@arne-at-daten-und-bass but that seems to be an overkill. I don't want to install the whole swagger and all its dependencies just to run the tests

@arne-at-daten-und-bass
Copy link

arne-at-daten-und-bass commented Oct 19, 2017

Ok @Bolein, I (personally) don’t see that point, but of course I do not know your project .. so never mind. Then, I guess, you can try installing the swagger-cli module only, but I suppose this (alone) probably will not work.

Independent of swagger-node capabilities you might best go for „standard“ npm features (like configuring a test script in the scripts section of your package.json, e.g. node /path/to/test.js) or Travis CI features (like configuring the before_script and script stage according to your needs with default shell commands).

Anyway, for everybody else coming across this issue and deciding to go for swagger project test, keep in mind that there is still an open issue with its exit code:
#288

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

No branches or pull requests

2 participants