Teamcity Step tests (Command Line) failed when testing an iOS app

1.6k views Asked by At

I am trying to run tests automatically using Teamcity, but it seems that when the agent is compiling the project, it is not done correctly because when I run the command like for running test, I am getting the following error:

fatal error: 'Pushwoosh/PushNotificationManager.h' file not found
#import <Pushwoosh/PushNotificationManager.h>
[16:48:51][Step 2/2]         ^
[16:48:51][Step 2/2] 1 error generated.

However, when I run manually the same commands I get no errors, but my test running. The application that I want to run was written in objective-c, and the command lines I am using are the following:

$ git clone REPOSITORY_URL (runs sucessfully)
$ pod install              (runs sucessfully)
$ xctool -workspace Supermaxi.xcworkspace    -scheme Supermaxi     test -only FunctionalTests:TestCase000_Registration/test00_WrongEmail  -sdk iphonesimulator (fails and I get the previous described error)
1

There are 1 answers

0
lmiguelvargasf On BEST ANSWER

After being helped by I friend of mine, we found the solution to this issue in this link.

It turns out that the main problem was, as the link states, that CocoaPods uses symbolic links in it’s directory structure, and TeamCity can have trouble copying symbolic links in the VCS checkout to build agent, so I had to set the Version Control Settings of Teamcity as it is explained in the previous link.

Therefore, I have just changed the VCS checkout mode from Automatically on server to Automatically on agent (if supported by VCS roots). After that I run the agent again, and it worked properly.