Welcome Guest, Not a member yet? Register   Sign In
Tachycardia - Profiling your slow tests

Hi All,

I just want to share to you my new library, Tachycardia, which you can use in testing your application. Tachycardia is technically not a CodeIgniter4 addin but can be assimilated perfectly to your CI4 applications. Install it using Composer:

composer require --dev nexusphp/tachycardia

Tachycardia is a PHPUnit extension that will profile your test suites and print slow tests in your console once the test run is finished. While Tachycardia is not a true "profiler" -- XDebug might help you with that, this extension will identify your sluggish tests and report them to you. Why is this useful? You might have noticed that your entire test run takes longer than expected but have no idea which tests are slowing down the run. This will help you pinpoint that so that you can optimize that test.

Tachycardia will scrutinize each successful test run and compares the time spent against your set time limits. If the test exceeded the time limit, it will be reported as one of the slow tests. After all tests have run, Tachycardia will report these slow tests in your console in a nicely formatted listing or tabulated, whichever you want.

Optionally, if you are using Github Actions for your continuous integration tests, you can also direct Tachycardia to print also in your GA environment and annotate those slow tests directly.

Head over to the GitHub repo to read on the documentation.

P.S. This is used by the main CodeIgniter4 repo in its test suites so you may notice if you make PRs there the slow tests have annotations.

I've been using it, switched over from SpeedTrap. Great module and super helpful for test analysis!

Theme © iAndrew 2016 - Forum software by © MyBB