Adding Unit Testing Tool for iOS
Adding tools to run unit tests on iOS.
The error reporting could be improved but it successfully indicates which test fails when run.
#9
Thanks for this will look at this later!
Thank you for the project!
@joelklabo I've had a quick scan and it looks good, I need to take a deeper look later and will get back to you. I hope to have some time this evening.
@joelklabo I've added some tests to the example projects, run the linter and formatted and removed some unused imported symbols.
I think the executeXcodeBuild function needs refactoring to improve how it parses output to make it more robust and identify build failure vs test failure, though I'm not clear currently on how to identify this. I was hoping we could use exit codes but it seems the test failure and build failure exit code is the same (65) 🤦♂️
executeXcodeBuild is already responsible for parsing warnings and errors, so I think it should also parse test result bundles. We can then parse them using xcrun xcresulttool and then return the test failures in the ToolResponse.Content field instead of exposing the rawOutput to the calling function.
@joelklabo I've added some tests to the example projects, run the linter and formatted and removed some unused imported symbols.
I think the
executeXcodeBuildfunction needs refactoring to improve how it parses output to make it more robust and identify build failure vs test failure, though I'm not clear currently on how to identify this. I was hoping we could use exit codes but it seems the test failure and build failure exit code is the same (65) 🤦♂️`executeXcodeBuild` is already responsible for parsing warnings and errors, so I think it should also parse test result bundles. We can then parse them using `xcrun xcresulttool` and then return the test failures in the `ToolResponse.Content` field instead of exposing the `rawOutput` to the calling function.
I think we can just look for the presence of an xcresultbundle when the test command returns code 65, if it is a build failure, then the bundle won't exist.
I'm not sure when I'm going to have time to look into this, I'm afraid. You're welcome to take a sta,b otherwise I'll get on it as soon as I can so we can get this PR merged in.
I've not forgotten about this been super busy recently and only have a few hours a day to focus on this. I will get this merged in.
Yeah, same here, I agree with your comments. I'll take a stab at it if I can find time today
Just wanted to +1 this! Would love to see this added soon. Thanks for the great tools already, they work really well. Would love to help in any way I can.
also waiting for this feature
Thanks for your contribution, this has now been implemented, so I am closing this PR. Thanks again!
Thanks for implementing it @cameroncooke !
`executeXcodeBuild` is already responsible for parsing warnings and errors, so I think it should also parse test result bundles. We can then parse them using `xcrun xcresulttool` and then return the test failures in the `ToolResponse.Content` field instead of exposing the `rawOutput` to the calling function.