Modify

Opened 2 years ago

Last modified 2 years ago

#14116 new defect

Wrong Status of test cases in testplan is displayed

Reported by: Michael.Breu@… Owned by: Roberto Longobardi
Priority: normal Component: TestManagerForTracPlugin
Severity: critical Keywords:
Cc: Trac Release: 1.2

Description

Hello,

This Testmanagementplugin is excelent, and we decided to use it for our customers.

Unfortunately just after convincing our customers to apply it, we found a severe bug:

The status of the individual tests contained in a test plan are displayed wrongly, if these tests have not been worked on (i.e. they have an empty history).

In this case, the status of the previous testcase is copied. This renders the work in a testplan nearly unusable.

My environment:

  • trac v.1.2.3
  • testmanager plugin 1.9.1

Since we needed a fast solution, we debugged the plugin and found the culprit:

In api.py method get_test_catalog_data_model (about line 1400) there is a loop

                            for ts, author, status in tcip.list_history():
                                break

If the history of the testcase is still empty, the variable status is not reset, the state of the previous testcase in the outer loop is used.

The solution is, to initialize the status here

                            status = ''
                            for ts, author, status in tcip.list_history():
                                break

Indeed it could be wise, also to initialize ts and author.

Best regards Michael

Attachments (2)

Fix_for_https___trac-hacks_org_ticket_14116.patch (814 bytes) - added by anonymous 2 years ago.
Patch
Fix_for_https___trac-hacks_org_ticket_141161.patch (776 bytes) - added by anonymous 2 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 2 years ago by figaro

Thank you, this is very helpful. Can you submit your patch as a unified diff? See TracDev/SubmittingPatches

Changed 2 years ago by anonymous

Patch

comment:2 Changed 2 years ago by anonymous

Hello,

This is my first patch I ever created. I attached it to this issue.

I hope this is helpful.

Michael

comment:3 Changed 2 years ago by anonymous

Sorry, the first patch was wrong. The correct one is attachment:Fix_for_https___trac-hacks_org_ticket_141161.patch

comment:4 Changed 2 years ago by Roberto Longobardi

Thanks a lot Michael. I just integrated your patch and release it into 1.10.1. https://github.com/seccanj/testman4trac/releases/tag/testman4trac-1.10.1

Unfortunately I don't have a 1.9.x branch, but if you need the patch to be on top of the 1.9.x release, because you're not on Trac 1.4 or higher yet, please let me know and I'll make it.

comment:5 Changed 2 years ago by Roberto Longobardi

I also released a 1.9.2 version with the patch on top of 1.9.1: https://github.com/seccanj/testman4trac/releases/tag/testman4trac-1.9.2

There is now a branch https://github.com/seccanj/testman4trac/tree/maintenance-old-trac to continue maintaining Trac versions previous to 1.4.

Thanks again Michael for the patch!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Roberto Longobardi.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.