theyworkforyou / shineyoureye-sinatra

Parliamentary monitoring site for Nigeria
https://www.shineyoureye.org/
4 stars 3 forks source link

Find an easy way to list the slower tests #69

Open octopusinvitro opened 7 years ago

octopusinvitro commented 7 years ago

At the moment we can do:

bundle exec rake TESTOPTS='-v'

to print how much time each test takes to run. However it would be nice to be able to see, say, the top 20 slowest tests.

I found some ways of doing it, but I don't quite like them:

I'm sure there should be an easy way to do this.

BTW, the slowest tests are of course the integration tests! (i.e., the web tests). At the moment of writing this I get:

"Federal Constituency Place Page::social block#test_0002_links to facebook share = 0.29 s = .",
"List of Representatives::person item::when person does not have an image#test_0001_shows a picture anyway (empty avatar) = 0.18 s = .",
"List of Representatives::person item#test_0001_links to the person page = 0.17 s = .",
"List of Representatives::person item#test_0004_links to area page = 0.15 s = .",
"List of Representatives::person item#test_0007_displays party name = 0.15 s = .",
"List of Representatives::person list#test_0001_lists all representatives = 0.14 s = .",
"List of Representatives::person item::when person has an image#test_0001_points to the right path = 0.14 s = .",
"Posts Page#test_0002_shows all posts = 0.13 s = .",
"Posts Page#test_0001_shows the title = 0.13 s = .",
"Posts Page::when displaying a post#test_0004_displays post excerpt = 0.12 s = .",
"Posts Page::when displaying a post#test_0003_displays post date = 0.12 s = .",
"List of Representatives::person item#test_0003_shows right area type name = 0.12 s = .",
"List of Representatives::person item::when person has an image#test_0003_has the name as alternative text = 0.12 s = .",
"Posts Page::when displaying a post#test_0001_links to post url = 0.11 s = .",
"List of Representatives::person item#test_0005_displays area name = 0.11 s = .",
"Federal Constituency Place Page::person item#test_0007_links to the person area = 0.10 s = .",
"Posts Page::when displaying a post#test_0002_displays post title = 0.10 s = .",
"Page::Place#test_0008_has all the people for that place = 0.10 s = .",
"List of Representatives::person item::when person has an image#test_0002_has an srcset = 0.10 s = .",
"List of Representatives#test_0001_shows the title = 0.10 s = ."
mhl commented 7 years ago

Timebox to 1 day