问题描述
我有一个工作空间,其中有几个必须作为静态库构建的项目,并且我有针对它们的测试方案.我想配置TeamCity来构建和测试这些库中的每一个,但是它不能解决以下错误:
I have a workspace with few projects that must be built as static libraries and I have schemes with tests for them. I want to configure TeamCity to build and test each of those libraries, but it does not work with following error:
...
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace code/MyApplication/My Framework.xcworkspace -scheme One Of Tests TEST_AFTER_BUILD=YES clean build -configuration Debug -sdk iphonesimulator6.1
in directory: /Users/Me/TeamCity/buildAgent/work/d0f083d874fc6891
Build settings from command line:
SDKROOT = iphonesimulator6.1
TEST_AFTER_BUILD = YES
xcodebuild: error: Failed to build workspace My Framework with scheme One Of Tests.
Reason: Scheme "One Of Tests" is not configured for running.
Process exited with code 70
...
但是与此同时,当我克隆我的存储库时,将其放入cd并在终端上从上方运行命令:
But at the same moment, when I clone my repository, cd into it and run command from above in terminal:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace code/MyApplication/My Framework.xcworkspace -scheme One Of Tests TEST_AFTER_BUILD=YES clean build -configuration Debug -sdk iphonesimulator6.1
成功://更新:它仅适用于构建方案,不适用于测试
It succeeds: // UPDATE: It worked only for build schemes, not for tests
** BUILD SUCCEEDED **
因此,TeamCity中的设置肯定是错误的.我该怎么做才能使它起作用?
So it's definitely wrong settings in TeamCity. What can I try to make it works?
P.S.建立图书馆的计划效果很好.仅在测试时抛出错误.
P.S. Schemes for building libraries work fine. Only with tests throw errors.
推荐答案
我找到了解决方案.问题在于有关xcodebuild命令对SenTestKit的支持不佳.为了使它可行,我必须进入编辑方案"菜单并设置运行"步骤,以便测试方案可以运行.
I found solution. The problem was about poor support of SenTestKit with xcodebuild command. To make it works I had to go Edit Scheme menu and set Run step so the test scheme became runnable.
感谢解决方案本文.实际上没有什么不同,这是构建后测试"设置和宏.就我而言,它仅使用YES选项运行测试,而我不必编写任何宏.他们使他们解决了本文中描述的问题.
Thanks for solution this article. There're few things was actually different, it is a Test After Build setting and macros. In my case it runs test only with YES option and I did not have to write any macros. Mb they fix the issue that was described in the article.
这篇关于具有Xcode工作区的Team City CI-方案“我的方案"未配置运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!