Today I Learned

A Hashrocket project

Your slowest Elixir tests

Sometimes its handy to see what tests are taking the longest in an Elixir project.

Enter mix test --slowest N

Just replace N with how many slow tests you would like to see and you’ll get some handy output:

$ mix test --slowest 5

Top 5 slowest (17.6s), 30.2% of total time:
  * test enters a body that is too long (4504.4ms) (DeveloperCreatesPostTest)
  * test the page does not have a Create Post link (4384.9ms) (VisitorVisitsHomepageTest)
  * test and clicks 'like' for that post (3944.2ms) (VisitorViewsPostTest)
  * test fills out form and updates post from post show (2558.6ms) (DeveloperEditsPostTest)
  * test fills out form and submits (2255.5ms) (DeveloperCreatesPostTest)
Looking for help? Elixir is quickly gaining momentum for web applications that need concurrency, performance, and the ability to connect to many different clients. The developers at Hashrocket are learning along with the rest of the development community that Elixir and Phoenix are viable Rails alternatives for the right application. Check out the source code for Today I Learned, written in Elixir, and contact us if you need help with your Elixir project.