I’m having a little trouble with organising tests in my project. I keep my code in small packages, and they usually follow this structure.
/
--/Authoring (separate assembly)
--/Runtime (separate assembly)
--/... (other resources, e.g. models, prefabs, all in folders / subfolders)
--/Tests (separate assembly, autoReferenced: false)
Problem is, that test code (systems and components) leaks in the global context (those systems will be visible in the World, in all Editor windows, and clutter the space (they don’t cause issues, as they only run with test components, but still).
How do I avoid it? Ideally I want to still be able to run my tests, but don’t have them leak in the “production” code. I tried separate test setup, where they are in a project of their own and invisible to Unity, but that had some problems making it incompatible with DOTS, and i mostly need to test systems and their interactions.
Another similar question is about samples, as they do have exactly same problem, but I think with those it’s kinda inevitable, and I’d better just put them in the package of their own.