monitor: Edge testing of urls
Adds edgetest and edgebot software types, where edgetest is a software type to request by user and requests by itself edgebot, which does the monitoring work. Based on Rafael Monnerat <rafael@nexedi.com>
-
Owner
It seems test is failing with
test (test.TestEdge) ... Traceback (most recent call last): File "/srv/slapgrid/slappart15/srv/testnode/cqc/inst/test0-0/tmp/soft/d2d3c2d572a2b34f70dd66f8b7ab75c9/parts/surykatka/bin/surykatka", line 5, in <module> import re File "/srv/slapgrid/slappart15/srv/testnode/cqc/inst/test0-0/tmp/soft/d2d3c2d572a2b34f70dd66f8b7ab75c9/parts/python3.7/lib/python3.7/re.py", line 143, in <module> class RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag'
this is an error that happens when the enum34 module ( see https://pypi.org/project/enum34 it's a backport of python 3.4 enum module ) is installed on python >= 3.6, because the enum module included in python3.6 is different. The fix is in theory to not install enum34 if using python > 3.4, but something strange seems to happen with monitor plugins.
I have not really investigated in details, but it's one of the problems we are addressing in slapos.core!146 (closed) . With jerome/slapos.core@a8bd3756 we could workaround because subprocess32 is another module name in python, but enum is enum.
-
Maintainer
It seems test is failing with
I overlooked this problem, it didn't happen in my local test runs (I am confirming now), and I merged despite the failures fixed in 6acdc8ca we had, they hidden the problem. I'll check it out.
Bizarre, that the SR correctly installs and instantiates on all machines.
-
Maintainer
For now I can confirm, that the problem appears only in case if test is run
python_for_test setup.py test
, so exactly like in the test runner. If I run it with my environment, I have no such problem, neither it happens on real environment.I suspect the incompatibility is in the test infrastructure, I'm working on this.
-
Maintainer
This error happens when
slapos-sr-testing
run withpython setup.py test
is callingslapos node instance
. So it seems that something bad is leaking to the supervisord started by testing system.I am investigating it.
-
Maintainer
I am investigating it.
It was problem in my code, fixed in 1f59ba1b
It seemed like originated in sueprvisor configuration, which resulted in small improvement slapos.core!170 (merged)
-
Owner
great ! Do we know what sets PYTHONPATH ?
-
Maintainer
great ! Do we know what sets PYTHONPATH ?
IMHO
python setup.py test
, but I didn't check internally what exactly there. -
Owner
Oh you are right:
$ cat setup.py import setuptools setuptools.setup(name='test_python_path', test_suite='tests') $ cat tests.py import unittest import os class T(unittest.TestCase): def test(self): self.assertFalse(os.environ.get('PYTHONPATH')) $ PYTHONPATH= python setup.py test running test running egg_info writing test_python_path.egg-info/PKG-INFO writing dependency_links to test_python_path.egg-info/dependency_links.txt writing top-level names to test_python_path.egg-info/top_level.txt reading manifest file 'test_python_path.egg-info/SOURCES.txt' writing manifest file 'test_python_path.egg-info/SOURCES.txt' running build_ext test (tests.T) ... FAIL ====================================================================== FAIL: test (tests.T) ---------------------------------------------------------------------- Traceback (most recent call last): File "/tmp/test_python_path/tests.py", line 8, in test self.assertFalse(os.environ.get('PYTHONPATH')) AssertionError: '/tmp/test_python_path' is not false ---------------------------------------------------------------------- Ran 1 test in 0.000s FAILED (failures=1) Test failed: <unittest.runner.TextTestResult run=1 errors=0 failures=1> error: Test failed: <unittest.runner.TextTestResult run=1 errors=0 failures=1> $ PYTHONPATH= pytest tests.py ======================================================== test session starts ======================================================== platform linux -- Python 3.6.6, pytest-5.3.2, py-1.8.0, pluggy-0.13.1 rootdir: /tmp/test_python_path plugins: metadata-1.8.0, html-2.0.1, cov-2.8.1, remove-stale-bytecode-4.0 collected 1 item tests.py . [100%] ========================================================= 1 passed in 0.02s ========================================================= $
this might be here
For the records,
python setup.py test
is deprecated since 41.5.0 see https://github.com/pypa/setuptools/issues/1684 . They recommand tox ( in https://setuptools.readthedocs.io/en/latest/setuptools.html#test-build-package-and-run-a-unittest-suite ), but I don't think we can use tox with slapos installed eggs. Well we can, but we can only install eggs on the python running slapos, so we cannot use tox feature of running tests on multiple pythons versions (because we can only install eggs on one python ) -
Owner
Also, slapos.core unset
$PYTHONPATH
when running buildout but if I read correctly, that does not happen whenslapos node instance
invokes promises. -
mentioned in merge request slapos.core!146 (closed)