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

inefficient test detection #526

Open
staabm opened this issue Mar 28, 2024 · 2 comments
Open

inefficient test detection #526

staabm opened this issue Mar 28, 2024 · 2 comments
Assignees
Labels

Comments

@staabm
Copy link

staabm commented Mar 28, 2024

I wonder whether this extension could also rank tests by their efficency, meaning not just a ranking by the runtime involved, but a separate ranking for e.g. memory usage.

wdyt?

@localheinz localheinz self-assigned this Apr 5, 2024
@localheinz
Copy link
Member

Sounds interesting, I'll consider this!

@mvorisek
Copy link
Contributor

Measuring memory usage is quite complicated, as test might fill caches, load files/classes, resulting in very different results on changed order or tests rerun/repeat.

In atk4/data repo we test memory leaks by https://github.com/atk4/data/blob/5.2.0/.github/workflows/test-unit.yml#L149 . We run tests multiple times and test if there is zero memory increase when tests are rerun. We rerun them many times, as some data structures (array, string..) in php are resized in steps (4, 8...) so this way we can detect even the smallest memory leaks like self::$x[] = true;.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants