cesium icon indicating copy to clipboard operation
cesium copied to clipboard

Improve testing for `Model`

Open sanjeetsuhag opened this issue 3 years ago • 1 comments

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

sanjeetsuhag avatar Sep 16 '21 16:09 sanjeetsuhag

While working on #10397 and creating yet another pipeline stage, I'd say the most useful things for simplifying unit tests would be:

  1. the RenderResourcesTester would definitely be helpful for mocking the resources (or just properly constructing a PrimitiveRenderResources). I've at least been starting to move the common code into functions called mockRenderResources() at the top of test suites, but a proper module for this would be a better approach.
  2. 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 both GltfLoader and ModelExperimental-related tests.

ptrgags avatar Jun 02 '22 15:06 ptrgags