0

I am attempting to run JUnit tests on a slave via Jenkins. Configuration of the slave was successful and the master seems to recognize the slave's workspace but is unable to execute the java command via the "Execute Shell" under Build. There is no pulling down code from source control and so no builds. This is a job intended to just run a test on the slave.

Building remotely on qa-slave in workspace /home/ubuntu/Desktop
[Desktop] $ /bin/sh -xe /tmp/hudson2639231287347256677.sh
+ ./run.sh
Error: Could not find or load main class org.junit.runner.JUnitCore
Build step 'Execute shell' marked build as failure
Finished: FAILURE

I get the same error if I replace run.sh with

java org.junit.runner.JUnitCore OneGateTesting.TestSuiteRunner

I am able to run this locally on the slave.

Jai
  • 319
  • 2
  • 9
  • 30
  • What account do you login and run it as ? Try logging in with jenkins user and run java . Let us know what you observe – Mayur Nagekar Mar 28 '14 at 00:26
  • I use the account that I use to ssh to the slave. I noticed that I don't have a "jenkins" user, but user.name is tomcat7 on the master (per jenkins systemInfo) and I don't know what the password is. – Jai Mar 28 '14 at 02:48

1 Answers1

0

I worked around this issue by giving the "other" group the same permissions as for the owner and group for the folders that contain the test, on the Linux machine. With this, I didn't have to sudo -u jenkins to run the tests from the master. Also I had to include the export CLASSPATH stuff in this test script as it couldn't source the .bashrc file.

Jai
  • 319
  • 2
  • 9
  • 30