Преглед на файлове

Add `BOT_TARGET_FILTER` to `_apply_bot_filter`

fix the bug that will calculate twice if ci_target is a list.
Fu Hanxi преди 5 години
родител
ревизия
38c288bc0e
променени са 2 файла, в които са добавени 7 реда и са изтрити 6 реда
  1. 5 6
      tools/ci/python_packages/tiny_test_fw/Utility/CIAssignTest.py
  2. 2 0
      tools/ci/python_packages/tiny_test_fw/Utility/SearchCases.py

+ 5 - 6
tools/ci/python_packages/tiny_test_fw/Utility/CIAssignTest.py

@@ -234,12 +234,11 @@ class AssignTest(object):
 
         :return: filter for search test cases
         """
-        bot_filter = os.getenv("BOT_CASE_FILTER")
-        if bot_filter:
-            bot_filter = json.loads(bot_filter)
-        else:
-            bot_filter = dict()
-        return bot_filter
+        res = dict()
+        for bot_filter in [os.getenv('BOT_CASE_FILTER'), os.getenv('BOT_TARGET_FILTER')]:
+            if bot_filter:
+                res.update(json.loads(bot_filter))
+        return res
 
     def _apply_bot_test_count(self):
         """

+ 2 - 0
tools/ci/python_packages/tiny_test_fw/Utility/SearchCases.py

@@ -79,6 +79,8 @@ class Search(object):
         """
         replicate_config = []
         for key in case.case_info:
+            if key == 'ci_target':  # ci_target is used to filter target, should not be duplicated.
+                continue
             if isinstance(case.case_info[key], (list, tuple)):
                 replicate_config.append(key)