#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 by , 10 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:2 by , 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 https://svn.osgeo.org/grass/ will not change (much often).
comment:3 by , 10 years ago
| Component: | Default → Tests |
|---|---|
| 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:5 by , 10 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |

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:
For me on Ubuntu 14.04 the output is following.