diff mbox series

[yocto-autobuilder-helper,2/3] scripts: test_send_qa_email: fix broken tests

Message ID 20240621155723.33600-3-alexis.lothore@bootlin.com
State New
Headers show
Series scripts: send_qa_email: skip regression report when missing base or target | expand

Commit Message

Alexis Lothoré June 21, 2024, 3:57 p.m. UTC
From: Alexis Lothoré <alexis.lothore@bootlin.com>

Commit 1dc77f590875 ("scripts: send_qa_email: add dry-run mode") updated
the get_regression_base_and_target to allow it to receive a test result
url. Unfortunately, this function's tests have not been updated
accordingly, so they currently fail because of the missing parameter.

Add a default url in test case and update the function call with this
default value.

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 scripts/test_send_qa_email.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/scripts/test_send_qa_email.py b/scripts/test_send_qa_email.py
index 64ae80a1852d..8b19975c31d5 100755
--- a/scripts/test_send_qa_email.py
+++ b/scripts/test_send_qa_email.py
@@ -42,6 +42,8 @@  class TestVersion(unittest.TestCase):
         {"input": None, "expected":False}
     ]
 
+    test_results_url = "git://git.yoctoproject.org/yocto-testresults"
+
     # This data represent real data returned by utils.getcomparisonbranch
     # and the release argument passed to send-qa-email script
     regression_inputs = [
@@ -76,7 +78,12 @@  class TestVersion(unittest.TestCase):
         for data in self.regression_inputs:
             with self.subTest(data['name']):
                 base, target = send_qa_email.get_regression_base_and_target(
-                    data['input']['targetbranch'], data['input']['basebranch'], data['input']['release'], os.environ.get("POKY_PATH"), log)
+                    data['input']['targetbranch'],
+                    data['input']['basebranch'],
+                    data['input']['release'],
+                    os.environ.get("POKY_PATH"),
+                    self.test_results_url,
+                    log)
                 expected_base, expected_target = data["expected"]
                 # The comparison base can not be set statically in tests when it is supposed to be the previous tag,
                 # since the result will depend on current tags