Test createVerticesFromHeightMap and createVerticesFromQuantizedTerrainMesh
createVerticesFromHeightMap and createVerticesFromQuantizedTerrainMesh have no unit tests.
Hello, I am part of the JTC Flagship program and would like to work on this issue.
@ChristianToro Sounds good! Our testing guide may help getting starting.
Hey @ggetz , I have been researching the testing guide which has been helpful, but I have a few questions that need clarification:
This issue cites PR #3902, which cited the original issue #3676, referencing a terrain exaggeration sandcastle problem. When checking out tag 1.18 to try a reproduction of the issue resulted in an ES6 error during build. The terrain exaggeration example seems to use createVerticesFromQuantizedTerrainMesh but depends on fairly large set of dependencies. Given this, it would be difficult to make a unit test, rather than an integration test. How should I proceed with this? Are there other unit test examples for other workers within the code base?
@ChristianToro Thanks for review all these materials. These are good questions.
TaskProcessorSpec.js has examples of minimal unit tests which validate workers. Namely providing some input and confirming the expected outputs.
To create these tests, I would set up two new files packages/engine/Specs/Workers/createVerticesFromHeightMapSpec.js and packages/engine/Specs/Workers/createVerticesFromQuantizedTerrainMeshSpec.js. In each of those files, I would create similarly structured unit tests using TaskProcessor to schedule and execute the workers.
For the parameters themselves, I would look at HeightmapTerrainDataSpec.js and QuantizedMeshTerrainDataSpec.js for relevant examples.
Let me know if you have any further questions!