[GRASS-dev] [GRASS GIS] #3774: lib/gis/testsuite/test_parser_json.py are failing

#3774: lib/gis/testsuite/test_parser_json.py are failing
-------------------------+-------------------------
Reporter: pmav99 | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Tests | Version: svn-trunk
Keywords: | CPU: Unspecified
Platform: Unspecified |
-------------------------+-------------------------
The tests on {{{lib/gis/testsuite/test_parser_json.py}}} are failing both
on Python 2 + 3.

{{{
- [{'param': 'input', 'value': 'hospitals'},
+ [{'param': 'input', 'value': 'hospitals@PERMANENT'},
}}}

The tests are also using {{{simplejson}}} which is 3rd party
lib and needs to be installed. I would advise changing that to {{{json}}}.
A simple {{{s/simplejson/json/g}}} should do it.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3774&gt;
GRASS GIS <https://grass.osgeo.org>

#3774: lib/gis/testsuite/test_parser_json.py are failing
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone:
Component: Tests | Version: svn-trunk
Resolution: fixed | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Changes (by neteler):

* status: new => closed
* resolution: => fixed

Comment:

In [changeset:"74162" 74162]:
{{{
#!CommitTicketReference repository="" revision="74162"
test_parser_json.py testsuite: use json instead of simplejson (fixes
#3774) (contributed by pmav99)
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3774#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3774: lib/gis/testsuite/test_parser_json.py are failing
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone:
Component: Tests | Version: svn-trunk
Resolution: fixed | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by neteler):

Thanks for catching this.

Replying to [ticket:3774 pmav99]:
>
> {{{
> - [{'param': 'input', 'value': 'hospitals'},
> + [{'param': 'input', 'value': 'hospitals@PERMANENT'},
> }}}

... this code I didn't find. Where is that located?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3774#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3774: lib/gis/testsuite/test_parser_json.py are failing
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone:
Component: Tests | Version: svn-trunk
Resolution: fixed | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by pmav99):

@neteler yes, I am sorry, I should have elaborated a bit more.

That was the output of the tests that show the differences between
expected and actual output. The lines that throw the errors are 46 and 74.

I don't feel comfortable suggesting a fix here, because I am not familiar
enough with fully qualified map names and their nuances. In other words I
can't really judge if the error is in the test itself or in the tested
code. But the test is failing and needs to be fixed.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3774#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#3774: lib/gis/testsuite/test_parser_json.py are failing
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: defect | Status: reopened
  Priority: normal | Milestone:
Component: Tests | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Changes (by neteler):

* status: closed => reopened
* resolution: fixed =>

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3774#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#3774: lib/gis/testsuite/test_parser_json.py are failing
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone:
Component: Tests | Version: svn-trunk
Resolution: fixed | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Changes (by sbl):

* status: reopened => closed
* resolution: => fixed

Comment:

Just ran the test locally:

{{{
bin.x86_64-pc-linux-gnu/grass77 -c ./demolocation/stefan --exec python
./lib/gis/testsuite/test_parser_json.py
}}}
and it passed without error, both with demolocation and nc_spm_08_grass7.

Closing the ticket, feel free to reopen if needed

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3774#comment:5&gt;
GRASS GIS <https://grass.osgeo.org>