我正在尝试通过 Jenkins 在从属设备上运行 JUnit 测试。从站配置成功,主站似乎识别了从站的工作区,但无法通过 Build 下的“Execute Shell”执行 java 命令。没有从源代码管理中提取代码,因此没有构建。这是一项旨在仅在从站上运行测试的作业。
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
如果我将 run.sh 替换为
java org.junit.runner.JUnitCore OneGateTesting.TestSuiteRunner
我可以在从属设备上本地运行它。