Skip to content

Commit

Permalink
CI: convert EL 7 test to an EL 8 test, using Alma
Browse files Browse the repository at this point in the history
CentOS 7, EPEL 7, CentOS 8 and CentOS Stream 8 are all EOL, so
let's go to Alma 8 for the EL test.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
  • Loading branch information
AdamWill committed Aug 21, 2024
1 parent 8a6b983 commit cafbda5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
# we want to run this regardless of whether previous lint steps failed
if: success() || failure()
run: diff-quality --compare-branch=origin/$GITHUB_BASE_REF --violations=flake8 --fail-under=90
unittests-el7:
unittests-el8:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
Expand All @@ -38,4 +38,4 @@ jobs:
- name: Install make
run: sudo apt-get install make
- name: Run the tests
run: sudo make container-unittests-el7
run: sudo make container-unittests-el8
16 changes: 0 additions & 16 deletions Containerfile.tests.el7

This file was deleted.

18 changes: 18 additions & 0 deletions Containerfile.tests.el8
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# this container definition is intended *only* for running the oz test suite, it is not
# a general-purpose oz container definition!

FROM quay.io/almalinuxorg/8-base:latest
RUN set -exo pipefail \
&& dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
&& dnf install -y --setopt install_weak_deps=false --nodocs \
python3-requests python3-cryptography python3-setuptools python3-libvirt python3-lxml python3-libguestfs python3-pytest python3-coverage python3-monotonic \
libvirt-daemon libvirt-daemon-kvm libvirt-daemon-driver-qemu libvirt-daemon-config-network systemd \
&& dnf clean all \
&& rm -rf /var/cache/* /var/log/dnf*

COPY ./ /oz
# the XML generation tests are inherently unreliable before Python 3.8,
# as there was no consistent ordering of XML element attributes. See
# https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.tostring
RUN printf "#!/bin/sh\n/usr/sbin/libvirtd -d\ncd /oz\npython3 -m pytest -vv -k 'not test_xml_generation and not modify_libvirt_xml_for_serial' tests/" > /usr/local/bin/runtests.sh && chmod ugo+x /usr/local/bin/runtests.sh
CMD /usr/local/bin/runtests.sh
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ container-unittests-fedora:
docker run --name oz-tests-fedora oz-tests-fedora-image
docker cp oz-tests-fedora:/oz/coverage.xml .

container-unittests-el7:
docker rm -f oz-tests-el7
docker build -f Containerfile.tests.el7 -t oz-tests-el7-image .
docker run --name oz-tests-el7 oz-tests-el7-image
container-unittests-el8:
docker rm -f oz-tests-el8
docker build -f Containerfile.tests.el8 -t oz-tests-el8-image .
docker run --name oz-tests-el8 oz-tests-el8-image

container-unittests: container-unittests-fedora container-unittests-el7
container-unittests: container-unittests-fedora container-unittests-el8

test-coverage:
python-coverage run --source oz /usr/bin/py.test --verbose tests
Expand All @@ -72,10 +72,10 @@ flake8:

container-clean:
docker rm -f oz-tests-fedora
docker rm -f oz-tests-el7
docker image rm -f -i oz-tests-fedora-image oz-tests-el7-image
docker rm -f oz-tests-el8
docker image rm -f -i oz-tests-fedora-image oz-tests-el8-image

clean:
rm -rf MANIFEST build dist usr *~ oz.spec *.pyc oz/*~ oz/*.pyc examples/*~ oz/auto/*~ man/*~ docs/*~ man/*.html $(VENV_DIR) tests/tdl/*~ tests/factory/*~ tests/results.xml htmlcov

.PHONY: sdist oz.spec signed-tarball signed-rpm rpm srpm deb release man2html virtualenv unittests container-unittests-fedora container-unittests-el7 container-unittests tests test-coverage pylint clean container-clean
.PHONY: sdist oz.spec signed-tarball signed-rpm rpm srpm deb release man2html virtualenv unittests container-unittests-fedora container-unittests-el8 container-unittests tests test-coverage pylint clean container-clean

0 comments on commit cafbda5

Please sign in to comment.