codewars / docs

The Codewars Docs :construction: WIP
https://docs.codewars.com
MIT License
55 stars 191 forks source link

Remove information on performance problems of test output panel #442

Closed hobovsky closed 1 year ago

hobovsky commented 1 year ago

hobovsky:

there's this part in our authoring guidelines https://docs.codewars.com/authoring/guidelines/submission-tests/#general-guidelines

Keep the amount of entries in test reports reasonably small. Some test frameworks produce one report entry (green or red line) per test case, while some emit one entry per successful/failed assertion. The test output panel performs some DOM manipulation on the entries in the client's browser, and when there are a lot of them, browsers may experience performance problems. A hundred lines is usually OK, a thousand should be bearable, but a couple of thousands would probably be too much and freeze the browser for some time. If you need to perform that many assertions, you should limit the amount of feedback by collecting the result of a couple of conditions in one boolean variable for a complete batch of tests and then check the value of this variable in a dedicated assertion at the end.

I know the test output panel has been refactored and now loads test entries lazily. Do you think the paragraph should be changed, partially or entirely?

kazk:

Maybe partially change it. It's better to avoid spamming even if there's no performance issues anymore. We should also try to prevent spamming with passing assertion results by fixing the reporters. I don't remember which test frameworks still does it, but we should create an issue about it.