Opened 5 years ago

Closed 5 years ago

Last modified 4 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

Description

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/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", 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/main.py", line 143, in <module>
    results_dir=results_dir)
  File "/home/soeren/src/grass7.1/grass_trunk/dist.x86_64-unknown-linux-gnu/etc/python/grass/gunittest/invoker.py", 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/reporters.py", 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/reporters.py", line 110, in get_svn_info
    relurl = entry.find('relative-url').text
AttributeError: 'NoneType' object has no attribute 'text'

Change History (6)

comment:1 Changed 5 years ago by wenzeslaus

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"?>
<info>
<entry
   path="."
   revision="61237"
   kind="dir">
<url>https://svn.osgeo.org/grass/grass/trunk</url>
<relative-url>^/grass/trunk</relative-url>
<repository>
<root>https://svn.osgeo.org/grass</root>
<uuid>15284696-431f-4ddb-bdfa-cd5b030d7da7</uuid>
</repository>
<wc-info>
<wcroot-abspath>/home/vasek/dev/grass/gcc_trunk</wcroot-abspath>
<schedule>normal</schedule>
<depth>infinity</depth>
</wc-info>
<commit
   revision="61236">
<author>wenzeslaus</author>
<date>2014-07-10T19:03:00.447648Z</date>
</commit>
</entry>
</info>

comment:2 Changed 5 years ago by wenzeslaus

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 https://svn.osgeo.org/grass/ will not change (much often).

comment:3 Changed 5 years ago by wenzeslaus

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 Changed 5 years ago by wenzeslaus

This is probably fully fixed in r61244, closing.

comment:5 Changed 5 years ago by wenzeslaus

Resolution: fixed
Status: assignedclosed

comment:6 Changed 4 years ago by neteler

Milestone: 7.1.07.2.0

Milestone renamed

Note: See TracTickets for help on using tickets.