Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test createVerticesFromHeightMap and createVerticesFromQuantizedTerrainMesh #3902

Open
bagnell opened this issue May 9, 2016 · 4 comments
Open
Labels
good first issue An opportunity for first time contributors type - enhancement

Comments

@bagnell
Copy link
Contributor

bagnell commented May 9, 2016

createVerticesFromHeightMap and createVerticesFromQuantizedTerrainMesh have no unit tests.

@pjcozzi pjcozzi added the good first issue An opportunity for first time contributors label May 10, 2016
@ggetz ggetz removed their assignment Jan 27, 2022
@ChristianToro
Copy link

Hello, I am part of the JTC Flagship program and would like to work on this issue.

@ggetz
Copy link
Contributor

ggetz commented Aug 26, 2024

@ChristianToro Sounds good! Our testing guide may help getting starting.

@ChristianToro
Copy link

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?

@ggetz
Copy link
Contributor

ggetz commented Sep 27, 2024

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue An opportunity for first time contributors type - enhancement
Projects
None yet
Development

No branches or pull requests

4 participants