From 7d73edb414399538cb558baf1b5ff90a61342a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 9 Jan 2024 20:37:02 +0100 Subject: [PATCH] Make CI tests work on EPEL 9, configure gating --- gating.yaml | 7 +++ tests/pip_install_upgrade/runtest.sh | 20 ++++---- tests/tests.yml | 77 ++-------------------------- 3 files changed, 20 insertions(+), 84 deletions(-) create mode 100644 gating.yaml diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..a77f895 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,7 @@ +--- !Policy + +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/tests/pip_install_upgrade/runtest.sh b/tests/pip_install_upgrade/runtest.sh index 40e14a3..bda730e 100755 --- a/tests/pip_install_upgrade/runtest.sh +++ b/tests/pip_install_upgrade/runtest.sh @@ -2,39 +2,39 @@ # This script requires root privileges and you should never run it on your own machine test $EUID -eq 0 -PYTHON_VERSION=$(/usr/bin/python3 -c 'import sys; print("{}.{}".format(*sys.version_info))') +PYTHON_VERSION=$(/usr/bin/python3.12 -c 'import sys; print("{}.{}".format(*sys.version_info))') RPM_SITELIB="/usr/lib/python${PYTHON_VERSION}/site-packages" LOCAL_SITELIB="/usr/local/lib/python${PYTHON_VERSION}/site-packages" USER_SITELIB="/home/fedora-test-user/.local/lib/python${PYTHON_VERSION}/site-packages" # First, let's install older Pello with pip as if it was installed by RPM # This is an approximation, but it usually works -RPM_BUILD_ROOT=/ /usr/bin/pip install 'Pello==1.0.1' +RPM_BUILD_ROOT=/ /usr/bin/pip-3.12 install 'Pello==1.0.1' # Now, we'll upgrade it with regular pip -/usr/bin/pip install --upgrade 'Pello==1.0.2' +/usr/bin/pip-3.12 install --upgrade 'Pello==1.0.2' # pip should see it -/usr/bin/pip freeze | grep '^Pello==1\.0\.2$' +/usr/bin/pip-3.12 freeze | grep '^Pello==1\.0\.2$' # Both installations should still exist test -d "${RPM_SITELIB}/Pello-1.0.1-py${PYTHON_VERSION}.egg-info" || test -d "${RPM_SITELIB}/Pello-1.0.1.dist-info" test -d "${LOCAL_SITELIB}/Pello-1.0.2.dist-info" # Let's ditch the local one -/usr/bin/pip uninstall --yes Pello +/usr/bin/pip-3.12 uninstall --yes Pello # It should only remove one of them test -d "${RPM_SITELIB}/Pello-1.0.1-py${PYTHON_VERSION}.egg-info" || test -d "${RPM_SITELIB}/Pello-1.0.1.dist-info" ! test -d "${LOCAL_SITELIB}/Pello-1.0.2.dist-info" # And pip should still see the RPM-installed one -/usr/bin/pip freeze | grep '^Pello==1\.0\.1$' +/usr/bin/pip-3.12 freeze | grep '^Pello==1\.0\.1$' # Again, but as regular user useradd fedora-test-user -su fedora-test-user -c '/usr/bin/pip install "Pello==1.0.2"' +su fedora-test-user -c '/usr/bin/pip-3.12 install "Pello==1.0.2"' test -d "${USER_SITELIB}/Pello-1.0.2.dist-info" -su fedora-test-user -c '/usr/bin/pip freeze' | grep '^Pello==1\.0\.2$' -su fedora-test-user -c '/usr/bin/pip uninstall --yes Pello' -su fedora-test-user -c '/usr/bin/pip freeze' | grep '^Pello==1\.0\.1$' +su fedora-test-user -c '/usr/bin/pip-3.12 freeze' | grep '^Pello==1\.0\.2$' +su fedora-test-user -c '/usr/bin/pip-3.12 uninstall --yes Pello' +su fedora-test-user -c '/usr/bin/pip-3.12 freeze' | grep '^Pello==1\.0\.1$' diff --git a/tests/tests.yml b/tests/tests.yml index 8c7064b..a886ed7 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -7,93 +7,22 @@ repositories: - repo: "https://src.fedoraproject.org/tests/python.git" dest: "python" - - repo: "https://src.fedoraproject.org/rpms/pyproject-rpm-macros.git" - dest: "pyproject-rpm-macros" tests: - - smoke35_optional: - dir: python/smoke - run: VERSION=3.5 INSTALL_OR_SKIP=true ./venv.sh - - smoke36: - dir: python/smoke - run: VERSION=3.6 ./venv.sh - - smoke37: - dir: python/smoke - run: VERSION=3.7 ./venv.sh - - smoke38: - dir: python/smoke - run: VERSION=3.8 ./venv.sh - - smoke39: - dir: python/smoke - run: VERSION=3.9 ./venv.sh - - smoke310: - dir: python/smoke - run: VERSION=3.10 ./venv.sh - - smoke311: - dir: python/smoke - run: VERSION=3.11 ./venv.sh - smoke312: dir: python/smoke run: VERSION=3.12 ./venv.sh - - smoke27: - dir: python/smoke - run: VERSION=2.7 METHOD=virtualenv ./venv.sh - - smoke35_virtualenv_optional: - dir: python/smoke - run: VERSION=3.5 METHOD=virtualenv INSTALL_OR_SKIP=true ./venv.sh - - smoke36_virtualenv: - dir: python/smoke - run: VERSION=3.6 METHOD=virtualenv ./venv.sh - - smoke37_virtualenv: - dir: python/smoke - run: VERSION=3.7 METHOD=virtualenv ./venv.sh - - smoke38_virtualenv: - dir: python/smoke - run: VERSION=3.8 METHOD=virtualenv ./venv.sh - - smoke39_virtualenv: - dir: python/smoke - run: VERSION=3.9 METHOD=virtualenv ./venv.sh - - smoke310_virtualenv: - dir: python/smoke - run: VERSION=3.10 METHOD=virtualenv ./venv.sh - - smoke311_virtualenv: - dir: python/smoke - run: VERSION=3.11 METHOD=virtualenv ./venv.sh - smoke312_virtualenv: dir: python/smoke run: VERSION=3.12 METHOD=virtualenv ./venv.sh - - pipenv: - run: pipenv install six - - pyproject_pytest: - dir: pyproject-rpm-macros/tests - run: ./mocktest.sh python-pytest - - pyproject_entrypoints: - dir: pyproject-rpm-macros/tests - run: ./mocktest.sh python-entrypoints - - pyproject_pluggy: - dir: pyproject-rpm-macros/tests - run: ./mocktest.sh python-pluggy - - pyproject_clikit: - dir: pyproject-rpm-macros/tests - run: ./mocktest.sh python-clikit - pip_install_upgrade required_packages: + - 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm' + - 'https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm' - gcc - virtualenv - - python2.7 - - python3.6 - - python3.7 - - python3.8 - - python3.9 - - python3.10-devel - - python3.11-devel - python3.12-devel - - python2-devel - - python3-devel + - python3.12-pip - python3-tox - - pipenv - - mock - - rpmdevtools - - rpm-build - grep - util-linux - shadow-utils