-
Notifications
You must be signed in to change notification settings - Fork 4
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
Run tests in puppeteer #52
Comments
I emailed @kathy-phet and @ariel-phet
|
@samreid what is your estimate for an initial investigation? |
I am guessing around 2 hours to set up initial harness to get unit tests running in puppeteer using async/await. I'll be learning how to set up Promises and run them in parallel and would benefit from a mentor (<1 hour), if someone has time to help on that step. If that step goes well, the next step would be to add fuzz tests. |
@samreid take 4 hours to begin and lets see where you get. Automated testing is certainly quite beneficial to the project, so worthy of some investment in improving efficiency. Check with @chrisklus or @jbphet regarding Promises. |
Notes from discussion with @jonathanolson: bayes CT: all tests take around 4 hours. We considered send set of shas to bayes, then it can run tests on those. Focus on problems that could develop PhET developer workflow. Bayes CT can catch lower-frequency issues (like building scenery). Major disadvantage of this approach, it only tests chromium. Does not test mobile safari, ie11, firefox, etc. Or is there a way to reuse the code above, but make it work with multiple browsers? But puppeteer could still be good to get started for local testing. It would be good if it can run the most important tests first. Focus on finding an issue fast. Interleave the tests, in case there is a phet-io problem--don't save all the phet-io tests until the end. |
A heads up to @zepumph that some SimTests are moving to aqua/js/local/test.js |
After the preceding commits we have:
I've set this up to automatically run on every commit. Putting issue on hold while I use this in practice for a while. |
Could you please provide basic steps to run this. I tried the following and nothing worked:
|
In the preceding commit, I added puppeteer to aqua package.json, it will need To run all unit tests, you can use:
To run a fuzz test (randomly picks one sim at the moment), you can use:
Sorry for the wonky syntax--working on something amenable to parallelization. |
Not planning more development on this at the moment, but we should revisit it when we spend more time on automated testing. Self-unassigning for now. |
I removed the auto-test-local script since we have been focusing on precommit hooks. |
As suggested in phetsims/binder#8 (comment)
My first motivation is to make tests run in parallel. Puppeteer may be able to do that with client code that parallelizes, or we may benefit from something like: https://github.com/thomasdondorf/puppeteer-cluster
The end goal is to have something that can run easily/automatically and run a large amount of tests quickly, with a uniform text report. Cross platform, something we may switch Bayes CT over to at some point.
The text was updated successfully, but these errors were encountered: