Skip to content

Clear up duplicated test plan names that lead to confusion when displayed by checkbox-cli (BugFix)#1986

Merged
Hook25 merged 1 commit intomainfrom
fix-duplicated-test-plan-names
Jul 8, 2025
Merged

Clear up duplicated test plan names that lead to confusion when displayed by checkbox-cli (BugFix)#1986
Hook25 merged 1 commit intomainfrom
fix-duplicated-test-plan-names

Conversation

@bladernr
Copy link
Copy Markdown
Collaborator

@bladernr bladernr commented Jun 30, 2025

Description

After some discussion on MM led me to running checkbox-cli directly to test some thing, I noticed that a few test plans had duplicate names with no context, which become quite confusing when displayed via checkbox.

After working through this I found a lot more than initially seen so I made an effort to fix all of the duplicated test-plan name fields so that when listed in checkbox-cli, all test plan names are unique and any potential duplicates have some sort of context... for example there were many "after suspend" test plans that had the same name as their "before suspend" counterparts.

Resolved issues

fixes CHECKBOX-1966

Documentation

No doc changes needed, I believe, the name field is only really used in the list of test plans in the Checkbox UI and CLI (e.g. checkbox-cli list 'test plan' --format='json' --a | jq -r '.[] | "name: " +.name + " id:" + .id' | sort)

Tests

Doublechecked the changes by re-running the analyze_testplans.py script claude created while I was having it analyse the providers directory.

Example before and after:

bladernr@galactica:~/development/checkbox/tools$ python3 analyze_duplicates.py                                                                                          
=== DUPLICATE NAME ANALYSIS ===                                                                                                                                         
                                                                                                                                                                        
File: /home/bladernr/development/checkbox/providers/base/units/usb/test-plan.pxu                                                                                        
Duplicates found:                                                                                                                                                       
- Name: "USB tests (Automated)" (case insensitive)                                                                                                                      
  IDs: usb-cert-manual (line 11), usb-cert-automated (line 20)                                                                                                          
                                                                                                                                                                        
File: /home/bladernr/development/checkbox/providers/tpm2/units/test-plan.pxu                                                                                            
Duplicates found:                                                                                                                                                       
- Name: "TPM tests" (case insensitive)                                                                                                                                  
  IDs: tpm-cert-full (line 102), tpm-cert-manual (line 113), tpm-cert-automated (line 121)

bladernr@galactica:~/development/checkbox/tools$ python3 analyze_duplicates.py       
=== DUPLICATE NAME ANALYSIS ===

No duplicate names found in any test-plan.pxu files.

Also ran a quick find/grep and visually checked to doublecheck the script as well.

for x in `find ../providers/ -name test-plan.pxu`; do cat $x |grep "name: " |sort; done |less

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.60%. Comparing base (5ae1dd3) to head (d52d367).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1986   +/-   ##
=======================================
  Coverage   50.60%   50.60%           
=======================================
  Files         384      384           
  Lines       41180    41180           
  Branches     7636     7642    +6     
=======================================
  Hits        20841    20841           
+ Misses      19594    19592    -2     
- Partials      745      747    +2     
Flag Coverage Δ
provider-base 25.69% <ø> (ø)
provider-genio 96.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bladernr bladernr force-pushed the fix-duplicated-test-plan-names branch from fc4fe2c to 1ada613 Compare June 30, 2025 23:41
@bladernr
Copy link
Copy Markdown
Collaborator Author

bladernr commented Jul 1, 2025

The same version of black is giving me conflicting advice. Black 25.1.0 fails here saying:

 def analyze_file(filepath):
     """Analyze a single file for duplicates."""
     plans = parse_test_plan_file(filepath)
     duplicates = find_duplicates(plans)
 
-    results = {"file": filepath, "total_plans": len(plans), "duplicates": duplicates}
+    results = {
+        "file": filepath,
+        "total_plans": len(plans),
+        "duplicates": duplicates,
+    }
 
     return results

so Black 25.1.0 apparently doesn't like that single line dictionary.

But Black 25.1.0 locally always wants to reformat that to a single line. (I changed that offending dictionary to match what Black 25.1.0 is saying here, and then when I run Black 25.1.10 diff locally I get this:

 def analyze_file(filepath):
     """Analyze a single file for duplicates."""
     plans = parse_test_plan_file(filepath)
     duplicates = find_duplicates(plans)
 
-    results = {
-        "file": filepath, 
-        "total_plans": len(plans), 
-        "duplicates": duplicates
-    }
+    results = {"file": filepath, "total_plans": len(plans), "duplicates": duplicates}
 
     return results
 
 
 def main():
would reformat analyze_duplicates.py

So... which black 25.1.0 is correct? and why am I getting two conflicting bits of advice here? this is going to be messy if I have to run black to reformat code and then have to undo it because black doesn't like what black did.

@bladernr bladernr requested a review from a team as a code owner July 1, 2025 14:36
binli
binli previously approved these changes Jul 2, 2025
Copy link
Copy Markdown
Contributor

@binli binli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Copy Markdown
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the un-related changes and the untested script

@bladernr bladernr force-pushed the fix-duplicated-test-plan-names branch from d52d367 to 57ffccf Compare July 7, 2025 13:51
Copy link
Copy Markdown
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@Hook25 Hook25 merged commit 5285d8f into main Jul 8, 2025
49 checks passed
@Hook25 Hook25 deleted the fix-duplicated-test-plan-names branch July 8, 2025 06:55
mreed8855 pushed a commit that referenced this pull request Jul 30, 2025
…ayed by checkbox-cli (BugFix) (#1986)

Clear up duplicated test plan names that lead to confusion when displayed by checkbox-cli [fix]
mreed8855 pushed a commit that referenced this pull request Jul 31, 2025
…ayed by checkbox-cli (BugFix) (#1986)

Clear up duplicated test plan names that lead to confusion when displayed by checkbox-cli [fix]
bladernr added a commit that referenced this pull request Aug 28, 2025
…ayed by checkbox-cli (BugFix) (#1986)

Clear up duplicated test plan names that lead to confusion when displayed by checkbox-cli [fix]
stanley31huang pushed a commit that referenced this pull request Oct 3, 2025
…ayed by checkbox-cli (BugFix) (#1986)

Clear up duplicated test plan names that lead to confusion when displayed by checkbox-cli [fix]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants