|
19 | 19 | PROJECT_ID = 17
|
20 | 20 |
|
21 | 21 | # 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 | +} |
23 | 29 |
|
24 | 30 | # Automation coverage values
|
25 | 31 | AUTOMATION_COVERAGE = {"NONE": 1, "PARTIAL": 2, "FULL": 3}
|
26 | 32 |
|
27 | 33 | # Coverage value to name mapping for better logging
|
28 | 34 | COVERAGE_NAMES = {1: "None", 2: "Partial", 3: "Full"}
|
29 | 35 |
|
| 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 | + |
30 | 45 |
|
31 | 46 | def get_all_suites(tr, project_id):
|
32 | 47 | """Get all suites from the project"""
|
@@ -92,11 +107,12 @@ def update_coverage_to_none(tr, project_id, dry_run=True, batch_size=25):
|
92 | 107 | status = case.get("custom_automation_status")
|
93 | 108 | coverage = case.get("custom_automation_coverage")
|
94 | 109 |
|
95 |
| - # Check if status is Untriaged, Suitable, or Not Suitable |
| 110 | + # Check if status is one that should have None coverage |
96 | 111 | 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 |
100 | 116 | ]:
|
101 | 117 | # If coverage is not None, add to update targets
|
102 | 118 | if coverage != AUTOMATION_COVERAGE["NONE"]:
|
@@ -151,14 +167,18 @@ def update_coverage_to_none(tr, project_id, dry_run=True, batch_size=25):
|
151 | 167 | )
|
152 | 168 | for case in batch:
|
153 | 169 | case_id = case["id"]
|
| 170 | + current_status = case.get("custom_automation_status") |
154 | 171 | current_coverage = case.get(
|
155 | 172 | "custom_automation_coverage"
|
156 | 173 | )
|
| 174 | + status_name = STATUS_NAMES.get( |
| 175 | + current_status, "Unknown" |
| 176 | + ) |
157 | 177 | coverage_name = COVERAGE_NAMES.get(
|
158 | 178 | current_coverage, "Empty"
|
159 | 179 | )
|
160 | 180 | logging.info(
|
161 |
| - f" Case {case_id} - {coverage_name} → None" |
| 181 | + f" Case {case_id} - Status: {status_name}, Coverage: {coverage_name} → None" |
162 | 182 | )
|
163 | 183 | changed_case_ids.append((case_id, suite_name))
|
164 | 184 |
|
|
0 commit comments