From 288272c4f312487ccf7a8dd6f8d23e009dfc6a6e Mon Sep 17 00:00:00 2001 From: afabiani Date: Tue, 22 Oct 2019 17:47:02 +0200 Subject: [PATCH] fix travis build --- .travis.yml | 17 ++- requirements.txt | 6 +- setup.py | 2 +- src/wpsremote/resource_monitor.py | 1 + .../configs/myservice/code/test_xml.py | 2 +- .../xmpp_data/configs/myservice/myservice.7z | Bin 0 -> 4021 bytes .../configs/myservice/service.config.test_xml | 102 ++++++++++++++++++ test_suite.sh | 4 +- 8 files changed, 124 insertions(+), 10 deletions(-) create mode 100644 src/wpsremote/xmpp_data/configs/myservice/myservice.7z create mode 100644 src/wpsremote/xmpp_data/configs/myservice/service.config.test_xml diff --git a/.travis.yml b/.travis.yml index b74aa7b..fb725c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,26 @@ +# sudo: false +# cache: +# directories: +# - "$HOME" language: python matrix: include: - - python: 2.7.8 - dist: precise - before_install: pip install --upgrade pip setuptools + # - python: 2.7.8 + # dist: precise + # before_install: pip install --upgrade pip setuptools - python: 2.7 - python: 3.7 allow_failures: - python: 3.7 install: + # - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then travis_retry pip install -r requirements.txt ; fi + # - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then travis_retry pip install coveralls ; fi - travis_retry pip install coveralls -r requirements.txt script: - - flake8 . - - python setup.py test - coverage run --source=src setup.py test + - flake8 *.py + - flake8 src/wpsremote + - flake8 test after_success: coveralls notifications: email: diff --git a/requirements.txt b/requirements.txt index 630ad1d..7898310 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ asn1crypto==0.24.0 +astroid==1.4.4 autopep8==1.4.3 bcrypt==3.1.4 bleach==3.1.0 @@ -11,17 +12,20 @@ cryptography==2.3.1 docutils==0.15.2 enum34==1.1.6 flake8==3.7.8 -functools32==3.2.3.post2 idna==2.7 ipaddress==1.0.22 jsonschema==2.5.1 lazy-object-proxy==1.2.1 +mccabe<0.7.0,>=0.6.0 +pep8==1.7.1 paramiko==2.4.2 pkginfo==1.5.0.1 psutil==5.4.7 pyasn1==0.4.4 +pycodestyle<2.6.0,>=2.5.0 pycparser==2.18 pycrypto==2.6.1 +pyflakes<2.2.0,>=2.1.0 Pygments==2.4.2 pylint==1.5.4 PyNaCl==1.2.1 diff --git a/setup.py b/setup.py index 7f49260..f3c6130 100644 --- a/setup.py +++ b/setup.py @@ -55,7 +55,7 @@ try: readme_text = file('README.md', 'rb').read() except IOError as e: - readme_text = '' + readme_text = open('README.md', 'rb').read() setup( name="wps-remote", diff --git a/src/wpsremote/resource_monitor.py b/src/wpsremote/resource_monitor.py index cbb9e22..31f1729 100644 --- a/src/wpsremote/resource_monitor.py +++ b/src/wpsremote/resource_monitor.py @@ -4,6 +4,7 @@ # This code is licensed under the GPL 2.0 license, available at the root # application directory. +# import time import psutil import logging import threading diff --git a/src/wpsremote/xmpp_data/configs/myservice/code/test_xml.py b/src/wpsremote/xmpp_data/configs/myservice/code/test_xml.py index 11b444a..d8b72db 100644 --- a/src/wpsremote/xmpp_data/configs/myservice/code/test_xml.py +++ b/src/wpsremote/xmpp_data/configs/myservice/code/test_xml.py @@ -22,7 +22,7 @@ def run(self): ret = 0 self.logger.info("ProgressInfo:100%") - except: + except BaseException: ret = -1 self.logger.critical("Error occurred during processing.") diff --git a/src/wpsremote/xmpp_data/configs/myservice/myservice.7z b/src/wpsremote/xmpp_data/configs/myservice/myservice.7z new file mode 100644 index 0000000000000000000000000000000000000000..ece6127202348d30c4563e7234a7e5c55adcc8eb GIT binary patch literal 4021 zcmV;m4@&Sidc3bE8~_Bh2YZro4*&oF0000Z0000000028qicBJK3@)fT>ue?0Z`!$ z%}$uMZtBA2bb&(|m{QDX=h&uVIDt=)^r;$zt?Haxl^eZ&{25SUaE0;Gxrva`*w*eb zT$EsfaoPWWnw1oV$1Gt4lRn@$?;Ql7zStiQ>LOp8EM?V_ntpPyxDxIxd{&a+L^*f+ zGZJ$n*)Kngb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#61`zQ~G@q{Pb0v9&-2ANDvdLoBt>h<%Nkp2J+~NlK z#8FCoujNaoBNJpnvfr6qQSrq5r2Ty@mDQ_j{j207ozL_7kh;Zh+UVpOe-b1j;z8iX z?QcB=2=f_$7+wrlRfg+gl5Y=XBi(*60BAd7ssjF5DuWeLK%a$^fC}LKyPtjcb-f24 zcS{NFu9uH!;TSVJiPJrR@0l#xaFV;_xTK7i_T<4mRa1;h3x*#ZNp(GJ}^3fUsJ@a*2}9wJ)c*&b1I z^yI|EJ1Ezk5y9C@fYkBt7B4o-lIQhDLk~vxEwh9O&aYDhk$nd9e$*{k7%@B-5%FS{l zBKwh`?Iq%geL#S^-;^d0-raf%Ev*6HZ)O9&s5r-SbP^Qaf+-I;i92|H!X9^aq|HEl zudO`Z1xl7J_06lXmio;PP~f|k8n6q-_~DtoEbi?E_OlY!Yt2z;02c<1g#ihG?EnW0 b0RRCb0|5aAT>uaO01Sbe3ITcJ1kV5fT`;=# literal 0 HcmV?d00001 diff --git a/src/wpsremote/xmpp_data/configs/myservice/service.config.test_xml b/src/wpsremote/xmpp_data/configs/myservice/service.config.test_xml new file mode 100644 index 0000000..6453e47 --- /dev/null +++ b/src/wpsremote/xmpp_data/configs/myservice/service.config.test_xml @@ -0,0 +1,102 @@ +# (c) 2016 Open Source Geospatial Foundation - all rights reserved +# (c) 2014 - 2015 Centre for Maritime Research and Experimentation (CMRE) +# (c) 2013 - 2014 German Aerospace Center (DLR) +# This code is licensed under the GPL 2.0 license, available at the root +# application directory. + +# This is a INI file to be read with python ConfigParser (https://docs.python.org/2/library/configparser.html) +# Is possible to reference another variable in the ini file using the format %()s (note the 's' at the end) + +# ########################################### # +# Default Service Params # +# ########################################### # + +[DEFAULT] +service = Greetings +namespace = default +description = Greetings Remote Service +executable_path = ./xmpp_data/configs/myservice/code +executable_cmd = python %(executable_path)s/test_xml.py +output_dir = ./xmpp_data/output/ +unique_execution_id = %(unique_exe_id)s +workdir = %(output_dir)s/%(unique_execution_id)s +active = True +max_running_time_seconds = 300 + +# . This option allows you to set the CPU and Memory average load scan time. +# . It is espressed in 'minutes' and if disabled here it will be set by default +# . to 15 minutes. +load_average_scan_minutes = 1 + +# . Use this option to completely avoid using this host (and prevent starting a new +# . 'processbot') whenever one of the following process names are running. +# . In other words, if one of the following processes are currently running on this machine, +# . GeoServer won't send any WPS execute request until they are finished. +process_blacklist = [{"cwd": "/mnt/d/work/code/python/geonode/geonode-master", "name": "celery", "cmdline": "-A geonode.celery_app:app worker -Q default,geonode,cleanup,update,email -B -E -l INFO"}] + +# ########################################### # +# Inputs and Actions Declaration # +# ########################################### # + +[Input1] +class = param +name = theName +title = theName +type = string +description = theName. +min = 1 +max = 1 +default = Giovanni + +[Action1] +class = cmdline +input_ref = theName +alias = n +template = -name value + +[Const1] +class = const +name = workdir +type = string +description = Remote process sandbox working directory +value = %(workdir)s + +[Action2] +class = cmdline +input_ref = workdir +alias = w +template = -name value + +[Const2] +class = const +name = execution_id +type = string +description = Remote process unique execution id +value = %(unique_execution_id)s + +[Action2] +class = cmdline +input_ref = execution_id +alias = e +template = -name value + +# ########################################### # +# Output Parameters Declaration # +# ########################################### # + +[Output1] +name = result1 +type = text/xml;subtype=gml/3.1.1 +output_mime_type = application/xml +description = WPS Resource XML File +title = greetings.xml +filepath = D:/work/code/python/remote-wps/RemoteWPS/src/wpsremote/%(workdir)s/greetings.xml +publish_as_layer = false + +# ########################################### # +# Logging Options Declaration # +# ########################################### # + +[Logging] +stdout_parser = [.*\[DEBUG\](.*), .*\[INFO\] ProgressInfo\:([-+]?[0-9]*\.?[0-9]*)\%, .*\[(INFO)\](.*), .*\[(WARN)\](.*), .*\[(ERROR)\](.*), .*\[(CRITICAL)\](.*)] +stdout_action = [ignore, progress, log, log, abort, abort] diff --git a/test_suite.sh b/test_suite.sh index a9122a0..1125566 100644 --- a/test_suite.sh +++ b/test_suite.sh @@ -2,8 +2,8 @@ set -e echo "Running... test_computation_job_inputs" -python test/test_computation_job_inputs.py +coverage run --source=src test/test_computation_job_inputs.py echo "Running... test_process_input_parameters" -python test/test_process_input_parameters.py +coverage run --source=src test/test_process_input_parameters.py