ClientSim icon indicating copy to clipboard operation
ClientSim copied to clipboard

Missing UdonSharpBehaviour References in Play-Mode Tests

Open sam-ln opened this issue 2 years ago • 1 comments

I've created a PlayMode test for my scene which derives from ClientSimWorldTestBase. The test setup is identical to "ClientSimWorldTestExampleScene" as provided in the Samples. When running the test, all references to gameObjects in my UdonSharp Behaviours are cleared out (set to none). The test will also not finish and runs indefinitely.

usharpclear

This part of the Instructions for Automated Testing seems relevant:

Due to the nature of how ClientSim starts using the InitializeOnLoad, testing requires modifying Unity editor settings to properly validate behaviour. In the test environment, InitializeOnLoad happens before playmode starts. The default Unity setting has Domain Reloading enabled on entering playmode. This means that on switching to playmode, all variable data is cleared. In order to get around this, all ClientSim tests must run with Domain Reloading disabled. This is handled automatically for any test written that derives from either of the two test fixture base classes: ClientSimTestBase and ClientSimWorldTestBase.

But since my test Class derives from ClientSimWorldTestBase, this shouldn't be the problem.

sam-ln avatar Dec 18 '22 14:12 sam-ln

Are you saying a folder called "Tests" is missing? How do we re-enable this? My references suddenly disappeared as well only for select Scripts. Strange. Any guidance would be highly appreciated!

sramonpacheco avatar Feb 25 '24 04:02 sramonpacheco