Skip to content

Commit ba032b2

Browse files
committed
Added disabled status check
1 parent e4cbb9f commit ba032b2

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

modules/testrail_scripts/set_coverage_none_for_untriaged_suitable_notsuitable.py renamed to modules/testrail_scripts/set_coverage_none_for_untriaged_suitable_unsuitable_disabled_automation.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,29 @@
1919
PROJECT_ID = 17
2020

2121
# Automation status values
22-
AUTOMATION_STATUS = {"UNTRIAGED": 1, "SUITABLE": 2, "NOT_SUITABLE": 3, "COMPLETED": 4}
22+
AUTOMATION_STATUS = {
23+
"UNTRIAGED": 1,
24+
"SUITABLE": 2,
25+
"UNSUITABLE": 3,
26+
"COMPLETED": 4,
27+
"DISABLED": 5,
28+
}
2329

2430
# Automation coverage values
2531
AUTOMATION_COVERAGE = {"NONE": 1, "PARTIAL": 2, "FULL": 3}
2632

2733
# Coverage value to name mapping for better logging
2834
COVERAGE_NAMES = {1: "None", 2: "Partial", 3: "Full"}
2935

36+
# Status value to name mapping for better logging
37+
STATUS_NAMES = {
38+
1: "Untriaged",
39+
2: "Suitable",
40+
3: "Unsuitable",
41+
4: "Completed",
42+
5: "Disabled",
43+
}
44+
3045

3146
def get_all_suites(tr, project_id):
3247
"""Get all suites from the project"""
@@ -92,11 +107,12 @@ def update_coverage_to_none(tr, project_id, dry_run=True, batch_size=25):
92107
status = case.get("custom_automation_status")
93108
coverage = case.get("custom_automation_coverage")
94109

95-
# Check if status is Untriaged, Suitable, or Not Suitable
110+
# Check if status is one that should have None coverage
96111
if status in [
97-
AUTOMATION_STATUS["UNTRIAGED"],
98-
AUTOMATION_STATUS["SUITABLE"],
99-
AUTOMATION_STATUS["NOT_SUITABLE"],
112+
AUTOMATION_STATUS["UNTRIAGED"], # Not decided yet
113+
AUTOMATION_STATUS["SUITABLE"], # Approved for automation
114+
AUTOMATION_STATUS["UNSUITABLE"], # Won't be automated
115+
AUTOMATION_STATUS["DISABLED"], # Not active
100116
]:
101117
# If coverage is not None, add to update targets
102118
if coverage != AUTOMATION_COVERAGE["NONE"]:
@@ -151,14 +167,18 @@ def update_coverage_to_none(tr, project_id, dry_run=True, batch_size=25):
151167
)
152168
for case in batch:
153169
case_id = case["id"]
170+
current_status = case.get("custom_automation_status")
154171
current_coverage = case.get(
155172
"custom_automation_coverage"
156173
)
174+
status_name = STATUS_NAMES.get(
175+
current_status, "Unknown"
176+
)
157177
coverage_name = COVERAGE_NAMES.get(
158178
current_coverage, "Empty"
159179
)
160180
logging.info(
161-
f" Case {case_id} - {coverage_name} → None"
181+
f" Case {case_id} - Status: {status_name}, Coverage: {coverage_name} → None"
162182
)
163183
changed_case_ids.append((case_id, suite_name))
164184

0 commit comments

Comments
 (0)