geopython/pywps

failing unit-test

epifanio opened this issue · 7 comments

Description

Attempt to install and run unit-test

The software installs without error, following the documentation - trying to run the test, it fails with the following error:

root@5f142103bda1:~/pywps# python3 -m unittest tests
E
======================================================================
ERROR: tests (unittest.loader._FailedTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/pywps/tests/__init__.py", line 95, in load_tests
    test_storage.load_tests(),
AttributeError: module 'tests.test_storage' has no attribute 'load_tests'

----------------------------------------------------------------------
Ran 1 test in 0.001s

FAILED (errors=1)

After commenting the failing import and its related call() to test_storage, the rror becomes:

python3 -m unittest tests
...................................................EEE.....s.s............................................ss...........................................ss.......
======================================================================
ERROR: test_bbox_output (tests.test_describe.OutputDescriptionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/pywps/tests/test_describe.py", line 385, in test_bbox_output
    doc = bbox.describe_xml()
AttributeError: 'BoundingBoxOutput' object has no attribute 'describe_xml'

======================================================================
ERROR: test_complex_output (tests.test_describe.OutputDescriptionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/pywps/tests/test_describe.py", line 368, in test_complex_output
    doc = complexo.describe_xml()
AttributeError: 'ComplexOutput' object has no attribute 'describe_xml'

======================================================================
ERROR: test_literal_output (tests.test_describe.OutputDescriptionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/pywps/tests/test_describe.py", line 343, in test_literal_output
    doc = literal.describe_xml()
AttributeError: 'LiteralOutput' object has no attribute 'describe_xml'

----------------------------------------------------------------------
Ran 160 tests in 6.500s

FAILED (errors=3, skipped=6)
root@5f142103bda1:~/pywps# 

Environment

  • operating system: Debian SID
  • Python version: 3.9.10
  • PyWPS version: git master
  • source/distribution
  • git clone
  • Debian
  • PyPI
  • zip/tar.gz
  • other (please specify):
  • web server
  • Apache/mod_wsgi
  • CGI
  • other (please specify):

Steps to Reproduce

follow the documentation to run unit-test after successful installation

Additional Information

@epifanio Try to run the tests with pytest -v tests/.

docs are outdated. We already using xfail and skip markers from pytest. Probably these are the failures.

@cehbrecht , I ran the pytest -v tests/. and I confirm all the test passed :)

============= 172 passed, 9 skipped, 2 xfailed in 130.95s (0:02:10)  =======================

I got a few skips (grass, mapserver) - I guess because of my basic configuration - the only failure was on XFAIL (test.opendap.org is offline)

What will be the best approach to build some up-to-date documentation? I guess also the OSGeoLive demo and quickstart are affected, right?

I will work on a dockerfile to have at least pywps installed and make it available via apache, any guidance will be greatly appreciated :)

@epifanio thanks for looking at the "dusty" docs :)

I don't know about OSGeoLive demo. @ldesousa @jachym do you have hints?

I think the pipline with sphinx/readthedocs is broken:
https://pywps.readthedocs.io/en/latest/

A quickstart sounds good :) Could be part of the sphinx docs ... or the README.md:
https://github.com/geopython/pywps/blob/main/README.md

@epifanio When we start a new pywps project, we use a cookiecutter template:
https://github.com/bird-house/cookiecutter-birdhouse

It already contains a Dockerfile ... but also needs to be updated.

For some of our production deployments we use an ansible playbook (with nginx, postgres):
https://github.com/bird-house/ansible-wps-playbook

For our Rook WPS we use the slurm scheduler deployed with ansible:
https://ansible-wps-playbook.readthedocs.io/en/latest/examples.html#install-slurm-cluster

In other projects we are currently looking into writing docs with Markdown:

It is a bit more fun to write in Markdown than in reStructuredText ;)

Future options :)

@cehbrecht thanks for all the pointers! I managed to get a basic WSGI WPS service running from the official HTTPD docker image. I am using Postgres as the DB backend. I found the cooky-cutter templating system very cool and quite useful for a production-like scenario, but hard to integrate into the official pywps repository to have a basic/simple CI workflow to run the test (like we have for the other geopython projects). I was thinking of building a basic docker-compose+dockerfile that could be used to build and test the latest pywps, and then add a few bits of instruction to make a simple demo up and running.

For a potential demo for the OSGeoLive, looks like the processes available in the emu repository are a good starting point, perhaps with a notebook or two to test the processes using owslib. The OSGeoLive has already a jupyter environment.

@epifanio The cookiecutter template has a Dockerfile which wasn't updated for quite some time:
https://github.com/bird-house/cookiecutter-birdhouse/blob/master/%7B%7Bcookiecutter.project_slug%7D%7D/Dockerfile

Example in Emu:
https://github.com/bird-house/emu/blob/master/Dockerfile

This could also be a docker-compose if you want to use postgres, nginx, ...

Some processes in Emu were taken from the original pywps, like say_hello, ultimate_question, sleepand binary_operator:
https://github.com/bird-house/emu/blob/master/emu/processes/wps_say_hello.py