From: Doug B. <dou...@gm...> - 2016-08-18 14:37:41
|
On Wed, Aug 17, 2016 at 10:01 AM, John Ralls <jr...@ce...> wrote: > > On Aug 17, 2016, at 4:09 AM, Doug Blank <dou...@gm...> wrote: > > On Wed, Aug 17, 2016 at 6:52 AM, Tim Lyons <guy...@gm...> wrote: > >> Tim Lyons wrote >> > I see in the Travis CI report: >> > >> > >> > nose.plugins.cover: ERROR: Coverage not available: unable to import >> > coverage module >> > >> > .gramps.gen.utils.grampslocale.WARNING: ICU not loaded because No >> module >> > named PyICU. Localization will be impaired. Use your package manager to >> > install PyICU >> > >> > >> > Any idea why neither of these modules are imported? Anybody able to fix >> > this? >> >> >> I have fixed this all in commit >> >> https://github.com/gramps-project/gramps/commit/6245d219a93e >> 9dafa001b8699fc5185f7778c300 > > > Much appreciated! That looks like a solid method to move forward. Now, > coverage reports are updated automatically. We are up to 38.12% (after > starting at 21.52%). Now we can test the pyicu code as well. > > https://codecov.io/gh/gramps-project/gramps > > But we have a long way to go on the testing front to reach a reasonable > 80%. Much of that is GUI code which will need some type of framework (mock, > something gtk-specific, or framebuffer-based, etc). > > > Automated GUI testing is difficult and generally fragile. IMO there's not > a lot of point to it outside of the GUI framework itself. > > A better approach is to ensure that we strictly comply with MVC separation > so that the only thing the view code does is call controller functions with > no manipulation of the results. That makes for what some might consider > excessive back-and-forth in cases like the date validity checks and > anything involving GtkTreeView/GtkTreeModel. The benefit is that if there's > no code worth testing in the GUI directories then we can exclude them from > the coverage computation and be sure that we really do have good coverage > of the important code. > I agree with this philosophy in general---I meant developing tests that exercise the logic in the GUI code, not testing the actual GUI itself. But we can test a lot of logic by instantiating and calling methods in existing GUI classes, by simply mocking a few gtk methods (such as Window.show). -Doug > > Regards, > John Ralls > |