canonical / charm-logrotated

logrotate is a subordinate charm that ensure that all logrotate.d configurations within /etc/logrotate.d/ folder are modified accordingly to a retention period defined in the charm
Other
0 stars 2 forks source link

functests failing with python-libjuju 3.1.0.1 release #29

Closed jneo8 closed 10 months ago

jneo8 commented 10 months ago

Following the release of python-libjuju 3.1.0.1, python-libjuju based functests started failing against juju controllers v2.x, due to juju and libjuju following starting to support the same major version[0].

Since we are still running automated tests using juju controller 2.x, we need to pin the libjuju major version to less than 3, since juju and libjuju have switched to using the same version numbers to indicate support[0]. As of today, pinning juju<3 would install python-libjuju version 2.9.38.1 which is intended to support juju controllers up to v2.9.38.

[0] https://github.com/juju/python-libjuju/releases

Here is an excerpt from the error taken from weekly CI runs:

func installed: attrs==22.2.0,bcrypt==4.0.1,cachetools==5.3.0,certifi==2022.12.7,cffi==1.15.1,charset-normalizer==3.0.1,cryptography==39.0.1,exceptiongroup==1.1.0,flake8==6.0.0,google-auth==2.16.1,hvac==1.0.2,idna==3.4,iniconfig==2.0.0,juju==3.1.0.1,kubernetes==26.1.0,macaroonbakery==1.3.1,mccabe==0.7.0,mock==5.0.1,mypy-extensions==1.0.0,oauthlib==3.2.2,packaging==23.0,paramiko==2.12.0,pluggy==1.0.0,protobuf==3.20.3,pyasn1==0.4.8,pyasn1-modules==0.2.8,pycodestyle==2.10.0,pycparser==2.21,pyflakes==3.0.1,pyhcl==0.4.4,pymacaroons==0.13.0,PyNaCl==1.5.0,pyRFC3339==1.1,pytest==7.2.1,pytest-asyncio==0.20.3,python-dateutil==2.8.2,pytz==2022.7.1,PyYAML==6.0,requests==2.28.2,requests-oauthlib==1.3.1,rsa==4.9,six==1.16.0,tomli==2.0.1,toposort==1.9,typing-inspect==0.8.0,typing_extensions==4.5.0,urllib3==1.26.14,websocket-client==1.5.1,websockets==10.4 func run-test-pre: PYTHONHASHSEED='3358879734' func run-test: commands[0] | pytest -v --ignore /tmp/functional-onkvxi01/src/tests/unit ============================= test session starts ============================== platform linux -- Python 3.10.6, pytest-7.2.1, pluggy-1.0.0 -- /tmp/functional-

... if not self._connection.info['server-version'].startswith(SUPPORTED_MAJOR_VERSION):

      raise JujuConnectionError("juju server-version %s not supported" % juju_server_version)

E juju.errors.JujuConnectionError: juju server-version 2.9.37 not supported

.tox/func/lib/python3.10/site-packages/juju/client/connector.py:82: JujuConnectionError ------------------------------ Captured log setup ------------------------------ WARNING connector:connector.py:80 This version was tested using 3.1.0 juju version 2.9.37 may have compatibility issues


Imported from Launchpad using lp2gh.

jneo8 commented 10 months ago

(by moisesbenzan) Also failing on charmed-kubernetes-testing while running the K8s validation suite.

==================================== ERRORS ==================================== ____ ERROR at setup of test_seriesupgrade ____ Traceback (most recent call last): File "/home/ubuntu/k8s-validation/.tox/py3/lib/python3.8/site-packages/pytest_asyncio/plugin.py", line 299, in _asyncgen_fixture_wrapper result = event_loop.run_until_complete(setup()) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/home/ubuntu/k8s-validation/.tox/py3/lib/python3.8/site-packages/pytest_asyncio/plugin.py", line 281, in setup res = await genobj.anext() File "/home/ubuntu/k8s-validation/jobs/integration/conftest.py", line 258, in model await model.connect(tools.connection) File "/home/ubuntu/k8s-validation/.tox/py3/lib/python3.8/site-packages/juju/model.py", line 658, in connect , model_uuid = await self._connector.connect_model(model_name, kwargs) File "/home/ubuntu/k8s-validation/.tox/py3/lib/python3.8/site-packages/juju/client/connector.py", line 174, in connect_model await self.connect(kwargs) File "/home/ubuntu/k8s-validation/.tox/py3/lib/python3.8/site-packages/juju/client/connector.py", line 82, in connect raise JujuConnectionError("juju server-version %s not supported" % juju_server_version) juju.errors.JujuConnectionError: juju server-version 2.9.42 not supported ------------------------------ Captured log setup ------------------------------ WARNING connector:connector.py:80 This version was tested using 3.1.0 juju version 2.9.42 may have compatibility issues =============================== warnings summary =============================== .tox/py3/lib/python3.8/site-packages/invoke/loader.py:3 /home/ubuntu/k8s-validation/.tox/py3/lib/python3.8/site-packages/invoke/loader.py:3: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp

jobs/integration/conftest.py:626 /home/ubuntu/k8s-validation/jobs/integration/conftest.py:626: PytestDeprecationWarning: The hookimpl pytest_metadata uses old-style configuration options (marks or attributes). Please use the pytest.hookimpl(optionalhook=True) decorator instead to configure the hooks. See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers pytest.mark.optionalhook

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ---------- generated xml file: /home/ubuntu/k8s-validation/report.xml ---------- ----- generated html file: file:///home/ubuntu/k8s-validation/report.html ------ ========================= 2 warnings, 1 error in 0.76s ========================= ERROR: InvocationError for command /home/ubuntu/k8s-validation/.tox/py3/bin/pytest -v -s --controller=foundations-maas --model=kubernetes-maas /home/ubuntu/k8s-validation/jobs/integration/validation.py::test_series_upgrade --is-series-upgrade --upgrade-snap-channel=latest/stable --upgrade-charm-channel=stable --series=jammy '--vault-unseal-command=fce_wrap build --layer kubernetes-maas --steps vault' (exited with code 1) ___ summary ____ ERROR: py3: commands failed

Test run: https://solutions.qa.canonical.com/v2/testruns/2e6802d6-8699-4816-a791-b83f361a3c24 Artifacts: https://oil-jenkins.canonical.com/artifacts/2e6802d6-8699-4816-a791-b83f361a3c24/index.html

jneo8 commented 10 months ago

(by cynerva) For the Charmed Kubernetes tests, we provide a requirements-2.9.txt1 file that comes with python-libjuju 3.0.4. That works against Juju 2.9 controllers in our testing. Can you use that requirements file when running our tests against Juju 2.9 controllers?

jneo8 commented 10 months ago

(by rgildein) This was fixed in PR#11 1.