|
10 | 10 | SUITE_NAMES = ["PDF Viewer"] # List of suite names to process
|
11 | 11 |
|
12 | 12 | CUSTOM_SUB_TEST_SUITES = [2] # Value to set for the 'custom_sub_test_suites' field
|
13 |
| -TEST_SUB_SUITES = { |
14 |
| - 1: "functional", |
15 |
| - 2: "smoke", |
16 |
| - 3: "accessibility", |
17 |
| - 4: "l10n", |
18 |
| - 5: "security", |
19 |
| - 6: "fxa", |
20 |
| - 7: "other" |
21 |
| -} |
22 | 13 | updated_count = 0
|
23 | 14 | DRY_RUN = True # If True, only log actions without making changes
|
24 | 15 |
|
@@ -91,29 +82,25 @@ def get_all_cases_from_suite(tr, project_id, suite_id):
|
91 | 82 | # Iterate through all cases
|
92 | 83 | for case in all_cases:
|
93 | 84 | case_id = case["id"]
|
94 |
| - sub_test_suites_value = case.get("sub_test_suites", []) |
95 | 85 |
|
96 |
| - logging.info(f"Case ID {case_id} sub_test_suites: {sub_test_suites_value}") |
| 86 | + type_id = case.get("type_id") |
| 87 | + current_custom_value = case.get("custom_sub_test_suites", "Not Set") |
97 | 88 |
|
98 |
| - case_id = case["id"] |
99 |
| - sub_test_suites_value = case.get("sub_test_suites", []) # Fallback to empty list |
100 |
| - custom_value = case.get("custom_sub_test_suites", "Not Set") |
| 89 | + logging.info(f"Case ID {case_id} type_id: {type_id}") |
101 | 90 |
|
102 |
| - # Check if 2 is present in sub_test_suites |
103 |
| - if 2 not in sub_test_suites_value: |
104 |
| - logging.info(f"Skipping case {case_id} – sub_test_suites = {sub_test_suites_value}") |
| 91 | + if type_id != 6: |
| 92 | + logging.info(f"Skipping case {case_id} – type_id = {type_id}") |
105 | 93 | continue
|
106 | 94 |
|
107 | 95 | logging.info(
|
108 |
| - f"Case ID {case_id} matches (contains 2 in sub_test_suites). Current custom_sub_test_suites: {custom_value}") |
| 96 | + f"Case ID {case_id} matches (type_id == 6). " |
| 97 | + f"Current custom_sub_test_suites: {current_custom_value}" |
| 98 | + ) |
109 | 99 |
|
110 | 100 | if not DRY_RUN:
|
111 |
| - # Perform the update |
112 |
| - result = tr.update_case_field(case_id, "custom_sub_test_suites", CUSTOM_SUB_TEST_SUITES) |
113 |
| - logging.info(f"Updated case {case_id} to '{CUSTOM_SUB_TEST_SUITES}', Result: {result}") |
| 101 | + result = tr.update_case_field(case_id, "custom_sub_test_suites", [2]) |
| 102 | + logging.info(f"Updated case {case_id} to '[2]', Result: {result}") |
114 | 103 | else:
|
115 |
| - logging.info(f"[DRY RUN] Would update case {case_id} from '{custom_value}' to '{CUSTOM_SUB_TEST_SUITES}'.") |
| 104 | + logging.info(f"[DRY RUN] Would update case {case_id} from '{current_custom_value}' to '[2]'.") |
116 | 105 |
|
117 | 106 | updated_count += 1
|
118 |
| - |
119 |
| - logging.info(f"Total cases {'updated' if not DRY_RUN else 'to be updated'}: {updated_count}") |
0 commit comments