Last Comment Bug 678968 - new_conf config_manager test coverage
: new_conf config_manager test coverage
Status: RESOLVED WORKSFORME
:
Product: Socorro
Classification: Server Software
Component: Infra (show other bugs)
: 1.0
: All All
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: socorro
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-15 05:43 PDT by Peter Bengtsson [:peterbe]
Modified: 2012-10-02 12:44 PDT (History)
1 user (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Sample coverage analysis (340.25 KB, text/html)
2011-08-15 05:44 PDT, Peter Bengtsson [:peterbe]
no flags Details

Description Peter Bengtsson [:peterbe] 2011-08-15 05:43:37 PDT
The goal is to have near 100% test coverage over the new config_manager.py in the new_conf branch before we start refactoring too much and consider new features within. 

The test coverage is currently 71% (see attached last output from coverage report). The command I use to generate this is:

socorro@lucid64:~/dev/new_conf$ nosetests -s  socorro.unittest.lib.testConfigurationManager:TestCase --with-cover --cover-html --cover-package="socorro.lib.config_manager"
Comment 1 Peter Bengtsson [:peterbe] 2011-08-15 05:44:49 PDT
Created attachment 553153 [details]
Sample coverage analysis

This is just a sample coverage report page. Just for the config_manager.py module.
Comment 2 Peter Bengtsson [:peterbe] 2011-08-15 05:56:04 PDT
Note to self/Lars: The tool I use to run tests is [python-gorun] which works great on Linux. Inside the directory ~/dev/new_conf I have a file called "gorun_settings.py" which currently looks like this::

DIRECTORIES = (
  ('', 'nosetests -s  socorro.unittest.lib.testConfigurationManager2:TestCase.test_create_ConfigurationManager_with_use_config_files'),
#  ('', 'nosetests -s  socorro.unittest.lib.testConfigurationManager2:TestCase'),
)  

#nosetests -s  socorro.unittest.lib.testConfigurationManager2:TestCase --with-cover --cover-html --cover-package="socorro.lib.config_manager"


That makes it possible for me to just start gorun:

  $ gorun.py

and it runs the tests over and over in a terminal. 

[https://github.com/peterbe/python-gorun/]
Comment 3 Peter Bengtsson [:peterbe] 2011-08-15 05:57:42 PDT
(In reply to Peter Bengtsson [:peterbe] from comment #2)

> DIRECTORIES = (
>   ('', 'nosetests -s 
> socorro.unittest.lib.testConfigurationManager2:TestCase.
> test_create_ConfigurationManager_with_use_config_files'),
> #  ('', 'nosetests -s 
> socorro.unittest.lib.testConfigurationManager2:TestCase'),
> )  
> 
> #nosetests -s  socorro.unittest.lib.testConfigurationManager2:TestCase
> --with-cover --cover-html --cover-package="socorro.lib.config_manager"
> 

Typo!
Replace "testConfigurationManager2" with testConfigurationManager"
Comment 4 Peter Bengtsson [:peterbe] 2011-08-15 06:00:57 PDT
Instead of uploading a patch (because I've already committed it in the new_conf branch) see here: 
http://code.google.com/p/socorro/source/detail?r=3449

I'm currently stuck on tests that use `ConfigManager(..., use_config_files=True, ...)` because they need to wrap this `_application` stuff which I haven't really understood yet.
Comment 5 Peter Bengtsson [:peterbe] 2011-09-22 09:55:05 PDT
For what it's worth, development has moved here:
https://github.com/twobraids/configman

As of now, the code is 100% independent of Socorro. Has 68% test coverage, needs some more restructuring (tests directory, setup.py file)
Comment 6 Peter Bengtsson [:peterbe] 2012-10-02 12:44:02 PDT
We have since moved properly to configman.

Note You need to log in before you can comment on or make changes to this bug.