Gjør vote_infererrer_spec raskere #338

Open
jarib opened this Issue Oct 31, 2012 · 0 comments

Comments

Projects
None yet
2 participants
Owner

jarib commented Oct 31, 2012

Jeg har lagt til profilering på spec-kjøringene, og vote_inferrer_spec.rb står for mange sekunder av testsuiten vår:

Top 10 slowest examples (29.22 seconds, 29.0% of total time):
  Hdo::Application should load the front page
    9.83 seconds ./spec/requests/browser_spec.rb:5
  Hdo::VoteInferrer with the real world data of 2012-06-14 infers the correct resuls for those votes
    3.3 seconds ./spec/lib/hdo/vote_inferrer_spec.rb:350
  Hdo::VoteInferrer with the real world data of 2012-06-14 doesn't fail
    3.18 seconds ./spec/lib/hdo/vote_inferrer_spec.rb:346
  Hdo::Application shows a list of votes
    2.64 seconds ./spec/requests/browser_spec.rb:9
  Hdo::VoteInferrer with a whole bunch of votes in 3 clusters should put a non-personal vote that is an hour from now in the second cluster
    2.01 seconds ./spec/lib/hdo/vote_inferrer_spec.rb:231
  Hdo::VoteInferrer with a whole bunch of votes in 3 clusters should put a non-personal vote that is two hours from now in the third cluster
    1.95 seconds ./spec/lib/hdo/vote_inferrer_spec.rb:252
  Hdo::VoteInferrer with a whole bunch of votes in 3 clusters should put a non-personal vote that is now in the first cluster
    1.79 seconds ./spec/lib/hdo/vote_inferrer_spec.rb:209
  Hdo::Import::Persister propositions imports a proposition
    1.61 seconds ./spec/lib/hdo/import/persister/import_propositions_spec.rb:17
  Category should group into columns by children size
    1.48 seconds ./spec/models/category_spec.rb:20
  TopicsController can show a topic with published issues
    1.43 seconds ./spec/controllers/topics_controller_spec.rb:5

@jonathanronen Kan noen av disse gjøres om til tester for OneDimensionalHierarchicalClusterer, sånn at man tester oppførselen med rene Ruby-objekter og dermed unngår alle databasekallene?

@ghost ghost assigned jonathanronen Oct 31, 2012

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