new_conf config_manager test coverage

RESOLVED WORKSFORME

Status

Socorro
Infra
RESOLVED WORKSFORME
6 years ago
5 years ago

People

(Reporter: peterbe, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
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"
(Reporter)

Comment 1

6 years ago
Created attachment 553153 [details]
Sample coverage analysis

This is just a sample coverage report page. Just for the config_manager.py module.
(Reporter)

Comment 2

6 years ago
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/]
(Reporter)

Comment 3

6 years ago
(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"
(Reporter)

Comment 4

6 years ago
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.
(Reporter)

Comment 5

6 years ago
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)
(Assignee)

Updated

5 years ago
Component: Socorro → General
Product: Webtools → Socorro

Updated

5 years ago
Component: General → Infra
(Reporter)

Comment 6

5 years ago
We have since moved properly to configman.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.