cloning a case increments the case version of the source case (cloned case is version 1)

RESOLVED FIXED

Status

Testopia
Cloning
--
minor
RESOLVED FIXED
11 years ago
10 years ago

People

(Reporter: Nathan Parrish, Assigned: Greg Hendricks)

Tracking

Details

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.5) Gecko/20070718 Fedora/2.0.0.5-1.fc7 Firefox/2.0.0.5
Build Identifier: 1.3

since I need to specify case version in addition to ID when updating via XMLRPC (see also bug 397505), I need to maintain the case version in the execution environment of my automation framework.  so as I add testcases via the testopia web UI, I am also noting the case id and version in the automation script.  I thought I had this worked out pretty well, until I realized that the version of most of my testcases was one greater than what I'd specified in the scripts.  confusion reigns.  
then I looked at the method I was using to add testcases -- I just clone the last testcase I created and update the summary and action field, since those are the only things changing.  the initial case created by cloning is version 1, and after editing summary and action, it's version 2.  makes sense.  so why are most of my testcases version 3?  because apparently each time you clone a testcase, the source testcase version is incremented.  and given that I would clone the last created bug each time I wanted to make a new bug, I end up with most of my bugs at version 3.  

Reproducible: Always

Steps to Reproduce:
1.  create a case.  it will be at version 1.
2.  clone the case.  the new base will be version 1.
3.  go back to your original case, observe that it's at version 2 though nothing has changed.  
Actual Results:  
source of cloned case is rev'd

Expected Results:  
source of cloned case is not rev'd

running postgresql beneath my testopia installation, though I don't think that's relevant here.

Comment 1

11 years ago
In additional , the values "setup" , "breakdown" , "action" and "effect" are LOST when I create a clone from existing test case !!!

It looks like that all this happen somewhere in tr_show_case.cgi in following code fragment 
----------
....
if ($action eq 'Clone'){
    my $case = Bugzilla::Testopia::TestCase->new($case_id);
    ThrowUserError("testopia-create-denied", {'object' => 'Test Case'}) unless $case->canview;
    do_update($case);
    $vars->{'case'} = $case;
    $template->process("testopia/case/clone.html.tmpl", $vars) ||
        ThrowTemplateError($template->error());
}

------------------------------------
when you comment out the do_update you will see :
- no increasing of test case version
- texts will not disappears



(Assignee)

Comment 2

10 years ago
Fixed
Status: UNCONFIRMED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.