-
Notifications
You must be signed in to change notification settings - Fork 84
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
Running CTS on React Native #3892
Comments
@kainino0x probably knows best but might be out for a few weeks. I have zero experience with React Native. In any case, there are multiple ways to run the tests. One way is via standalone.ts. Another is via cmdline.ts. You could look at both of those to see how to write your own runner. As for what features, off the top of my head, most of the tests don't need more than JavaScript and WebGPU but there are tests, especially in the Also, maybe take a look at how dawn.node runs the tests https://dawn.googlesource.com/dawn/+/refs/heads/main/src/dawn/node/README.md You can see how it calls into the command line version here to get a list of tests https://dawn.googlesource.com/dawn/+/refs/heads/main/tools/src/cmd/run-cts/common/cts.go I didn't dig to see how it runs them. IIRC dawn.node fails or skips tests under |
I think Gregg covered everything! I also do not know anything about React Native. If React Native's runtime is Node or something similar, then looking at You should be able to run the whole suite; all tests (regardless of subdirectory) that have dependencies on other APIs, like DOM and browser APIs, should automatically skip themselves when those aren't available. Would love to hear updates on your progress! Feel free to contribute changes to this repo if needed (but they might not be, since it already works in Node/Deno). |
@kainino0x Thank you for your note. It will be quite a bit of work for us as we will need to do a custom bundle but I'm sure we can get there eventually. Lately any examples we throw at the module work immediately out of the box so we didn't feel this is priority yet but I'm sure this will come up eventually. Here are demos from the WebGPU samples: github3.mp4And then we tried to run Three.js on top of it and it kind of worked out of the box: threejs.mp4But I definitely want to revisit this topic. |
That's very nice, thanks for sharing! |
Hey folks! I have been able to get the The main challenge for getting the tests running with React Native is bundling the tests in the React Native app, as mentioned above. Since React Native does not currently allow dynamic imports, I went ahead and included all of the test files in the JavaScript bundle. Metro (the JavaScript bundler for React Native) has an experimental In my current fork, I just overwrote the existing I would be happy to contribute that in the future, once I get the stress tests and unit tests running and clean up the import logic. This approach would mainly consist of creating a new class that implements Let me know if you would be interested in this approach! An alternative would be to implement a dev server that sends the test logic to a client device, but that would likely require more work. |
We have built a WebGPU binding for React Native based on Dawn and we also have a small test suite for it which we run against Chrome as well for reference.
We are now looking to run the CTS as well. I tried to bundle this module but been struggling in a few places.
So I wanted to try something simpler manually to get a sense on how things work.
I was able to load a
TestGroup
and it contains a few tests.I couldn't find which APIs I need to use just to execute this single test. Could you give me some pointers?
I will still try to see if I can find a way to package CTS in a way that would fit React Native but if there is a minimum set of API I could use directly where I could build my own test loader, that would be great.
The text was updated successfully, but these errors were encountered: