简体   繁体   中英

Tests are got failed in Jenkins on Linux and works good at Jenkins on windows local machine?

I am creating automation script using TestNG framework. The automation script which I have prepared in Eclipse IDE is works perfectly. I have installed Jenkins in my local machine(Windows) and created new job(Free Style Project). In Jenkins Advanced Project Options I selected Use Custom Workspace option. I entered eclipse workspace path as a custom workspace on jenkins. I have used windows batch command for build. Once build is started Jenkins works perfectly & displayed console output which I got in eclipse.

Than I have installed Jenkins on Linux server machine and wanted to do the same job as mentioned above. I have uploaded required files to server & created new job, selected new custom workspace(where files are stored in server). I am using Shell Command for create new build. I have created run.bat file which contains following code java -cp ./lib/*:./bin org.testng.TestNG testng.xml . My shell command is given below bash run.bat . When I am trying to build Test ends in failure. Below shows the console output of jenkins

Started by user iCore Admin 
Building in workspace /home/probe7qa/probe7qa.svn/icoreemrtests/onc2014/170.314.a.9/src/eNotes
[eNotes] $ /bin/sh -xe /tmp/hudson5444756561147365187.sh
+ bash -x run.bat
+ java -cp './lib/*:./bin' org.testng.TestNG testng.xml
[TestNG] Running:
 /home/probe7qa/probe7qa.svn/icoreemrtests/onc2014/170.314.a.9/src/eNotes/testng.xml
===============================================
Suite
Total tests run: 12, Failures: 0, Skips: 12
Configuration Failures: 1, Skips: 1
===============================================
Build step 'Execute shell' marked build as failure
Finished: FAILURE

All the tests are got skipped. I don't what went wrong actually... Any help on this...?

run.bat sounds like a windows executable. You'll probably need to create a linux script (run.sh?) which is compatible in linux.

Actually since your script is so small, you don't even need a separate shell script. Just put the java command in an execute shell

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM