Closed bhouston closed 8 months ago
@elalish I've updated the README for "npm run render-goldens."
I've merged in the "npm run test" CLI update into this PR to make it simpler. I've also further updated the README to contain both sets of options in it.
I've renamed "npm run update-screenshots" to "npm run render-goldens", it is much more accurate/descriptive, e.g. the script renders the images that go into the goldens folder.
In the latest push I've made it so that the renderer you are testing for fidelity is configurable. It defaults to "model-viewer" (for full backwards compatibility) but you can specify any of the web-based renderers (filament, babylon, gltf-sample-viewer, three-gpu-renderer) and it works.
This implements this idea: https://github.com/google/model-viewer/issues/4536
To run a subset of renders or scenarios do something like this:
Explanation of the new features: --renderer, this now allows you to specify multiple renderers in the whitelist, rather than only one. -- scenario, this now also allows you to specify multiple scenarios in the whitelist, rather than only one. It now also selects scenarios based on being a subset of the config.json scenario name, thus you can run all tests that contain say "transform" or "clearcoat". --missing-only is very useful when I add new tests and I don't want to render all other tests just to get goldens for the new ones. --dry-run, when I want to figure out which tests will run given that command line. --quiet, I can run update-screenshots in the background while working without Chrome constantly popping up to disrupt my flow. Also gives about a 10% speed boost on my machine. --port, allows me to run two of these at the same time, useful when I want to run two different renderers at the same time, or work on two separate branches simultaneously.