cesium
cesium copied to clipboard
Improve testing for `Model`
The specs for Model
currently consist of a lot of repetitive code that can be refactored into leaner and more concise specs by utilizing the patters used by MetadataTester
and Cesium3DTileTester
.
- https://github.com/CesiumGS/cesium/pull/9806 adds a
ShaderBuilderTester
. - What's really needed is a
RenderResourcesTester
that can generate mocks and validate results. - Lots of good suggestions of testing architecture are in https://github.com/CesiumGS/cesium/pull/9773
While working on #10397 and creating yet another pipeline stage, I'd say the most useful things for simplifying unit tests would be:
- the
RenderResourcesTester
would definitely be helpful for mocking the resources (or just properly constructing aPrimitiveRenderResources
). I've at least been starting to move the common code into functions calledmockRenderResources()
at the top of test suites, but a proper module for this would be a better approach. - A
GltfLoaderTester
that manages the gltf loaders that need to be cleaned up after each test would be very helpful, there's a lot of code we've been copying many times in bothGltfLoader
andModelExperimental
-related tests.