Skip to content

Commit 522e00a

Browse files
Hani YacoubHani Yacoub
authored andcommitted
edit code
1 parent 4ef4937 commit 522e00a

File tree

1 file changed

+11
-24
lines changed

1 file changed

+11
-24
lines changed

modules/testrail_set_smoke_tests_to_smoke_and_sanity.py

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@
1010
SUITE_NAMES = ["PDF Viewer"] # List of suite names to process
1111

1212
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-
}
2213
updated_count = 0
2314
DRY_RUN = True # If True, only log actions without making changes
2415

@@ -91,29 +82,25 @@ def get_all_cases_from_suite(tr, project_id, suite_id):
9182
# Iterate through all cases
9283
for case in all_cases:
9384
case_id = case["id"]
94-
sub_test_suites_value = case.get("sub_test_suites", [])
9585

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")
9788

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}")
10190

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}")
10593
continue
10694

10795
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+
)
10999

110100
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}")
114103
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]'.")
116105

117106
updated_count += 1
118-
119-
logging.info(f"Total cases {'updated' if not DRY_RUN else 'to be updated'}: {updated_count}")

0 commit comments

Comments
 (0)