diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5399735..97f4f167 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 diff --git a/Containerfile.tests.el7 b/Containerfile.tests.el7 deleted file mode 100644 index fde1e5b2..00000000 --- a/Containerfile.tests.el7 +++ /dev/null @@ -1,16 +0,0 @@ -# this container definition is intended *only* for running the oz test suite, it is not -# a general-purpose oz container definition! - -FROM quay.io/centos/centos:7 -RUN set -exo pipefail \ - && yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \ - && yum install -y python-requests python-cryptography libvirt-python python-lxml python-libguestfs pytest python-monotonic libvirt \ - && yum clean all \ - && rm -rf /var/cache/* /var/log/yum* - -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\npython -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 diff --git a/Containerfile.tests.el8 b/Containerfile.tests.el8 new file mode 100644 index 00000000..3647d66c --- /dev/null +++ b/Containerfile.tests.el8 @@ -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 diff --git a/Makefile b/Makefile index 7f0fba74..d6d1b6e0 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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