Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 317028 Details for
Bug 457515
FEAT: INFO Test link should also be shown in the "Details" column of testplan
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch improvement.
testplan.patch (text/plain), 25.95 KB, created by
XINSUN
on 2008-09-18 03:08:01 UTC
(
hide
)
Description:
patch improvement.
Filename:
MIME Type:
Creator:
XINSUN
Created:
2008-09-18 03:08:01 UTC
Size:
25.95 KB
patch
obsolete
>Index: Bugzilla/Bug.pm >=================================================================== >RCS file: /cvs/qa/hwcert/Bugzilla/Bug.pm,v >retrieving revision 1.39 >diff -u -r1.39 Bug.pm >--- Bugzilla/Bug.pm 31 Jul 2008 20:10:36 -0000 1.39 >+++ Bugzilla/Bug.pm 18 Sep 2008 03:03:48 -0000 >@@ -300,203 +300,7 @@ > my $sth = $dbh->prepare($query); > $sth->execute(); > my $cid = $sth->fetchrow_array(); >- >- # Load testplan textarea and class >- if ( $cid ) { >- $query = "SELECT description,class from testplan WHERE cert_id=$cid"; >- my $sth = $dbh->prepare( $query ); >- $sth->execute; >- my @result = $sth->fetchrow_array(); >- my ( $desc, $class ) = @result; >- $self->{'testplanarea'} = $desc; >- $self->{'testplanstatus'} = $class; >- >- #Load testplan box's data >- $query = "SELECT id, name, description, location, bits32, bits64, >- required_32bits, required_64bits, leverage, result_32bits, result_64bits FROM testplan_desc >- WHERE cert_id = $cid ORDER BY id"; >- my $sth = $dbh->prepare($query); >- $sth->execute(); >- my @row = $sth->fetchrow_array(); >- if ( @row ) >- { >- my @testplanboxes; >- my $count = 1; >- while ( @row ) { >- my %testplanbox; >- my @result_list_32bits; >- my @result_list_64bits; >- $testplanbox{'id'} = shift @row; >- $testplanbox{'class'} = shift @row; >- $testplanbox{'description'} = shift @row; >- $testplanbox{'location'} = shift @row; >- $testplanbox{'bits32'} = shift @row; >- $testplanbox{'bits64'} = shift @row; >- $testplanbox{'required_32bits'} = shift @row; >- $testplanbox{'required_64bits'} = shift @row; >- $testplanbox{'leverage'} = shift @row; >- if ( $testplanbox{'leverage'} == 9999999 ) { >- $testplanbox{'leverage'} = "######"; } >- $testplanbox{'location'} = trim($testplanbox{'location'}); >- $testplanbox{'result_32bits'} = shift @row; >- $testplanbox{'result_64bits'} = shift @row; >- >- if ($testplanbox{'class'}) { >- >- #According to test class,sort the cert tests which match test class for each testplan item. >- my $test_type = %::test_class->{"$testplanbox{'class'}"}; >- >- my $sql_query= "SELECT id,rpm_id,iteration,status FROM cert_tests WHERE test_type LIKE '$test_type' and cert_id =$cid"; >- &::SendSQL2($sql_query); >- >- while (&::MoreSQLData2()) { >- my ($test_id,$test_rpm_id,$test_iteration,$test_status) = &::FetchSQLData2(); >- >- #Get the platform and info status : Pass or Fail >- my %test_result; >- $test_result{'test_id'} = $test_id; >- $test_result{'status'} = $test_status; >- $query="SELECT status,rep_platform FROM cert_tests WHERE test_type = 'INFO' and rpm_id = $test_rpm_id and iteration = $test_iteration and cert_id = $cid"; >- my $sth = $dbh->prepare($query); >- $sth->execute(); >- my ($info_status,$rep_platform) = $sth->fetchrow_array(); >- $test_result{'info_status'} = $info_status; >- if ($rep_platform =~ /64/) { >- $test_result{'bits'} = 64; >- }else{ >- $test_result{'bits'} = 32; >- } >- >- if ($test_result{'bits'} == 64 && $testplanbox{'required_64bits'} == 0) { >- #If not required 64bit test, then next and incase the cost of parsing hardware. >- next; >- } >- >- if ($test_result{'bits'} == 32 && $testplanbox{'required_32bits'} == 0) { >- #If not required 32bit test, then next and incase the cost of parsing hardware. >- next; >- } >- >- #Get hardware_id and hardware_desc for the cert test. >- $query="SELECT id, hardware FROM cert_hardware WHERE test_id= $test_id"; >- my $sth = $dbh->prepare($query); >- $sth->execute(); >- my ($hardware_id, $hardwareinfo) = $sth->fetchrow_array(); >- $test_result{'hardware_id'} = $hardware_id; >- >- my $hardwarehash=&::ConvertHardwareDetail($hardwareinfo); >- my $num = 1; >- if ($test_type eq "CORE") { >- $test_type = "CPU"; >- } elsif ( $test_type eq "STORAGE" ) { >- $test_type = "HD"; >- } >- >- foreach my $ref (@{$hardwarehash->{$test_type}}) { >- if ($test_type eq "CPU") { >- $test_result{'desc'} = $ref->{'model'}; >- $test_result{'fulldesc'} = $ref->{'model'}; >- } elsif ($test_type eq "MEMORY") { >- $test_result{'desc'} = "Amount: ".$ref->{'ram'}." MB"; >- $test_result{'fulldesc'} = "Amount: ".$ref->{'ram'}." MB"; >- } else { >- if ($ref->{'desc'}) { >- #fetch the all desc for the full text desc >- #was shown when the mouse over. >- $test_result{'fulldesc'} .= "#".$num." "; >- $test_result{'fulldesc'} .= $ref->{'desc'}; >- $num ++; >- >- if ( !defined $test_result{'desc'}) { >- #fetch the first item's desc for the short desc in the select option. because the option is too short. >- $test_result{'desc'} = $ref->{'desc'}; >- } >- } >- } >- } >- >- >- #Get result_info for the cert test >- $query="SELECT id FROM cert_runs WHERE test_id=$test_id"; >- my $sth = $dbh->prepare($query); >- $sth->execute(); >- my $result_id = $sth->fetchrow_array(); >- $test_result{'result_id'} = $result_id; >- >- #filter the test result into two list: @result_list_32bits & @result_list_64bits >- if ($test_result{'bits'} == 64) { >- $test_result{'show_used'} = "false"; >- $query="SELECT COUNT(id) FROM testplan_desc WHERE result_64bits = $test_id and cert_id = $cid"; >- my $sth = $dbh->prepare($query); >- $sth->execute(); >- my $used = $sth->fetchrow_array(); >- if ($used > 1) { >- $test_result{'show_used'} = "true"; >- } >- >- push (@result_list_64bits,\%test_result); >- >- } >- if ($test_result{'bits'} == 32) { >- $test_result{'show_used'} = "false"; >- $query="SELECT COUNT(id) FROM testplan_desc WHERE result_32bits = $test_id and cert_id = $cid"; >- my $sth = $dbh->prepare($query); >- $sth->execute(); >- my $used = $sth->fetchrow_array(); >- if ($used > 1) { >- $test_result{'show_used'} = "true"; >- } >- >- push (@result_list_32bits, \%test_result); >- } >- } >- } >- $testplanbox{'result_list_64bits'} = \@result_list_64bits; >- $testplanbox{'result_list_32bits'} = \@result_list_32bits; >- >- #For leverage mode, use the $testplanbox{'leverage_32bits_bugid'} to judge if this testplan item is leverage. >- if ($testplanbox{'result_32bits'}) { >- $query="SELECT cert_id FROM cert_tests WHERE id='$testplanbox{'result_32bits'}'"; >- my $sth = $dbh->prepare($query); >- $sth->execute(); >- my $cert_id = $sth->fetchrow_array(); >- if ($cert_id != $cid) { >- $testplanbox{'isleverage_32bits'}="true"; >- if ($cert_id) { >- $query="SELECT bug_id FROM cert_records WHERE id=$cert_id"; >- my $sth = $dbh->prepare($query); >- $sth->execute(); >- my $leverage_32bits_bugid= $sth->fetchrow_array(); >- $testplanbox{'leverage_32bits_bugid'} = $leverage_32bits_bugid; >- } >- } >- } >- >- #For leverage mode, use the $testplanbox{'leverage_32bits_bugid'} to judge if this testplan item is leverage. >- if ($testplanbox{'result_64bits'}) { >- $query="SELECT cert_id FROM cert_tests WHERE id='$testplanbox{'result_64bits'}'"; >- my $sth = $dbh->prepare($query); >- $sth->execute(); >- my $cert_id = $sth->fetchrow_array(); >- if ($cert_id != $cid) { >- $testplanbox{'isleverage_64bits'}="true"; >- if ($cert_id) { >- $query="SELECT bug_id FROM cert_records WHERE id=$cert_id"; >- my $sth = $dbh->prepare($query); >- $sth->execute(); >- my $leverage_64bits_bugid= $sth->fetchrow_array(); >- $testplanbox{'leverage_64bits_bugid'} = $leverage_64bits_bugid; >- } >- } >- } >- @row = $sth->fetchrow_array(); >- push (@testplanboxes, \%testplanbox); >- $count++; >- } >- $self->{'testplanboxes'} = \@testplanboxes; >- }#end of if ( @row ) >- } >- >+ > # Load rpms for certification > my $checked; > my @rpms; >@@ -613,7 +417,7 @@ > my $hardwaresummary; > foreach my $ref (@tests) { > my @hardware; >- $query = "SELECT id, " . >+ $query = "SELECT id, hardware, " . > "(CASE WHEN sysreport IS NULL THEN NULL ELSE 1 END) as sysreport " . > "FROM cert_hardware WHERE test_id = $ref->{id} ORDER BY id"; > $sth = $dbh->prepare($query); >@@ -621,6 +425,7 @@ > while (my @row = $sth->fetchrow_array()) { > my %hwdata; > $hwdata{'id'} = shift @row; >+ $hwdata{'hardware'} = shift @row; > if (@row) { > $hwdata{'sysreport'} = shift @row; > } >@@ -655,6 +460,204 @@ > > $self->{'tests'} = \@tests; > >+ # Load testplan textarea and class >+ if ( $cid ) { >+ $query = "SELECT description,class from testplan WHERE cert_id=$cid"; >+ my $sth = $dbh->prepare( $query ); >+ $sth->execute; >+ my @result = $sth->fetchrow_array(); >+ my ( $desc, $class ) = @result; >+ $self->{'testplanarea'} = $desc; >+ $self->{'testplanstatus'} = $class; >+ >+ #Load testplan box's data >+ $query = "SELECT id, name, description, location, bits32, bits64, >+ required_32bits, required_64bits, leverage, result_32bits, result_64bits FROM testplan_desc >+ WHERE cert_id = $cid ORDER BY id"; >+ my $sth = $dbh->prepare($query); >+ $sth->execute(); >+ my @row = $sth->fetchrow_array(); >+ if ( @row ) >+ { >+ my @testplanboxes; >+ my $count = 1; >+ while ( @row ) { >+ my %testplanbox; >+ my @result_list_32bits; >+ my @result_list_64bits; >+ $testplanbox{'id'} = shift @row; >+ $testplanbox{'class'} = shift @row; >+ $testplanbox{'description'} = shift @row; >+ $testplanbox{'location'} = shift @row; >+ $testplanbox{'bits32'} = shift @row; >+ $testplanbox{'bits64'} = shift @row; >+ $testplanbox{'required_32bits'} = shift @row; >+ $testplanbox{'required_64bits'} = shift @row; >+ $testplanbox{'leverage'} = shift @row; >+ if ( $testplanbox{'leverage'} == 9999999 ) { >+ $testplanbox{'leverage'} = "######"; } >+ $testplanbox{'location'} = trim($testplanbox{'location'}); >+ $testplanbox{'result_32bits'} = shift @row; >+ $testplanbox{'result_64bits'} = shift @row; >+ >+ if ($testplanbox{'class'}) { >+ >+ #According to test class,sort the cert tests which match test class for each testplan item. >+ my $test_type = %::test_class->{"$testplanbox{'class'}"}; >+ >+ my $sql_query= "SELECT id,rpm_id,iteration,status FROM cert_tests WHERE test_type LIKE '$test_type' and cert_id =$cid"; >+ &::SendSQL2($sql_query); >+ >+ while (&::MoreSQLData2()) { >+ my ($test_id,$test_rpm_id,$test_iteration,$test_status) = &::FetchSQLData2(); >+ >+ #Get the platform and info status : Pass or Fail >+ my %test_result; >+ $test_result{'test_id'} = $test_id; >+ $test_result{'status'} = $test_status; >+ >+ foreach my $test_ref (@tests) { >+ if ($test_ref->{'type'} eq "INFO" >+ && $test_ref->{'rpm_id'} eq $test_rpm_id >+ && $test_ref->{'iteration'} eq $test_iteration) { >+ if ($test_ref->{'rep_platform'} =~ /64/) { >+ $test_result{'bits'} = 64; >+ }else{ >+ $test_result{'bits'} = 32; >+ } >+ $test_result{'info_test_id'} = $test_ref->{'id'}; >+ $test_result{'info_status'} = $test_ref->{'status'}; >+ foreach my $hardware_ref (@{$test_ref->{'hardware'}}) { >+ $test_result{'info_hardware_id'} = $hardware_ref->{'id'}; >+ } >+ foreach my $run_ref (@{$test_ref->{'runs'}}) { >+ $test_result{'info_result_id'} = $run_ref->{'id'}; >+ } >+ } >+ } >+ >+ if ($test_result{'bits'} == 64 && $testplanbox{'required_64bits'} == 0) { >+ #If not required 64bit test, then next and incase the cost of parsing hardware. >+ next; >+ } >+ >+ if ($test_result{'bits'} == 32 && $testplanbox{'required_32bits'} == 0) { >+ #If not required 32bit test, then next and incase the cost of parsing hardware. >+ next; >+ } >+ >+ foreach my $test_ref (@tests) { >+ if ($test_ref->{'id'} eq $test_result{'test_id'}) { >+ foreach my $hardware_ref (@{$test_ref->{'hardware'}}) { >+ $test_result{'hardware_id'} = $hardware_ref->{'id'}; >+ my $hardwareinfo = $hardware_ref->{'hardware'}; >+ my $hardwarehash=&::ConvertHardwareDetail($hardwareinfo); >+ my $num = 1; >+ if ($test_type eq "CORE") { >+ $test_type = "CPU"; >+ } elsif ( $test_type eq "STORAGE" ) { >+ $test_type = "HD"; >+ } >+ >+ foreach my $hw_desc_ref (@{$hardwarehash->{$test_type}}) { >+ if ($test_type eq "CPU") { >+ $test_result{'desc'} = $hw_desc_ref->{'model'}; >+ $test_result{'fulldesc'} = $hw_desc_ref->{'model'}; >+ } elsif ($test_type eq "MEMORY") { >+ $test_result{'desc'} = "Amount: ".$hw_desc_ref->{'ram'}." MB"; >+ $test_result{'fulldesc'} = "Amount: ".$hw_desc_ref->{'ram'}." MB"; >+ } else { >+ if ($hw_desc_ref->{'desc'}) { >+ #fetch the all desc for the full text desc >+ #was shown when the mouse over. >+ $test_result{'fulldesc'} .= "#".$num." "; >+ $test_result{'fulldesc'} .= $hw_desc_ref->{'desc'}; >+ $num ++; >+ >+ if (!defined $test_result{'desc'}) { >+ #fetch the first item's desc for the short desc in the select option. because the option is too short. >+ $test_result{'desc'} = $hw_desc_ref->{'desc'}; >+ } >+ } >+ } >+ } >+ } >+ foreach my $run_ref (@{$test_ref->{'runs'}}) { >+ $test_result{'result_id'} = $run_ref->{'id'}; >+ } >+ } >+ } >+ >+ #filter the test result into two list: @result_list_32bits & @result_list_64bits >+ if ($test_result{'bits'} == 64) { >+ $test_result{'show_used'} = "false"; >+ $query="SELECT COUNT(id) FROM testplan_desc WHERE result_64bits = $test_id and cert_id = $cid"; >+ my $sth = $dbh->prepare($query); >+ $sth->execute(); >+ my $used = $sth->fetchrow_array(); >+ if ($used > 1) { >+ $test_result{'show_used'} = "true"; >+ } >+ >+ push (@result_list_64bits,\%test_result); >+ >+ } >+ if ($test_result{'bits'} == 32) { >+ $test_result{'show_used'} = "false"; >+ $query="SELECT COUNT(id) FROM testplan_desc WHERE result_32bits = $test_id and cert_id = $cid"; >+ my $sth = $dbh->prepare($query); >+ $sth->execute(); >+ my $used = $sth->fetchrow_array(); >+ if ($used > 1) { >+ $test_result{'show_used'} = "true"; >+ } >+ >+ push (@result_list_32bits, \%test_result); >+ } >+ } >+ } >+ $testplanbox{'result_list_64bits'} = \@result_list_64bits; >+ $testplanbox{'result_list_32bits'} = \@result_list_32bits; >+ >+ #For leverage mode, use the $testplanbox{'leverage_32bits_bugid'} to judge if this testplan item is leverage. >+ if ($testplanbox{'result_32bits'}) { >+ $testplanbox{'isleverage_32bits'}="true"; >+ foreach my $test_ref (@tests) { >+ if ($test_ref->{'id'} eq $testplanbox{'result_32bits'}) { >+ $testplanbox{'isleverage_32bits'}="false"; >+ } >+ } >+ if ($testplanbox{'isleverage_32bits'}) { >+ $query="SELECT cert_records.bug_id FROM cert_tests, cert_records WHERE cert_tests.cert_id = cert_records.id AND cert_tests.id='$testplanbox{'result_32bits'}'"; >+ my $sth = $dbh->prepare($query); >+ $sth->execute(); >+ $testplanbox{'leverage_32bits_bugid'} = $sth->fetchrow_array(); >+ } >+ } >+ >+ #For leverage mode, use the $testplanbox{'leverage_64bits_bugid'} to judge if this testplan item is leverage. >+ if ($testplanbox{'result_64bits'}) { >+ $testplanbox{'isleverage_64bits'}="true"; >+ foreach my $test_ref (@tests) { >+ if ($test_ref->{'id'} eq $testplanbox{'result_64bits'}) { >+ $testplanbox{'isleverage_64bits'}="false"; >+ } >+ } >+ if ($testplanbox{'isleverage_64bits'}) { >+ $query="SELECT cert_records.bug_id FROM cert_tests, cert_records WHERE cert_tests.cert_id = cert_records.id AND cert_tests.id='$testplanbox{'result_64bits'}'"; >+ my $sth = $dbh->prepare($query); >+ $sth->execute(); >+ $testplanbox{'leverage_64bits_bugid'} = $sth->fetchrow_array(); >+ } >+ } >+ @row = $sth->fetchrow_array(); >+ push (@testplanboxes, \%testplanbox); >+ $count++; >+ } >+ $self->{'testplanboxes'} = \@testplanboxes; >+ }#end of if ( @row ) >+ } >+ > # Get hwcert data from cert_records > my $cert_info = &::GetCertRecordInfo($self->{'bug_id'}); > $self->{'cert_type'} = $cert_info->{'type'}; >Index: template/en/default/bug/testplan_with_class.html.tmpl >=================================================================== >RCS file: /cvs/qa/hwcert/template/en/default/bug/testplan_with_class.html.tmpl,v >retrieving revision 1.4 >diff -u -r1.4 testplan_with_class.html.tmpl >--- template/en/default/bug/testplan_with_class.html.tmpl 3 Sep 2008 03:07:30 -0000 1.4 >+++ template/en/default/bug/testplan_with_class.html.tmpl 18 Sep 2008 03:03:48 -0000 >@@ -130,9 +130,9 @@ > var a=new Array( > [% FOREACH tr = f.result_list_32bits %] > [% IF loop.last %] >- [ "[% tr.test_id %]","[% tr.result_id %]","[% tr.hardware_id %]" ] >+ [ "[% tr.test_id %]","[% tr.result_id %]","[% tr.hardware_id %]","[% tr.info_result_id %]","[% tr.info_hardware_id %]" ] > [% ELSE %] >- [ "[% tr.test_id %]","[% tr.result_id %]","[% tr.hardware_id %]" ], >+ [ "[% tr.test_id %]","[% tr.result_id %]","[% tr.hardware_id %]","[% tr.info_result_id %]","[% tr.info_hardware_id %]" ], > [% END %] > [% END %] ); > var i, j; >@@ -157,11 +157,25 @@ > }else{ > hardwareHTML="  <a>Hardware</a>"; > } >+ >+ if(a[i][3]) >+ { >+ info_resultHTML="<a href=\"results.cgi?cert_id=[% bug.bug_id FILTER url_quote %]&id="+a[i][3]+"\">Results</a> "; >+ } else { >+ info_resultHTML="<a>Results</a> "; >+ } >+ >+ if(a[i][4]) >+ { >+ info_hardwareHTML="  <a href=\"hardware.cgi?cert_id=[% bug.bug_id FILTER url_quote %]&id="+a[i][4]+"\">Hardware</a>"; >+ }else{ >+ info_hardwareHTML="  <a>Hardware</a>"; >+ } > } > } > } > [% END %] >- document.getElementById("links_for_select_32bits_[% f.id %]").innerHTML=resultHTML+hardwareHTML; >+ document.getElementById("links_for_select_32bits_[% f.id %]").innerHTML=resultHTML+hardwareHTML+"<br>"+info_resultHTML+info_hardwareHTML+" (INFO)"; > document.getElementById("links_for_select_32bits_[% f.id %]").style.display="block"; > } > } >@@ -305,9 +319,9 @@ > var a=new Array( > [% FOREACH tr = f.result_list_64bits %] > [% IF loop.last %] >- [ "[% tr.test_id %]","[% tr.result_id %]","[% tr.hardware_id %]" ] >+ [ "[% tr.test_id %]","[% tr.result_id %]","[% tr.hardware_id %]","[% tr.info_result_id %]","[% tr.info_hardware_id %]" ] > [% ELSE %] >- [ "[% tr.test_id %]","[% tr.result_id %]","[% tr.hardware_id %]" ], >+ [ "[% tr.test_id %]","[% tr.result_id %]","[% tr.hardware_id %]","[% tr.info_result_id %]","[% tr.info_hardware_id %]" ], > [% END %] > [% END %] ); > var i, j; >@@ -330,12 +344,26 @@ > hardwareHTML="  <a href=\"hardware.cgi?cert_id=[% bug.bug_id FILTER url_quote %]&id="+a[i][2]+"\">Hardware</a>"; > }else{ > hardwareHTML="  <a>Hardware</a>"; >- } >+ } >+ >+ if(a[i][3]) >+ { >+ info_resultHTML="<a href=\"results.cgi?cert_id=[% bug.bug_id FILTER url_quote %]&id="+a[i][3]+"\">Results</a> "; >+ } else{ >+ info_resultHTML="<a>Results</a> "; >+ } >+ >+ if(a[i][4]) >+ { >+ info_hardwareHTML="  <a href=\"hardware.cgi?cert_id=[% bug.bug_id FILTER url_quote %]&id="+a[i][4]+"\">Hardware</a>"; >+ }else{ >+ info_hardwareHTML="  <a>Hardware</a>"; >+ } > } > } > } > [% END %] >- document.getElementById("links_for_select_64bits_[% f.id %]").innerHTML=resultHTML+hardwareHTML; >+ document.getElementById("links_for_select_64bits_[% f.id %]").innerHTML=resultHTML+hardwareHTML+"<br>"+info_resultHTML+info_hardwareHTML+" (INFO)"; > document.getElementById("links_for_select_64bits_[% f.id %]").style.display="block"; > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 457515
:
314173
|
317028