view · edit · sidebar · attach · print · history

20110303-testcases-oddb_org

<< | Index | >>


  1. Check coverage
  2. Update test_state/suite.rb
  3. Coverage Problem
  4. Update lookandfeelwrapper.rb
  5. Increase coverge

Goal/Estimate/Self-Evaluation
  • test-cases test_state coverage oddb.org / 100% / 100%
Milestones
  1. Check coverage
  2. Update test_state/suite.rb 9:15
  3. Coverage problem 10:15
Summary
Commits

Check coverage

masa@masa ~/ywesee/oddb.org $ rcov test/suite.rb
...
  1) Error:
test_user_input(ODDB::State::Companies::TestCompanyListState):
NameError: uninitialized constant ODDB::State::View::Companies
    /home/masa/ywesee/oddb.org/src/state/companies/companylist.rb:22:in `init'
    /home/masa/ywesee/oddb.org/src/state/companies/companylist.rb:45:in `init'
    /home/masa/ywesee/oddb.org/test/test_state/companies/companylist.rb:139:in `test_user_input'

  2) Error:
test_empty_list(ODDB::State::Drugs::TestResult):
NameError: uninitialized constant ODDB::State::View::Drugs
    /home/masa/ywesee/oddb.org/src/state/drugs/result.rb:31:in `init'
    /home/masa/ywesee/oddb.org/test/test_state/drugs/test_result.rb:97:in `test_empty_list'

  3) Error:
test_empty_list(ODDB::State::Interactions::TestResultState):
NameError: uninitialized constant ODDB::State::View::Interactions
    /home/masa/ywesee/oddb.org/src/state/interactions/result.rb:40:in `init'
    /home/masa/ywesee/oddb.org/test/test_state/interactions/result.rb:37:in `test_empty_list'

  4) Failure:
test_resolve1(ODDB::State::TestGlobal)
    [/usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:306:in `fetch_named'
     /usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:330:in `call'
     /usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:330:in `fetch_or_do'
     /usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:304:in `fetch_named'
     /usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:367:in `indices'
     /usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:438:in `retrieve_from_index'
     /usr/lib64/ruby/site_ruby/1.8/odba/persistable.rb:132:in `find_by_pointer'
     /home/masa/ywesee/oddb.org/src/util/persistence.rb:286:in `resolve'
     /home/masa/ywesee/oddb.org/src/state/global.rb:468:in `resolve'
     /home/masa/ywesee/oddb.org/test/test_state/global.rb:107:in `test_resolve1']:
wrong method called on #<Mock:0x7f987d8ea770>; expected next_id, was restore_named

  5) Failure:
test_resolve__print1(ODDB::State::TestGlobal)
    [/usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:306:in `fetch_named'
     /usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:330:in `call'
     /usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:330:in `fetch_or_do'
     /usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:304:in `fetch_named'
     /usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:367:in `indices'
     /usr/lib64/ruby/site_ruby/1.8/odba/cache.rb:438:in `retrieve_from_index'
     /usr/lib64/ruby/site_ruby/1.8/odba/persistable.rb:132:in `find_by_pointer'
     /home/masa/ywesee/oddb.org/src/util/persistence.rb:286:in `resolve'
     /home/masa/ywesee/oddb.org/src/state/global.rb:374:in `print'
     /home/masa/ywesee/oddb.org/test/test_state/global.rb:115:in `test_resolve__print1']:
wrong method called on #<Mock:0x7f987d8dd778>; expected next_id, was restore_named


1745 tests, 4047 assertions, 2 failures, 3 errors

Total Coverage: 57.81%

Update test_state/suite.rb

Problem

  • The test-cases of test_state can pass independently but test_state/suite.rb returns 2 failures and 3 errors
  • This is due to the mutual dependency among the test-cases of test_state

Commit

Run

  • oddb.org/ext/meddata/bin/meddatad
  • yus/bin/yusd

Result

masa@masa ~/ywesee/oddb.org $ ruby test/suite.rb 
...
Loaded suite 
 /home/masa/ywesee/oddb.org/test/test_model/suite,
 /home/masa/ywesee/oddb.org/test/test_plugin/suite,
 /home/masa/ywesee/oddb.org/test/test_state/suite,
 /home/masa/ywesee/oddb.org/test/test_util/suite,
 /home/masa/ywesee/oddb.org/test/test_view/suite,
 /home/masa/ywesee/oddb.org/test/../ext/suite

Finished in 55.017525 seconds.

1751 tests, 4060 assertions, 0 failures, 0 errors

Coverage Problem

Problem

  • The coverages of oddbapp.rb are different between 'rcov test/suite.rb' and 'rcov test/test_util/oddbapp.rb'

rcov test/suite.rb

rcov test_util/suite.rb (or rcov test_util/oddbapp.rb)

Hypothesis

  • I guess there is a problem in test/suite.rb

Experiment

directories = [
#  "#{dir}/test_model/suite.rb",
#  "#{dir}/test_plugin/suite.rb",
#  "#{dir}/test_state/suite.rb",
  "#{dir}/test_util/suite.rb",
#  "#{dir}/test_view/suite.rb",
#  "#{dir}/../ext/suite.rb",
]

Run test/suite.rb

masa@masa ~/ywesee/oddb.org $ rcov test/suite.rb

Result

  • Coverage: 87.98%

Note

  • There is something wrong in test/suite.rb

Commit

Update lookandfeelwrapper.rb

Result

masa@masa ~/ywesee/oddb.org/test/test_custom $ rcov test_lookandfeelwrapper.rb 
Loaded suite /usr/bin/rcov
Started
...........................................
Finished in 0.019327 seconds.

43 tests, 43 assertions, 0 failures, 0 errors

Increase coverge

Total Coverage: 70.75

Commit

view · edit · sidebar · attach · print · history
Page last modified on March 03, 2011, at 04:58 PM