Subito-it/PodBuilder

Test Spec Support

Closed this issue · 3 comments

I came across this library and was intrigued at the prospect of speeding up our CI systems significantly with pre-compiled frameworks. We support a mono repo which contains local access to some libraries. We also include unit testing in those libraries in order to validate upon each merge request.

So the question is, does Pod Builder support test specs? If not, is there any plans to eventually support it? As you can see below, the test specs portion was ignored and never included in the main Podfile.

pod 'MyPod', :path => 'Modules/MyPod', :testspecs => ['MyPodTests']

Results in:

pod 'MyPod', :path => 'PodBuilder/Prebuilt/MyPod'

I'm unsure what is expected here. The compiled framework does not include the testing code nor has references to the testing source code. How would you expect this to work?

Our approach which includes tests for internal pods is potentially similar to your setup (even if we don't use testspecs):

  • We do have a monorepo and each module has a sample project which includes code and a unit test targets
  • The main branch of the monorepo contains all dependencies prebuilt
  • Devs create new feature branches on which they modify code. If changes affect one or more modules automatic checks make sure that these pods are not prebuilt (we run pod_builder switch --development PodA PodB...)
  • When a PR is opened Travis executes tests on main app and on all modified modules. We determine modified modules by running git diff between main branch a feature branch and run tests using plain old simple xcodebuilds commands on the module project.
  • If all tests pass changes are merged to main and an automatic task is executed that prebuilds and commits to main the modified pods

CocoaPods has built in unit testing for pods with the testspecs option as I displayed above. This creates a unit test scheme that you can access from your main project's workspace when integrating with CocoaPods with the

install! 'cocoapods',
   :share_schemes_for_development_pods => true 

Therefore when I add:
pod 'MyPod', :path => 'Modules/MyPod', :testspecs => ['MyPodTests']

I would hope to see:
pod 'MyPod', :path => 'PodBuilder/Prebuilt/MyPod', :testspecs => ['MyPodTests'] to include the :testspecs options copied over as well.

PS. We don't create separate projects for modules anymore since we can run the full unit test suite without it.

Unfortunately testspecs are not currently supported