[GRASS-dev] v.what: test_vwhat_layers is failing
Vaclav Petras
wenzeslaus at gmail.com
Wed Nov 5 06:07:34 PST 2014
On Wed, Nov 5, 2014 at 3:32 AM, Markus Metz <markus.metz.giswork at gmail.com>
wrote:
> On Mon, Nov 3, 2014 at 4:53 PM, Anna Petrášová <kratochanna at gmail.com>
> wrote:
> >
> >
> > On Mon, Nov 3, 2014 at 9:18 AM, Vaclav Petras <wenzeslaus at gmail.com>
> wrote:
> >>
> >> It seems that v.what's test_vwhat_layers test file is randomly failing
> >> time to time with "ERROR: Unable to start driver <(null)>".
> >
> >
> > It looks like db connection is not set at all. I added calling
> db.connect -c
> > to the test. However, I am not sure, is this how it is supposed to work?
> > Almost no db module initializes db when not set.
>
> The GRASS start-up script initializes db with db.connect -c when not set:
>
> https://trac.osgeo.org/grass/browser/grass/trunk/lib/init/grass.py#L1435
>
> therefore this problem does not occur if you start GRASS with grass.py
>
> Testing script is using init() function from grass.script.setup, so
should be `db.connect -c` there?
http://trac.osgeo.org/grass/browser/grass/trunk/lib/python/gunittest/multirunner.py#L95
Regarding v.what's test_vwhat_layers test, the error is correct
> because db.tables lists tables in the given database using the
> specified driver. It is an error if either database or driver are not
> specified for db.tables.
>
> This makes sense, perhaps the error message could be more informative in
case of db driver being NULL (or whatever is the value in C) so that you
can get something like:
ERROR: Unable to start driver because it is set to NULL. Was database
connected using db.connect?
What do you think?
Vaclav
Markus M
>
> > I ran into the same problem
> > when a shapefile is imported during creating new location.
> >
> > Anna
> >
> >>
> >> ======================================================================
> >> ERROR: setUpClass (__main__.TestMultiLayerMap)
> >> ----------------------------------------------------------------------
> >> Traceback (most recent call last):
> >> File "vector/v.what/testsuite/test_vwhat_layers.py", line 121, in
> >> setUpClass
> >> cls.runModule('db.in.ogr', dsn='./data/table1.csv', output='t1')
> >> File "etc/python/grass/gunittest/case.py", line 953, in runModule
> >> errors=errors)
> >> CalledModuleError: Module run 1 db.in.ogr ended with error
> >> Process ended with non-zero return code
> db.in_ogr(dsn='./data/table1.csv',
> >> output='t1'). See the following errors:
> >> ERROR: Unable to start driver <(null)>
> >> Traceback (most recent call last):
> >> File "scripts/db.in.ogr", line 127, in <module>
> >> main()
> >> File "scripts/db.in.ogr", line 76, in main
> >> s = grass.read_command('db.tables', flags = 'p')
> >> File "etc/python/grass/script/core.py", line 420, in read_command
> >> returncode=returncode)
> >> grass.exceptions.CalledModuleError: Module run None db.tables -p ended
> >> with error
> >> Process ended with non-zero return code 1. See errors in the (error)
> >> output.
> >>
> >>
> >>
> http://fatra.cnr.ncsu.edu/grassgistests/reports_for_date-2014-11-02-08-00/report_for_nc_spm_08_grass7_nc/vector/v.what/index.html
> >>
> >>
> http://fatra.cnr.ncsu.edu/grassgistests/reports_for_date-2014-11-03-08-00/report_for_nc_spm_08_grass7_nc/vector/v.what/test_vwhat_layers/index.html
> >>
> >> _______________________________________________
> >> grass-dev mailing list
> >> grass-dev at lists.osgeo.org
> >> http://lists.osgeo.org/mailman/listinfo/grass-dev
> >
> >
> >
> > _______________________________________________
> > grass-dev mailing list
> > grass-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/grass-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20141105/ead9d4b3/attachment-0001.html>
More information about the grass-dev
mailing list