I have a simple Test Plan (with a single configuration) in my Xcode project which I am switching over to because I have multiple schemes for different app targets in my project but the tests are shared (as in they are not specifically limited to one target in terms of relevance, though only one host application was possible). I would like to have one Test Plan for now for all the targets, but when I created the Test Plan and added it to each scheme, and then ran the tests, I can clearly see that every target has been built. The length of time it takes to build and run the tests is thus increased incrementally for each target I add. The 2019 WWDC video on Test Plans clearly says they can be shared across multiple schemes but doesn't say much more than that.
Is this how it's supposed to behave? Or is there a way to share a test plan between schemes but have it only build the active target that's being tested?
EDIT: note, running tests locally as well as in automated CI, so need a solution that works for both.
I'm actually not sure if it's building multiple targets because of the test plans, because only a few targets are showing in builds while there are (although it could be that Xcode is optimizing and skipping redundant building since each of the other ones is pretty much the same as one of ones that is building).