From: Alexis Lothoré <alexis.loth...@bootlin.com> send_qa_email currently deals with tags in a "reproducible" way: despite new versions being released on different branches, the computation of the "reference" version for a specific input version always remain the same.
This behavior does not match perfectly real expectations: if at the some point we get version 4.3.1 as a comparison reference for a regression report, and 4.3.2 is released some time later, we want the next comparision to be done against 4.3.2. Start introducing this new behavior by allowing the tests to check returned version against regex patterns instead of static strings, so we can for example use wildcards on the "micro" version Signed-off-by: Alexis Lothoré <alexis.loth...@bootlin.com> --- scripts/test_send_qa_email.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/test_send_qa_email.py b/scripts/test_send_qa_email.py index 8ab91538748a..2dd946f32bf1 100755 --- a/scripts/test_send_qa_email.py +++ b/scripts/test_send_qa_email.py @@ -12,6 +12,7 @@ import sys import unittest import send_qa_email import logging +import re logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s") log = logging.getLogger('send-qa-email') @@ -60,7 +61,8 @@ class TestVersion(unittest.TestCase): input_version = data["input"]["version"] expected = data["expected"] with self.subTest(f"Test {input_version} previous tag (expecting {expected})"): - self.assertEqual(send_qa_email.get_previous_tag(os.environ.get("POKY_PATH"), input_version), expected) + result = send_qa_email.get_previous_tag(os.environ.get("POKY_PATH"), input_version) + self.assertIsNotNone(re.match(data["expected"], result), msg=f"get_previous_tag returned {result}") def test_is_release_version(self): for data in self.test_data_is_release_version: -- 2.42.1
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#61947): https://lists.yoctoproject.org/g/yocto/message/61947 Mute This Topic: https://lists.yoctoproject.org/mt/103224522/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-