Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#2364 closed defect (fixed)

Error in gunittest get_svn_info()

Reported by: huhabla Owned by: wenzeslaus
Priority: major Milestone: 7.2.0
Component: Tests Version: svn-trunk
Keywords: gunittest, testsuite, report Cc:
CPU: x86-64 Platform: Linux


The SVN metadata analyzer in gunittest produces an error on my system when invoking a test:

GRASS 7.1.svn (LL):~/src/grass7.1/grass_trunk/raster/r.gwflow >  python -m grass.gunittest.main ~/grassdata LAEA_ERTS89 LAEA_ERTS89
Traceback (most recent call last):
  File "/usr/lib/python2.7/", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/", line 72, in _run_code
    exec code in run_globals
  File "/home/soeren/src/grass7.1/grass_trunk/dist.x86_64-unknown-linux-gnu/etc/python/grass/gunittest/", line 143, in <module>
  File "/home/soeren/src/grass7.1/grass_trunk/dist.x86_64-unknown-linux-gnu/etc/python/grass/gunittest/", line 125, in run_in_location
    self.reporter = GrassTestFilesReporter(results_dir=results_dir)
  File "/home/soeren/src/grass7.1/grass_trunk/dist.x86_64-unknown-linux-gnu/etc/python/grass/gunittest/", line 135, in __init__
    svn_info = get_svn_info()
  File "/home/soeren/src/grass7.1/grass_trunk/dist.x86_64-unknown-linux-gnu/etc/python/grass/gunittest/", line 110, in get_svn_info
    relurl = entry.find('relative-url').text
AttributeError: 'NoneType' object has no attribute 'text'

Change History (6)

comment:1 by wenzeslaus, 10 years ago

Owner: changed from grass-dev@… to wenzeslaus
Status: newassigned

Hm, I hoped that XML (svn ... --xml) will be somehow stable API. Perhaps forward compatible but not backward.

I can add some more general try-except or check of installed svn version.

Please run for me:

svn --version
svn info --xml

For me on Ubuntu 14.04 the output is following.

svn, version 1.8.8 (r1568071)
   compiled Feb 24 2014, 10:11:25 on x86_64-pc-linux-gnu
<?xml version="1.0" encoding="UTF-8"?>

comment:2 by wenzeslaus, 10 years ago

r61244 now determines relative URL from url if relative-url is not available (regardless of svn version). I suppose that url is available in svn versions and that will not change (much often).

comment:3 by wenzeslaus, 10 years ago

Component: DefaultTests
Keywords: report added

I've tested this using some dummy XML node but it would be good to be sure that it really works with older SVN (I have 1.8.8).

I've also implemented (but not used) a function which is using svnversion but this does not have to be available and gives only the version and must be parsed anyway (and it gives a lot of various results which are perhaps even more complex than from svn info).

comment:4 by wenzeslaus, 10 years ago

This is probably fully fixed in r61244, closing.

comment:5 by wenzeslaus, 10 years ago

Resolution: fixed
Status: assignedclosed

comment:6 by neteler, 8 years ago


Milestone renamed

Note: See TracTickets for help on using tickets.