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

Output could contain convenient way to run/view slow test using a profiler #48

Open
johnkary opened this issue Jul 13, 2018 · 1 comment

Comments

@johnkary
Copy link
Owner

johnkary commented Jul 13, 2018

After a developer discovers a slow test using SpeedTrap, they want to discover why the test is slow, and eventually change the code to run faster. SpeedTrap cannot profile code deeper than the start and stop time of each test. But SpeedTrap might make it easier for a developer to use another tool to discover why their test is slow.

What if the PHPUnit SpeedTrap report contained output that conveniently let the reader run or view a PHP profiler's analysis of the slow test?

For example, as a developer, I run my test suite locally on my development machine with SpeedTrap enabled. The test output shows the test UserLoginTest::testLoginWorkflow() takes 6 seconds to execute. I am curious why this test is so slow! A profiler would allow me to see clock time, wall time, CPU usage, memory usage, etc. of this code's execution path. How could SpeedTrap help me more quickly profile this slow test?

Blackfire.io is likely the most feature-rich PHP profiler available. It can run on a developer's local machine. This is important so the profiling occurs under the same conditions as the slow test run found with SpeedTrap.

  • Could SpeedTrap detect that Blackfire is available to use?
  • If yes to above, could the test output display a CLI command to re-execute the slow test wrapped in a Blackfire profiler session?
  • Could SpeedTrap web link to a previous Blackfire run that executed the slow test? (Is that even useful?)

Please use the comments for any additional ideas, questions or answers to how this feature might work.

@johnkary
Copy link
Owner Author

Discussion with Blackfire devs began here: https://twitter.com/romainneutron/status/1019198786785173504

Blackfire PHP-SDK: https://blackfire.io/docs/reference-guide/php-sdk#installation
Also has some PHPUnit integration: https://blackfire.io/docs/integrations/phpunit

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

No branches or pull requests

1 participant