From 4f4dbfd5f738897849a62ce4b5955eb07fbbb6b0 Mon Sep 17 00:00:00 2001 From: Martin Styk Date: Tue, 29 Oct 2024 22:36:15 +0100 Subject: [PATCH] ci: enable unit tests in fedora targets Signed-off-by: Martin Styk --- .github/workflows/review-checks.yml | 1 + .packit.yaml | 4 ---- Client/src/bkr/client/tests/test_wizard.py | 8 +++++--- Common/bkr/common/test_schema.py | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/review-checks.yml b/.github/workflows/review-checks.yml index 84a82ed3c..c1d7508ed 100644 --- a/.github/workflows/review-checks.yml +++ b/.github/workflows/review-checks.yml @@ -155,6 +155,7 @@ jobs: - LabController os-target: - name: centos:7 + - name: fedora:41 - name: quay.io/centos/centos:stream9 additional_repos: "crb" additional_packages: "epel-release" diff --git a/.packit.yaml b/.packit.yaml index 346472804..8ff7409be 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -25,10 +25,6 @@ jobs: targets: - fedora-all-x86_64 identifier: fedora - actions: - post-upstream-clone: - # disable broken unit tests - - sed -i '/make check/d' beaker.spec - job: copr_build trigger: pull_request diff --git a/Client/src/bkr/client/tests/test_wizard.py b/Client/src/bkr/client/tests/test_wizard.py index ffdac2693..6b78bb374 100644 --- a/Client/src/bkr/client/tests/test_wizard.py +++ b/Client/src/bkr/client/tests/test_wizard.py @@ -5,6 +5,8 @@ import unittest from datetime import date + +import six from six.moves import StringIO from bkr.client import wizard @@ -163,6 +165,6 @@ def test_prints_full_heading(self, cpt_stdout): type.heading() cpt_stdout.seek(0) printout = cpt_stdout.read() - self.assertRegexpMatches(printout, r'\bWhat is the type of test?\b') - self.assertRegexpMatches(printout, r'\bRecommended values\b') - self.assertRegexpMatches(printout, r'\bPossible values\b') + six.assertRegex(printout, r'\bWhat is the type of test?\b') + six.assertRegex(printout, r'\bRecommended values\b') + six.assertRegex(printout, r'\bPossible values\b') diff --git a/Common/bkr/common/test_schema.py b/Common/bkr/common/test_schema.py index a364ff727..93ab6ed80 100644 --- a/Common/bkr/common/test_schema.py +++ b/Common/bkr/common/test_schema.py @@ -18,9 +18,9 @@ def assert_valid(self, xml): def assert_not_valid(self, xml, error_message): schema = lxml.etree.RelaxNG(self.schema_doc) - self.assert_(not schema.validate(lxml.etree.fromstring(xml))) + self.assertTrue(not schema.validate(lxml.etree.fromstring(xml))) messages = [str(e.message) for e in schema.error_log] - self.assert_(error_message in messages, messages) + self.assertTrue(error_message in messages, messages) class TaskSchemaTest(SchemaTestBase):