Unity3D-SerializableInterface icon indicating copy to clipboard operation
Unity3D-SerializableInterface copied to clipboard

Unit Tests and Integration Tests

Open marc-antoine-girard opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. It's getting hard to test every possible combination of things that can be achieved using SerializableInterface.

Describe the solution you'd like It would be nice, eventually, to have tests. It would also make it easier to do PR (with automated tests and such)

Upside:

  • Having tests would prevent breaking changes
  • It would help better define what is possible to do
  • There could be test scenes to test inspector behaviour (if it's possible)
  • When there's going to be sample scenes, it would make sure they haven't been broken by some change

Downside:

  • Long / tedious to do
  • Dependency to Test Framework package

Describe alternatives you've considered Manually check every possible combination of things that can happen every time a new PR is merged (or before). It doesn't quite scale well.

marc-antoine-girard avatar Jul 26 '22 16:07 marc-antoine-girard

It would indeed be nice to have. That said, I would not know how to approach this, as most of the functionality is provided visually through an inspector.

If anyone has solid ideas on how to approach this feel free to ping me.

Thundernerd avatar Aug 02 '22 15:08 Thundernerd

I don't think unit testing the inspector is really feasible without going full reflection. This is mostly due to how Unity draws things in the inspector using IMGUI. That being said, I do believe it would be feasible if the drawing part was done using UI Toolkit and VisualElements, but that would be a major redesign of the backend code. On a side note, UI Toolkit is easier to customize tho...

marc-antoine-girard avatar Aug 04 '22 17:08 marc-antoine-girard