swagger-node icon indicating copy to clipboard operation
swagger-node copied to clipboard

Running test with Travis

Open vadymhimself opened this issue 8 years ago • 3 comments

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?

vadymhimself avatar Oct 18 '17 04:10 vadymhimself

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.

arne-at-daten-und-bass avatar Oct 18 '17 08:10 arne-at-daten-und-bass

@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

vadymhimself avatar Oct 18 '17 14:10 vadymhimself

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

arne-at-daten-und-bass avatar Oct 19 '17 08:10 arne-at-daten-und-bass