0

I have to make some UITests for an iOS app and this is how it goes: I use XCode ide and xctest library. I write my tests, they pass and everyone is happy. When a new version of the app gets released, I have to install it manualy and run my tests again.

So, I came up with a new idea. What if I make a new branch (a copy of the release branch) and I add my tests there. This way, every time a new release is coming, I can just merge the release branch with my test branch. Like so, when I run a test, the new version of the app will be installed.

It works. The problem is that a new release has come. And poof, merge conflict on the .xpbproj file. The problem is that I added test classes so the .xpbproj file changed. And the developers added new files too, so the file has changed.

It doesn't seem right to manually resolve the conflict. A .gitattributes merge union doesn't resolve it for me, the project cannot be opened because it is "damaged".

My question is: Have you ever encountered this problem and how you worked it out?

  • Why you can't simple have test cases in the same branch as the code? – 0andriy Feb 19 '20 at 21:09
  • There's no good way to merge `xpbproj`, so best way is to avoid merges. You can do various things, the simplest for you probably to keep code and tests in separate _projects_, while still having them in the same workspace. Another option is to have tests always in, but have them disabled when you don't want to run them (have separate goals for example). – timbre timbre Feb 20 '20 at 00:13

0 Answers0