Console Output
[NBI-stage_2_master] Running shell script
+ runuser jenkins -c devops-stages/stage-test.sh
Launching tox
ERROR: invocation failed (exit code 1), logfile: /tmp/.tox/black/log/black-0.log
================================== log start ===================================
black create: /tmp/.tox/black
black installdeps: black==23.12.1
black installed: black==23.12.1,click==8.1.7,mypy-extensions==1.0.0,packaging==24.0,pathspec==0.12.1,platformdirs==4.2.0,tomli==2.0.1,typing_extensions==4.10.0
black run-test-pre: PYTHONHASHSEED='3404101604'
black run-test: commands[0] | black --check --diff osm_nbi/
--- /home/jenkins/workspace/NBI-stage_2_master/osm_nbi/validation.py 2024-04-04 11:55:59.530844+00:00
+++ /home/jenkins/workspace/NBI-stage_2_master/osm_nbi/validation.py 2024-04-04 11:56:15.857888+00:00
@@ -1094,36 +1094,36 @@
scalingnode_new_schema = {
"title": "scaling up/down the node of an k8scluster input schema",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
- "properties":{
+ "properties": {
"nodecount": integer0_schema,
- }
+ },
}
app_profiles_new_schema = {}
infra_profiles_new_schema = {
"type": "object",
- "properties":{
+ "properties": {
"template_name": string_schema,
- }
+ },
}
clusterupgrade_new_schema = {
"type": "object",
- "properties":{
+ "properties": {
"version": string_schema,
- }
+ },
}
cluster_renew_cert_new_schema = {
"type": "object",
- "properties":{
+ "properties": {
"duration": string_schema,
- }
+ },
}
# USERS
project_role_mappings = {
"title": "list pf projects/roles",
@@ -1568,10 +1568,11 @@
"CallbackUri": description_schema,
"authentication": authentication_schema,
},
"required": ["filter", "CallbackUri"],
}
+
class ValidationError(Exception):
def __init__(self, message, http_code=HTTPStatus.UNPROCESSABLE_ENTITY):
self.http_code = http_code
Exception.__init__(self, message)
would reformat /home/jenkins/workspace/NBI-stage_2_master/osm_nbi/validation.py
--- /home/jenkins/workspace/NBI-stage_2_master/osm_nbi/nbi.py 2024-04-04 11:55:59.526844+00:00
+++ /home/jenkins/workspace/NBI-stage_2_master/osm_nbi/nbi.py 2024-04-04 11:56:16.307592+00:00
@@ -692,43 +692,42 @@
"ROLE_PERMISSION": "k8scluster:id:app_profiles",
},
"infra_profiles": {
"METHODS": ("PATCH", "GET"),
"ROLE_PERMISSION": "k8scluster:id:infra_profiles",
- }
- },
- },
+ },
+ },
+ },
"app_profiles": {
"METHODS": ("POST", "GET"),
"ROLE_PERMISSION": "k8scluster:app_profiles",
"<ID>": {
"METHODS": ("GET", "PATCH", "DELETE"),
"ROLE_PERMISSION": "k8scluster:app_profiles:id",
- }
+ },
},
"infra_profiles": {
"METHODS": ("POST", "GET"),
"ROLE_PERMISSION": "k8scluster:infra_profiles",
"<ID>": {
"METHODS": ("GET", "PATCH", "DELETE"),
"ROLE_PERMISSION": "k8scluster:infra_profiles:id",
- }
+ },
},
"<ID>": {
"cluster_validity": {
"METHODS": ("GET",),
"ROLE_PERMISSION": "k8scluster:id:cluster_validity",
},
"renew_certificate": {
"METHODS": ("POST",),
"ROLE_PERMISSION": "k8scluster:id:renew_certificate",
},
- }
+ },
}
- }
+ },
}
-
class NbiException(Exception):
def __init__(self, message, http_code=HTTPStatus.METHOD_NOT_ALLOWED):
Exception.__init__(self, message)
@@ -1635,30 +1634,30 @@
outdata = file
elif not _id:
outdata = self.engine.get_item_list(
engine_session, engine_topic, kwargs, api_req=True
)
- elif topic == "clusters":
+ elif topic == "clusters":
outdata = self.engine.get_item_list(
rollback, engine_session, engine_topic, kwargs
)
if item in ("node_count", "get_creds"):
outdata = self.engine.get_item(
rollback, engine_session, engine_topic, kwargs
- )
+ )
if item in ("app_profiles", "infra_profiles"):
outdata = self.engine.get_item_list(
rollback, engine_session, engine_topic, kwargs
- )
+ )
elif topic == "app_profiles":
- outdata = self.engine.get_item_list(
- rollback, engine_session, engine_topic, kwargs
- )
+ outdata = self.engine.get_item_list(
+ rollback, engine_session, engine_topic, kwargs
+ )
elif topic == "infra_profiles":
- outdata = self.engine.get_item_list(
- rollback, engine_session, engine_topic, kwargs
- )
+ outdata = self.engine.get_item_list(
+ rollback, engine_session, engine_topic, kwargs
+ )
else:
if item == "reports":
# TODO check that project_id (_id in this context) has permissions
_id = args[0]
filter_q = None
@@ -1797,11 +1796,11 @@
rollback, engine_session, engine_topic, kwargs
)
elif topic == "infra_profiles":
_id = self.engine.new_item(
rollback, engine_session, engine_topic, kwargs
- )
+ )
else:
_id, op_id = self.engine.new_item(
rollback,
engine_session,
engine_topic,
@@ -1819,11 +1818,11 @@
elif method == "DELETE":
if not _id:
outdata = self.engine.del_item_list(
engine_session, engine_topic, kwargs
)
- cherrypy.response.status = HTTPStatus.OK.value
+ cherrypy.response.status = HTTPStatus.OK.value
else: # len(args) > 1
# for NS NSI generate an operation
op_id = None
if topic == "ns_instances_content" and not engine_session["force"]:
nslcmop_desc = {
@@ -1837,36 +1836,27 @@
if op_id:
outdata = {"_id": op_id}
elif (
topic == "netslice_instances_content"
and not engine_session["force"]
- ):
+ ):
nsilcmop_desc = {
"lcmOperationType": "terminate",
"netsliceInstanceId": _id,
"autoremove": True,
}
op_id, _ = self.engine.new_item(
rollback, engine_session, "nsilcmops", nsilcmop_desc, None
)
if op_id:
outdata = {"_id": op_id}
- elif (
- topic == "clusters"
- and not engine_session["force"]
- ):
+ elif topic == "clusters" and not engine_session["force"]:
outdata = {"_id": op_id}
- elif (
- topic == "app_profiles"
- and not engine_session["force"]
- ):
+ elif topic == "app_profiles" and not engine_session["force"]:
outdata = {"_id": op_id}
- elif (
- topic == "infra_profiles"
- and not engine_session["force"]
- ):
- outdata = {"_id": op_id}
+ elif topic == "infra_profiles" and not engine_session["force"]:
+ outdata = {"_id": op_id}
# if there is not any deletion in process, delete
if not op_id:
op_id = self.engine.del_item(engine_session, engine_topic, _id)
if op_id:
would reformat /home/jenkins/workspace/NBI-stage_2_master/osm_nbi/nbi.py
Oh no! 💥 💔 💥
2 files would be reformatted, 32 files would be left unchanged.
ERROR: InvocationError for command /tmp/.tox/black/bin/black --check --diff osm_nbi/ (exited with code 1)
=================================== log end ====================================
✖ FAIL black in 7.235 seconds
ERROR: invocation failed (exit code 1), logfile: /tmp/.tox/flake8/log/flake8-0.log
================================== log start ===================================
flake8 create: /tmp/.tox/flake8
flake8 installdeps: flake8
flake8 develop-inst: /home/jenkins/workspace/NBI-stage_2_master
flake8 installed: flake8==7.0.0,mccabe==0.7.0,-e git+https://osm.etsi.org/gerrit/osm/NBI.git@7623b8ce032f984ced08d20a57685fce58a59ceb#egg=osm_nbi,pycodestyle==2.11.1,pyflakes==3.2.0
flake8 run-test-pre: PYTHONHASHSEED='397599193'
flake8 run-test: commands[0] | flake8 osm_nbi/ setup.py
osm_nbi/engine.py:93:16: F821 undefined name 'k8sTopic'
"k8s": k8sTopic,
^
osm_nbi/nbi.py:732:1: E303 too many blank lines (3)
class NbiException(Exception):
^
osm_nbi/nbi.py:1647:21: E122 continuation line missing indentation or outdented
)
^
osm_nbi/nbi.py:1651:21: E122 continuation line missing indentation or outdented
)
^
osm_nbi/nbi.py:1653:22: E111 indentation is not a multiple of 4
outdata = self.engine.get_item_list(
^
osm_nbi/nbi.py:1653:22: E117 over-indented
outdata = self.engine.get_item_list(
^
osm_nbi/nbi.py:1654:29: E126 continuation line over-indented for hanging indent
rollback, engine_session, engine_topic, kwargs
^
osm_nbi/nbi.py:1655:21: E122 continuation line missing indentation or outdented
)
^
osm_nbi/nbi.py:1657:22: E111 indentation is not a multiple of 4
outdata = self.engine.get_item_list(
^
osm_nbi/nbi.py:1657:22: E117 over-indented
outdata = self.engine.get_item_list(
^
osm_nbi/nbi.py:1658:29: E126 continuation line over-indented for hanging indent
rollback, engine_session, engine_topic, kwargs
^
osm_nbi/nbi.py:1659:21: E122 continuation line missing indentation or outdented
)
^
osm_nbi/validation.py:1099:17: E231 missing whitespace after ':'
"properties":{
^
osm_nbi/validation.py:1108:17: E231 missing whitespace after ':'
"properties":{
^
osm_nbi/validation.py:1115:17: E231 missing whitespace after ':'
"properties":{
^
osm_nbi/validation.py:1122:17: E231 missing whitespace after ':'
"properties":{
^
osm_nbi/validation.py:1574:1: E302 expected 2 blank lines, found 1
class ValidationError(Exception):
^
ERROR: InvocationError for command /tmp/.tox/flake8/bin/flake8 osm_nbi/ setup.py (exited with code 1)
=================================== log end ====================================
✖ FAIL flake8 in 9.029 seconds
✔ OK safety in 38.577 seconds
ERROR: invocation failed (exit code 1), logfile: /tmp/.tox/cover/log/cover-0.log
================================== log start ===================================
cover create: /tmp/.tox/cover
cover installdeps: -r/home/jenkins/workspace/NBI-stage_2_master/requirements.txt, -r/home/jenkins/workspace/NBI-stage_2_master/requirements-dev.txt, -r/home/jenkins/workspace/NBI-stage_2_master/requirements-test.txt
cover develop-inst: /home/jenkins/workspace/NBI-stage_2_master
cover installed: aiohttp==3.8.5,aiokafka==0.8.1,aioresponses==0.7.4,aiosignal==1.3.1,annotated-types==0.5.0,async-timeout==4.0.3,asynctest==0.13.0,attrs==23.1.0,autocommand==2.2.2,cefevent==0.5.4,certifi==2023.7.22,charset-normalizer==3.2.0,cheroot==10.0.0,CherryPy==18.8.0,coverage==7.3.1,dataclasses==0.6,debtcollector==2.5.0,deepdiff==6.5.0,dnspython==2.4.2,enum34==1.1.10,frozenlist==1.4.0,idna==3.4,inflect==7.0.0,iso8601==2.0.0,jaraco.collections==4.3.0,jaraco.context==4.3.0,jaraco.functools==3.9.0,jaraco.text==3.11.1,jsonschema==4.19.1,jsonschema-specifications==2023.7.1,kafka-python==2.0.2,keystoneauth1==5.3.0,lxml==5.2.1,more-itertools==10.1.0,motor==3.3.1,msgpack==1.0.7,multidict==6.0.4,netaddr==0.9.0,netifaces==0.11.0,nose2==0.13.0,ordered-set==4.1.0,os-service-types==1.7.0,oslo.config==9.2.0,oslo.i18n==6.1.0,oslo.serialization==5.2.0,oslo.utils==6.2.1,osm-common @ git+https://osm.etsi.org/gerrit/osm/common.git@a690b2ca4a6eeb821d3a3ba5c5e8dccf578018ff,osm-im @ git+https://osm.etsi.org/gerrit/osm/IM.git@90ffed24477703d8b77f8805c567cdaba0798ea6,-e git+https://osm.etsi.org/gerrit/osm/NBI.git@7623b8ce032f984ced08d20a57685fce58a59ceb#egg=osm_nbi,packaging==23.1,pbr==5.11.1,portend==3.2.0,pyang==2.5.3,pyangbind==0.8.3.post1,pycryptodome==3.19.0,pydantic==2.4.2,pydantic_core==2.10.1,pymongo==4.5.0,pyparsing==3.1.1,python-keystoneclient==5.2.0,pytz==2023.3.post1,PyYAML==6.0.1,referencing==0.30.2,regex==2023.12.25,requests==2.31.0,rfc3986==2.0.0,rpds-py==0.10.3,six==1.16.0,stevedore==5.1.0,tacacs-plus==2.6,tempora==5.5.0,typing_extensions==4.8.0,tzdata==2023.3,urllib3==2.0.5,wrapt==1.15.0,yarl==1.9.2,zc.lockfile==3.0.post1
cover run-test-pre: PYTHONHASHSEED='2295005387'
cover run-test: commands[0] | sh -c 'rm -f nosetests.xml'
cover run-test: commands[1] | coverage erase
cover run-test: commands[2] | nose2 -C --coverage osm_nbi -s osm_nbi/tests
EE...............EE
======================================================================
ERROR: test_descriptor_topics (nose2.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_descriptor_topics
Traceback (most recent call last):
File "/tmp/.tox/cover/lib/python3.10/site-packages/nose2/plugins/loader/discovery.py", line 196, in _find_tests_in_file
module = util.module_from_name(module_name)
File "/tmp/.tox/cover/lib/python3.10/site-packages/nose2/util.py", line 73, in module_from_name
__import__(name)
File "/home/jenkins/workspace/NBI-stage_2_master/osm_nbi/tests/test_descriptor_topics.py", line 38, in <module>
from osm_nbi.engine import EngineException
File "/home/jenkins/workspace/NBI-stage_2_master/osm_nbi/engine.py", line 67, in <module>
class Engine(object):
File "/home/jenkins/workspace/NBI-stage_2_master/osm_nbi/engine.py", line 93, in Engine
"k8s": k8sTopic,
NameError: name 'k8sTopic' is not defined
======================================================================
ERROR: test_admin_topics (nose2.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_admin_topics
Traceback (most recent call last):
File "/tmp/.tox/cover/lib/python3.10/site-packages/nose2/plugins/loader/discovery.py", line 196, in _find_tests_in_file
module = util.module_from_name(module_name)
File "/tmp/.tox/cover/lib/python3.10/site-packages/nose2/util.py", line 73, in module_from_name
__import__(name)
File "/home/jenkins/workspace/NBI-stage_2_master/osm_nbi/tests/test_admin_topics.py", line 37, in <module>
from osm_nbi.engine import EngineException
File "/home/jenkins/workspace/NBI-stage_2_master/osm_nbi/engine.py", line 67, in <module>
class Engine(object):
File "/home/jenkins/workspace/NBI-stage_2_master/osm_nbi/engine.py", line 93, in Engine
"k8s": k8sTopic,
NameError: name 'k8sTopic' is not defined
======================================================================
ERROR: test_instance_topics (nose2.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_instance_topics
Traceback (most recent call last):
File "/tmp/.tox/cover/lib/python3.10/site-packages/nose2/plugins/loader/discovery.py", line 196, in _find_tests_in_file
module = util.module_from_name(module_name)
File "/tmp/.tox/cover/lib/python3.10/site-packages/nose2/util.py", line 73, in module_from_name
__import__(name)
File "/home/jenkins/workspace/NBI-stage_2_master/osm_nbi/tests/test_instance_topics.py", line 23, in <module>
from osm_nbi.engine import EngineException
File "/home/jenkins/workspace/NBI-stage_2_master/osm_nbi/engine.py", line 67, in <module>
class Engine(object):
File "/home/jenkins/workspace/NBI-stage_2_master/osm_nbi/engine.py", line 93, in Engine
"k8s": k8sTopic,
NameError: name 'k8sTopic' is not defined
======================================================================
ERROR: test_pmjobs_topic (nose2.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_pmjobs_topic
Traceback (most recent call last):
File "/tmp/.tox/cover/lib/python3.10/site-packages/nose2/plugins/loader/discovery.py", line 196, in _find_tests_in_file
module = util.module_from_name(module_name)
File "/tmp/.tox/cover/lib/python3.10/site-packages/nose2/util.py", line 73, in module_from_name
__import__(name)
File "/home/jenkins/workspace/NBI-stage_2_master/osm_nbi/tests/test_pmjobs_topic.py", line 23, in <module>
from osm_nbi.engine import EngineException
File "/home/jenkins/workspace/NBI-stage_2_master/osm_nbi/engine.py", line 67, in <module>
class Engine(object):
File "/home/jenkins/workspace/NBI-stage_2_master/osm_nbi/engine.py", line 93, in Engine
"k8s": k8sTopic,
NameError: name 'k8sTopic' is not defined
----------------------------------------------------------------------
Ran 19 tests in 0.624s
FAILED (errors=4)
Name Stmts Miss Cover
--------------------------------------------------------------
osm_nbi/__init__.py 7 2 71%
osm_nbi/admin_topics.py 743 573 23%
osm_nbi/auth.py 405 405 0%
osm_nbi/authconn.py 91 48 47%
osm_nbi/authconn_internal.py 374 334 11%
osm_nbi/authconn_keystone.py 338 303 10%
osm_nbi/authconn_tacacs.py 62 39 37%
osm_nbi/base_topic.py 326 130 60%
osm_nbi/descriptor_topics.py 1001 666 33%
osm_nbi/engine.py 158 131 17%
osm_nbi/html_out.py 65 65 0%
osm_nbi/instance_topics.py 1314 802 39%
osm_nbi/nbi.py 818 818 0%
osm_nbi/notifications.py 170 170 0%
osm_nbi/osm_vnfm/__init__.py 0 0 100%
osm_nbi/osm_vnfm/base_methods.py 6 0 100%
osm_nbi/osm_vnfm/vnf_instance_actions.py 90 16 82%
osm_nbi/osm_vnfm/vnf_instances.py 99 3 97%
osm_nbi/osm_vnfm/vnf_subscription.py 37 31 16%
osm_nbi/pmjobs_topics.py 62 51 18%
osm_nbi/subscription_topics.py 120 103 14%
osm_nbi/subscriptions.py 172 172 0%
osm_nbi/tests/test_admin_topics.py 747 733 2%
osm_nbi/tests/test_base_topic.py 102 6 94%
osm_nbi/tests/test_db_descriptors.py 8 0 100%
osm_nbi/tests/test_descriptor_topics.py 1039 1024 1%
osm_nbi/tests/test_instance_topics.py 385 379 2%
osm_nbi/tests/test_osm_vnfm.py 101 0 100%
osm_nbi/tests/test_pkg_descriptors.py 8 0 100%
osm_nbi/tests/test_pmjobs_topic.py 65 58 11%
osm_nbi/utils.py 44 27 39%
osm_nbi/validation.py 147 14 90%
osm_nbi/vnf_instance_topics.py 27 2 93%
--------------------------------------------------------------
TOTAL 9131 7105 22%
ERROR: InvocationError for command /tmp/.tox/cover/bin/nose2 -C --coverage osm_nbi -s osm_nbi/tests (exited with code 1)
=================================== log end ====================================
✖ FAIL cover in 1 minute, 2.793 seconds
ERROR: invocation failed (exit code 1), logfile: /tmp/.tox/pylint/log/pylint-0.log
================================== log start ===================================
pylint create: /tmp/.tox/pylint
pylint installdeps: -r/home/jenkins/workspace/NBI-stage_2_master/requirements.txt, -r/home/jenkins/workspace/NBI-stage_2_master/requirements-dev.txt, -r/home/jenkins/workspace/NBI-stage_2_master/requirements-test.txt, pylint
pylint develop-inst: /home/jenkins/workspace/NBI-stage_2_master
pylint installed: aiohttp==3.8.5,aiokafka==0.8.1,aioresponses==0.7.4,aiosignal==1.3.1,annotated-types==0.5.0,astroid==3.1.0,async-timeout==4.0.3,asynctest==0.13.0,attrs==23.1.0,autocommand==2.2.2,cefevent==0.5.4,certifi==2023.7.22,charset-normalizer==3.2.0,cheroot==10.0.0,CherryPy==18.8.0,coverage==7.3.1,dataclasses==0.6,debtcollector==2.5.0,deepdiff==6.5.0,dill==0.3.8,dnspython==2.4.2,enum34==1.1.10,frozenlist==1.4.0,idna==3.4,inflect==7.0.0,iso8601==2.0.0,isort==5.13.2,jaraco.collections==4.3.0,jaraco.context==4.3.0,jaraco.functools==3.9.0,jaraco.text==3.11.1,jsonschema==4.19.1,jsonschema-specifications==2023.7.1,kafka-python==2.0.2,keystoneauth1==5.3.0,lxml==5.2.1,mccabe==0.7.0,more-itertools==10.1.0,motor==3.3.1,msgpack==1.0.7,multidict==6.0.4,netaddr==0.9.0,netifaces==0.11.0,nose2==0.13.0,ordered-set==4.1.0,os-service-types==1.7.0,oslo.config==9.2.0,oslo.i18n==6.1.0,oslo.serialization==5.2.0,oslo.utils==6.2.1,osm-common @ git+https://osm.etsi.org/gerrit/osm/common.git@a690b2ca4a6eeb821d3a3ba5c5e8dccf578018ff,osm-im @ git+https://osm.etsi.org/gerrit/osm/IM.git@90ffed24477703d8b77f8805c567cdaba0798ea6,-e git+https://osm.etsi.org/gerrit/osm/NBI.git@7623b8ce032f984ced08d20a57685fce58a59ceb#egg=osm_nbi,packaging==23.1,pbr==5.11.1,platformdirs==4.2.0,portend==3.2.0,pyang==2.5.3,pyangbind==0.8.3.post1,pycryptodome==3.19.0,pydantic==2.4.2,pydantic_core==2.10.1,pylint==3.1.0,pymongo==4.5.0,pyparsing==3.1.1,python-keystoneclient==5.2.0,pytz==2023.3.post1,PyYAML==6.0.1,referencing==0.30.2,regex==2023.12.25,requests==2.31.0,rfc3986==2.0.0,rpds-py==0.10.3,six==1.16.0,stevedore==5.1.0,tacacs-plus==2.6,tempora==5.5.0,tomli==2.0.1,tomlkit==0.12.4,typing_extensions==4.8.0,tzdata==2023.3,urllib3==2.0.5,wrapt==1.15.0,yarl==1.9.2,zc.lockfile==3.0.post1
pylint run-test-pre: PYTHONHASHSEED='3449765642'
pylint run-test: commands[0] | pylint -E osm_nbi
************* Module osm_nbi.engine
osm_nbi/engine.py:93:15: E0602: Undefined variable 'k8sTopic' (undefined-variable)
************* Module osm_nbi.nbi
osm_nbi/nbi.py:1902:32: E1120: No value for argument 'kwargs' in method call (no-value-for-parameter)
osm_nbi/nbi.py:1902:32: E1120: No value for argument 'headers' in method call (no-value-for-parameter)
ERROR: InvocationError for command /tmp/.tox/pylint/bin/pylint -E osm_nbi (exited with code 2)
=================================== log end ====================================
✖ FAIL pylint in 1 minute, 28.918 seconds
___________________________________ summary ____________________________________
ERROR: black: parallel child exit code 1
ERROR: cover: parallel child exit code 1
ERROR: flake8: parallel child exit code 1
ERROR: pylint: parallel child exit code 1
safety: commands succeeded