-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Ubuntu] Stage 1 and Stage 2 errors due to python 3.12 being introduced #3588
Comments
The first 3 items in the list have been resolved in the latest PR, just need to work out the avocado issue on another note, this isn't the first time we've had new python version issues below are list of issues and PRs that have been implemented due to people finding issues and then resolving retrospectively. I think we need a better way to find these issues so that we are more pro-active I will be proposing something after we get this one resolved, as this fix will depends now on our release of the package for 4.7.0 |
Me and @arif-ali investigated this, and @arif-ali has a bunch of code changes on PR #3587 which have the fixes for the regexp changes. The avocado-framework [pushed a fix for avocado-framework 92] to be compatible with Python3.12 but it is not pushed to Pypi yet, so we would need that in order to be able to run tests on Python3.12, I have raised a issue on the avocado-framework project to kindly ask them to push a new 92 LTS version to Pypi. |
Fix the issues reported by the tests on the new version of ubuntu Resolves: sosreport#3587 Closes: sosreport#3588 Signed-off-by: Arif Ali <[email protected]>
Fix the issues reported by the tests on the new version of ubuntu Resolves: sosreport#3587 Closes: sosreport#3588 Signed-off-by: Arif Ali <[email protected]>
Fix the issues reported by the tests on the new version of ubuntu Resolves: sosreport#3587 Closes: sosreport#3588 Co-authored-by: David Negreira <[email protected]> Signed-off-by: Arif Ali <[email protected]> Signed-off-by: David Negreira <[email protected]>
Fix the issues reported by the tests on the new version of ubuntu Resolves: sosreport#3587 Closes: sosreport#3588 Co-authored-by: David Negreira <[email protected]> Signed-off-by: Arif Ali <[email protected]> Signed-off-by: David Negreira <[email protected]>
Fix the issues reported by the tests on the new version of ubuntu Resolves: sosreport#3587 Closes: sosreport#3588 Related: SET-594,SET-595 Co-authored-by: David Negreira <[email protected]> Signed-off-by: Arif Ali <[email protected]> Signed-off-by: David Negreira <[email protected]>
I just mentioned this in #3587 but commenting here for tracking. There is now a new avocado LTS, version 103.0, which formally adds python 3.12 support. We should look at moving towards that and off of our current version of avocado. I can set some time aside this weekend to start looking into that, but if anyone else would like to start that venture before then please feel free to; no need to wait for me on this :). |
I did briefly look at it on how we can switch to This could have been the the key ;). I have Once both #3587 and #3591 are merged, it would be easier to get this into action, as these would all conflict each other. I'll see if the same works with the 103.0, and will propose something after the above 2 PRs land |
Yeah, I'm giving it a once-over now on my end. There's some minor fixes we'll need to do for regex matching (looks like the bulk of it can just convert to raw strings), but for the most part this should actually be pretty straight-forward (knock on wood). I'll keep plugging away at this, but we should be able to move to 103 without too much fuss. The option does change to |
So, based on my testing, on top of #3587 we should only need the following diff, and all should go to plan https://paste.ubuntu.com/p/PDxvFtdM4j/ diff --git a/.cirrus.yml b/.cirrus.yml
index 7bd019bd..891e42e8 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -134,7 +134,7 @@ deb_build_task:
apt -y install devscripts equivs python3-pip
mk-build-deps
apt -y install ./sosreport-build-deps*.deb
- pip3 install avocado-framework==94.0 --break-system-packages
+ pip3 install "avocado-framework<104.0" --break-system-packages
main_script: |
dpkg-buildpackage -b -us -uc -rfakeroot -m --build-by="[email protected]"
prep_artifacts_script: mv ../*.deb ./sos_cirrus.deb
@@ -226,13 +226,13 @@ report_stageone_task:
fi
PIP_EXTRA=""
[[ $(pip3 install --help | grep break-system) ]] && PIP_EXTRA="--break-system-packages"
- pip3 install avocado-framework==94.0 ${PIP_EXTRA}
+ pip3 install "avocado-framework<104.0" ${PIP_EXTRA}
# run the unittests separately as they require a different PYTHONPATH in
# order for the imports to work properly under avocado
unittest_script: &unit_test |
PYTHONPATH=. avocado run tests/unittests/
main_script: &stageone_test
- PYTHONPATH=tests/ avocado run -p TESTLOCAL=true --test-runner=runner -t stageone tests/{cleaner,collect,report,vendor}_tests
+ PYTHONPATH=tests/ avocado run -p TESTLOCAL=true --max-parallel-tasks=1 -t stageone tests/{cleaner,collect,report,vendor}_tests
on_failure:
fail_script: &faillogs |
ls -d /var/tmp/avocado* /root/avocado* 2> /dev/null | xargs tar cf sos-fail-logs.tar
@@ -252,11 +252,6 @@ report_stageone_daily_task:
environment:
PKG: "snap"
setup_script: *setup
- avocado_install_script: &avocado_setup |
- pip3 uninstall -y avocado-framework --break-system-packages
- git clone --single-branch -b 92lts https://github.com/avocado-framework/avocado.git
- cd avocado
- make install
unittest_script: *unit_test
main_script: *stageone_test
on_failure:
@@ -285,7 +280,7 @@ report_stagetwo_task:
dnf -y install python3-pexpect
fi
main_script: &stagetwo_test |
- PYTHONPATH=tests/ avocado run -p TESTLOCAL=true --test-runner=runner -t stagetwo tests/{cleaner,collect,report,vendor}_tests
+ PYTHONPATH=tests/ avocado run -p TESTLOCAL=true --max-parallel-tasks=1 -t stagetwo tests/{cleaner,collect,report,vendor}_tests
on_failure:
fail_script: *faillogs
log_artifacts: *logs
@@ -303,7 +298,6 @@ report_stagetwo_daily_task:
environment:
PKG: "snap"
setup_script: *setup
- avocado_install_script: *avocado_setup
main_script: *stagetwo_test
on_failure:
fail_script: *faillogs
diff --git a/tests/collect_tests/help_output_tests.py b/tests/collect_tests/help_output_tests.py
index 584ad498..f53c80a1 100644
--- a/tests/collect_tests/help_output_tests.py
+++ b/tests/collect_tests/help_output_tests.py
@@ -14,7 +14,7 @@ from avocado.utils import software_manager
from sos_tests import StageOneOutputTest, SOS_REPO_ROOT, skipIf
installer = software_manager
-sm = installer.SoftwareManager()
+sm = installer.manager.SoftwareManager()
PEXPECT_PRESENT = sm.check_installed('python3-pexpect')
diff --git a/tests/sos_tests.py b/tests/sos_tests.py
index 1fb31875..25d5f4e9 100644
--- a/tests/sos_tests.py
+++ b/tests/sos_tests.py
@@ -772,7 +772,7 @@ class StageTwoReportTest(BaseSoSReportTest):
# seems awkward, but check_installed() and remove() are not exposed
# together with install_distro_packages()
self.installer = software_manager
- self.sm = self.installer.SoftwareManager()
+ self.sm = self.installer.manager.SoftwareManager()
for dist in self.packages:
if isinstance(self.packages[dist], str):
@@ -842,7 +842,7 @@ class StageTwoReportTest(BaseSoSReportTest):
self._strip_installed_packages()
if not self.packages[self.local_distro]:
return
- installed = self.installer.install_distro_packages(self.packages)
+ installed = self.installer.distro_packages.install_distro_packages(self.packages)
if not installed:
raise Exception(
"Unable to install requested packages %s" |
Of course I say that, then jinx it. ;) I'm looking at the For the # instead of this
self.sm = avocado.utils.software_manager.SoftwareManager()
# do this now
self.sm = avocado.utils.software_manager.manager.SoftwareManager() However, the >>> pkgs = {'rhel': 'sos'}
>>> avocado.utils.software_manager.distro_packages.install_distro_packages(pkgs)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'avocado.utils.software_manager' has no attribute 'distro_packages'
>>> sm = avocado.utils.software_manager.manager.SoftwareManager()
>>> sm.install_distro_packages(pkgs)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jake/.local/lib/python3.12/site-packages/avocado/utils/software_manager/manager.py", line 47, in __getattr__
return self.backend.__getattribute__(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'DnfBackend' object has no attribute 'install_distro_packages' @clebergnu Sorry for the out-of-the-blue tag, but you're the main contact I remember from the avocado team. Is the above just a doc bug in that |
@TurboTurtle I just checked this page, which shows the the location of |
Yeah, that's where I linked to as well: >>> avocado.VERSION
'103.0'
>>> pkgs = {'rhel': ['sos']}
>>> avocado.utils.software_manager.distro_packages.install_distro_packages(pkgs)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'avocado.utils.software_manager' has no attribute 'distro_packages'
>>> |
yup, you're right, didn't catch it after my mods. latest run has the following, so the new distro_packages is not working
|
I'll open a PR shortly with the raw string changes as well as the, to date, found avocado changes. Once we figure out a workaround there, we can move forward on this rather quickly. At worst, we can loop over |
Found it :) Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import avocado
>>> pkgs = {'ubuntu': ['sos']}
>>> from avocado.utils.software_manager import distro_packages
>>> distro_packages.install_distro_packages(pkgs)
False
>>> avocado.version
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'avocado' has no attribute 'version'
>>> avocado.VERSION
'103.0'
>>> pkgs = {'ubuntu': ['sosreport']}
>>> distro_packages.install_distro_packages(pkgs)
True |
updated diff below, which should work diff --git a/.cirrus.yml b/.cirrus.yml
index 7bd019bd..891e42e8 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -134,7 +134,7 @@ deb_build_task:
apt -y install devscripts equivs python3-pip
mk-build-deps
apt -y install ./sosreport-build-deps*.deb
- pip3 install avocado-framework==94.0 --break-system-packages
+ pip3 install "avocado-framework<104.0" --break-system-packages
main_script: |
dpkg-buildpackage -b -us -uc -rfakeroot -m --build-by="[email protected]"
prep_artifacts_script: mv ../*.deb ./sos_cirrus.deb
@@ -226,13 +226,13 @@ report_stageone_task:
fi
PIP_EXTRA=""
[[ $(pip3 install --help | grep break-system) ]] && PIP_EXTRA="--break-system-packages"
- pip3 install avocado-framework==94.0 ${PIP_EXTRA}
+ pip3 install "avocado-framework<104.0" ${PIP_EXTRA}
# run the unittests separately as they require a different PYTHONPATH in
# order for the imports to work properly under avocado
unittest_script: &unit_test |
PYTHONPATH=. avocado run tests/unittests/
main_script: &stageone_test
- PYTHONPATH=tests/ avocado run -p TESTLOCAL=true --test-runner=runner -t stageone tests/{cleaner,collect,report,vendor}_tests
+ PYTHONPATH=tests/ avocado run -p TESTLOCAL=true --max-parallel-tasks=1 -t stageone tests/{cleaner,collect,report,vendor}_tests
on_failure:
fail_script: &faillogs |
ls -d /var/tmp/avocado* /root/avocado* 2> /dev/null | xargs tar cf sos-fail-logs.tar
@@ -252,11 +252,6 @@ report_stageone_daily_task:
environment:
PKG: "snap"
setup_script: *setup
- avocado_install_script: &avocado_setup |
- pip3 uninstall -y avocado-framework --break-system-packages
- git clone --single-branch -b 92lts https://github.com/avocado-framework/avocado.git
- cd avocado
- make install
unittest_script: *unit_test
main_script: *stageone_test
on_failure:
@@ -285,7 +280,7 @@ report_stagetwo_task:
dnf -y install python3-pexpect
fi
main_script: &stagetwo_test |
- PYTHONPATH=tests/ avocado run -p TESTLOCAL=true --test-runner=runner -t stagetwo tests/{cleaner,collect,report,vendor}_tests
+ PYTHONPATH=tests/ avocado run -p TESTLOCAL=true --max-parallel-tasks=1 -t stagetwo tests/{cleaner,collect,report,vendor}_tests
on_failure:
fail_script: *faillogs
log_artifacts: *logs
@@ -303,7 +298,6 @@ report_stagetwo_daily_task:
environment:
PKG: "snap"
setup_script: *setup
- avocado_install_script: *avocado_setup
main_script: *stagetwo_test
on_failure:
fail_script: *faillogs
diff --git a/tests/collect_tests/help_output_tests.py b/tests/collect_tests/help_output_tests.py
index 584ad498..f53c80a1 100644
--- a/tests/collect_tests/help_output_tests.py
+++ b/tests/collect_tests/help_output_tests.py
@@ -14,7 +14,7 @@ from avocado.utils import software_manager
from sos_tests import StageOneOutputTest, SOS_REPO_ROOT, skipIf
installer = software_manager
-sm = installer.SoftwareManager()
+sm = installer.manager.SoftwareManager()
PEXPECT_PRESENT = sm.check_installed('python3-pexpect')
diff --git a/tests/sos_tests.py b/tests/sos_tests.py
index 1fb31875..4cd6822f 100644
--- a/tests/sos_tests.py
+++ b/tests/sos_tests.py
@@ -12,6 +12,7 @@ from avocado.core.output import LOG_UI
from avocado import Test
from avocado.utils import archive, process, distro, software_manager
from avocado.utils.cpu import get_arch
+from avocado.utils.software_manager import distro_packages
from fnmatch import fnmatch
import glob
@@ -772,7 +773,7 @@ class StageTwoReportTest(BaseSoSReportTest):
# seems awkward, but check_installed() and remove() are not exposed
# together with install_distro_packages()
self.installer = software_manager
- self.sm = self.installer.SoftwareManager()
+ self.sm = self.installer.manager.SoftwareManager()
for dist in self.packages:
if isinstance(self.packages[dist], str):
@@ -842,7 +843,7 @@ class StageTwoReportTest(BaseSoSReportTest):
self._strip_installed_packages()
if not self.packages[self.local_distro]:
return
- installed = self.installer.install_distro_packages(self.packages)
+ installed = distro_packages.install_distro_packages(self.packages)
if not installed:
raise Exception(
"Unable to install requested packages %s"
|
Extra changes required due to module and function changes Closes: sosreport#3588 Resolves: sosreport#3594 Co-authored-by: Jake Hunsaker <[email protected]> Signed-off-by: Arif Ali <[email protected]>
Extra changes required due to module and function changes Closes: sosreport#3588 Resolves: sosreport#3594 Co-authored-by: Jake Hunsaker <[email protected]> Signed-off-by: Arif Ali <[email protected]>
Extra changes required due to module and function changes Closes: sosreport#3588 Resolves: sosreport#3594 Co-authored-by: Jake Hunsaker <[email protected]> Signed-off-by: Arif Ali <[email protected]>
Extra changes required due to module and function changes Closes: sosreport#3588 Resolves: sosreport#3594 Co-authored-by: Jake Hunsaker <[email protected]> Signed-off-by: Arif Ali <[email protected]>
Extra changes required due to module and function changes Closes: sosreport#3588 Resolves: sosreport#3594 Co-authored-by: Jake Hunsaker <[email protected]> Signed-off-by: Arif Ali <[email protected]>
Extra changes required due to module and function changes Closes: sosreport#3588 Resolves: sosreport#3594 Co-authored-by: Jake Hunsaker <[email protected]> Signed-off-by: Arif Ali <[email protected]>
* Extra changes required due to module and function changes in new avocado * CentOS Stream is now seen as centos-stream in avocado instead of centos * Fine tune tox for stage tests Closes: sosreport#3588 Resolves: sosreport#3594 Co-authored-by: Jake Hunsaker <[email protected]> Signed-off-by: Arif Ali <[email protected]>
Now Ubuntu Noble (24.04) ships with Python 3.12 and we are seeing a bunch of errors on Stage 1 and Stage 2 testing.
Stage 1 full logs
Stage 1 Errors:
and
Stage 2 full logs
Stage 2 Errors:
and
Me and @arif-ali are currently looking into this.
The text was updated successfully, but these errors were encountered: