mardi 31 janvier 2017

Jenkins return job status FAILURE however it succeeds on command line

I am automating my protractor integration tests using Jenkins. I tested locally on the running Jenkins machine using npm run e2e-jenkins it runs normally. But when integrating it into Jenkins pipeline, it gives me error as below:

[33mStarting up http-server, serving[39m[36mdist[39m[33m
Available on:[39m
[32m  http://192.168.5.45:3000[39m
[32m  http://127.0.0.1:3000[39m
Hit CTRL-C to stop the server
[10:47:12] I/local - Starting selenium standalone server...
[10:47:12] I/launcher - Running 1 instances of WebDriver
[10:47:12] E/launcher - Server terminated early with status 2
[10:47:12] E/launcher - Error: Server terminated early with status 2
    at Error (native)
    at C:\Program Files (x86)\Jenkins\workspace\Pipeline frontend e2e\org.lhasalimited.vitic.frontend.web\node_modules\selenium-webdriver\remote\index.js:242:20
    at ManagedPromise.invokeCallback_ (C:\Program Files (x86)\Jenkins\workspace\Pipeline frontend e2e\org.lhasalimited.vitic.frontend.web\node_modules\selenium-webdriver\lib\promise.js:1379:14)
    at TaskQueue.execute_ (C:\Program Files (x86)\Jenkins\workspace\Pipeline frontend e2e\org.lhasalimited.vitic.frontend.web\node_modules\selenium-webdriver\lib\promise.js:2913:14)
    at TaskQueue.executeNext_ (C:\Program Files (x86)\Jenkins\workspace\Pipeline frontend e2e\org.lhasalimited.vitic.frontend.web\node_modules\selenium-webdriver\lib\promise.js:2896:21)
    at asyncRun (C:\Program Files (x86)\Jenkins\workspace\Pipeline frontend e2e\org.lhasalimited.vitic.frontend.web\node_modules\selenium-webdriver\lib\promise.js:2775:27)
    at C:\Program Files (x86)\Jenkins\workspace\Pipeline frontend e2e\org.lhasalimited.vitic.frontend.web\node_modules\selenium-webdriver\lib\promise.js:639:7
    at process._tickCallback (internal/process/next_tick.js:103:7)
[10:47:12] E/launcher - Process exited with error code 199

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "protractor" "config/protractor.jenkins.conf.js"
npm ERR! node v6.9.4
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! vitic-frontend@0.0.1 protractor: `protractor "config/protractor.jenkins.conf.js"`
npm ERR! Exit status 199
npm ERR! 
npm ERR! Failed at the vitic-frontend@0.0.1 protractor script 'protractor "config/protractor.jenkins.conf.js"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the vitic-frontend package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     protractor "config/protractor.jenkins.conf.js"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs vitic-frontend
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls vitic-frontend
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Program Files (x86)\Jenkins\workspace\Pipeline frontend e2e\org.lhasalimited.vitic.frontend.web\npm-debug.log
ERROR: "protractor config/protractor.jenkins.conf.js" exited with 1.

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "e2e-jenkins"
npm ERR! node v6.9.4
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! vitic-frontend@0.0.1 e2e-jenkins: `npm-run-all -p -r server:prod:ci "protractor config/protractor.jenkins.conf.js"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the vitic-frontend@0.0.1 e2e-jenkins script 'npm-run-all -p -r server:prod:ci "protractor config/protractor.jenkins.conf.js"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the vitic-frontend package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm-run-all -p -r server:prod:ci "protractor config/protractor.jenkins.conf.js"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs vitic-frontend
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls vitic-frontend
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Program Files (x86)\Jenkins\workspace\Pipeline frontend e2e\org.lhasalimited.vitic.frontend.web\npm-debug.log
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] mail
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Finished: FAILURE

You will find all need files here

Aucun commentaire:

Enregistrer un commentaire