Make CI tests work on EPEL 9, configure gating

This commit is contained in:
Miro Hrončok 2024-01-09 20:37:02 +01:00
parent f1b86318fc
commit 7d73edb414
3 changed files with 20 additions and 84 deletions

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -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$'

View File

@ -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