我在我的 Hudson 服务器中添加了一个新作业,它使用 makefile 构建项目。
执行shell命令:
#!/bin/bash
cd $JOB_NAME
make
我的 makefile 看起来像这样
SDK_31 = iphonesimulator3.1
TARGET_DEV = myProject
TARGET_TEST = unitTest
all: debug
debug:
xcodebuild -sdk ${SDK_31} -target "${TARGET_DEV}" -configuration Debug
xcodebuild -sdk ${SDK_31} -target "${TARGET_TEST}" -configuration Debug
clean:
xcodebuild -alltargets clean
rm -rf build
但是当 Hudson 构建项目时,一些单元测试失败,但构建被标记为成功。
我应该怎么做才能拥有一个“不稳定的项目”?
最诚挚的问候,
最佳答案
您应该通过启用“发布 Junit 测试结果报告”构建后操作来配置 Hudson 来记录单元测试结果。
post-build actions http://img141.imageshack.us/img141/5136/hudsonjunit.png
更新:如果您无法获取 JUnit XML 输出,您应该能够使用 Text-finder plugin更改构建状态:
This plugin lets you search keywords in the files you specified and use that to mark the build as success or a failure.
关于xcode - 当单元测试失败时,构建不会被标记为不稳定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1431777/