Subversion Repositories DevTools

Rev

Rev 7162 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%
'------------ Variable Definition -------------
Dim biQry
Dim utQry
Dim rsQry
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
'----------------------------------------------
'   Get a set of Build Instances for the current package
'       Populates biQry
Sub getBuildInstances
   Dim query
   query = _
        "select bi.BUILD_ID, bi.PV_ID, bi.RTAG_ID,pv.pkg_id, bi.build_ref," &_
        "  SUBSTR(NVL(pj.PROJ_NAME,'-Deleted-'), 0, 60) as PROJ_NAME, " &_
        "  pj.PROJ_ID, " &_
        "  SUBSTR(NVL(rt.RTAG_NAME,'-Deleted-'), 0, 60) as RTAG_NAME, " &_
        "  TO_CHAR(bi.TIMESTAMP, 'Dy DD-Mon-YYYY HH24:MI:SS') as TIMESTAMP, " &_
        "  DECODE(bi.reason, 'N', 'New Version', 'R', 'Ripple', 'T', 'Test', 'P', 'Restored', 'F', 'ForcedRipple', 'Unknown') as REASON," &_
        "  DECODE(bi.state, 'B', 'Buiding', 'C', 'Complete', 'E', 'Error', 'S', 'SysErr', 'Unknown') as STATE"  &_
        " from BUILD_INSTANCES bi, " &_
        "     projects pj, " &_
        "     RELEASE_TAGS rt, " &_
        "     packages p, " &_
        "     PACKAGE_VERSIONS pv" &_
        " where bi.PV_ID = pv.pv_id " &_
        "  and pv.PKG_ID = p.PKG_ID" &_
        "  and bi.RTAG_ID = rt.RTAG_ID(+)" &_
        "  and rt.proj_id = pj.proj_id(+)" &_
        "  and bi.PV_ID = :PV_ID" &_
        " order by bi.BUILD_ID desc"

   Set biQry = nothing

   OraDatabase.Parameters.Add "PV_ID",   parPv_id,    ORAPARM_INPUT, ORATYPE_NUMBER
   Set biQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
   OraDatabase.Parameters.Remove "PV_ID"
End Sub

'   Get a set of test results for a specified build instance
'       Populates utQry
Sub getTestResults(nBuildId)
   Dim query
   query = _
        "select * from " &_
        " TEST_RUN tr" &_
        " where tr.BUILD_ID = :BUILD_ID" &_
        " order by PLATFORM desc,TYPE desc"

   Set utQry = nothing

   OraDatabase.Parameters.Add "BUILD_ID",   nBuildId,    ORAPARM_INPUT, ORATYPE_NUMBER
   Set utQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
   OraDatabase.Parameters.Remove "BUILD_ID"
End Sub
'----------------------------------------------
Sub BuildJsButtonHref (bState, sClass, sTitle, sImage, shref)%>
    <%If bState Then%>
                <span class="<%=sClass%>" title="<%=sTitle%>" href="<%=shref%>"><img <%=sImage%>></span>
    <%Else%>
                <span class="abtnItemDis" title="<%=sTitle%>"><img <%=sImage%> class="lessOpacity"></span>
    <%End If%>
<%End Sub

%>
<!--#include file="_jquery_includes.asp"-->
<script type="text/javascript" charset="utf-8">
function toggleTest(id)
{
    $(  "#testResults_" + id ).toggleClass('display-table display-none');
    $( "#testResultsH_" + id ).toggleClass('display-table display-none');
    $( "#testImageMin_" + id ).toggleClass('display-inline display-none');
    $( "#testImageMax_" + id ).toggleClass('display-inline display-none');
}

</script>

     <table class="full_table stdGrey">
         <thead>
          <tr>
            <th nowrap">Project&nbsp;</th>
            <th nowrap">Release&nbsp;</th>
            <th nowrap">Time&nbsp;</th>
            <th nowrap">Reason&nbsp;</th>
            <th nowrap">Result&nbsp;</th>
          </tr>
         </thead>
      <%
       Call getBuildInstances                          
      %>
      <%If biQry.RecordCount < 1 Then%>
      <tr> 
        <td nowrap>&nbsp;</td>
        <td nowrap>&nbsp;</td>
        <td nowrap>&nbsp;</td>
        <td nowrap>&nbsp;</td>
        <td nowrap>&nbsp;</td>
      </tr>
      <%End If%>
      <%
        Dim displayClass   : displayClass   = "display-table"
        Dim displayClassI  : displayClassI  = "display-inline"
        Dim displayClass1  : displayClass1  = "display-none"
        Dim displayClassI1 : displayClassI1 = "display-none"
        While ((NOT biQry.BOF) AND (NOT biQry.EOF))
      %>
      <tr> 
        <td nowrap>
                        <%BuildJsButtonHref biQry("build_ref") <> "", "vixIframeDialog", "Associated Log Files", "src='images/log_file-512.png' height=13px", "_iframe_build_logs.asp?rtag_id="&biQry("RTAG_ID")&"&build_ref="&biQry("build_ref")%>
                        <%=biQry("proj_name")%>
            </td>
        <td nowrap><%=biQry("rtag_name")%></td>
        <td nowrap><%=biQry("timestamp")%></td>
        <td nowrap><%=biQry("reason")%></td>
        <td nowrap><%=biQry("state")%></td>
      </tr>
      <tr>
        <!-- Display the Unit Test Results <%=biQry("BUILD_ID")%>-->
        <td colspan="4" >
            <%Call getTestResults(biQry("BUILD_ID"))%>
            <table class="full_table">
                <tr>
                    <td valign="top" width="1%" class="form_field_hdrgap" nowrap onclick='toggleTest(<%=biQry("BUILD_ID")%>);'>&nbsp;&nbsp;&nbsp;&nbsp;
                            <img title='Hide Test Results'  id='testImageMin_<%=biQry("BUILD_ID")%>' src="images/btn_min.gif" class='<%=displayClassI%>'>
                            <img title='Show Test Results'  id='testImageMax_<%=biQry("BUILD_ID")%>' src="images/btn_max.gif" class='<%=displayClassI1%>'>
                    </td>
                    <td>
                        <table class="full_table <%=displayClass1%>" id='testResultsH_<%=biQry("BUILD_ID")%>'>
                            <tr class="form_item_grey" >
                            <%If utQry.RecordCount < 1 Then %>
                              <td nowrap>No Test Results found</td>
                            <%Else%>
                              <td nowrap >Tests : <%=utQry.RecordCount%></td>
                            <%End If%>
                            </tr>
                        </table>
                        <table class="full_table <%=displayClass%> stdGrey" id='testResults_<%=biQry("BUILD_ID")%>'>
                          <%If utQry.RecordCount < 1 Then %>
                          <tr>
                            <td nowrap>No Test Results found</td>
                          </tr>
                          <%Else%>
                            <thead>
                              <tr> 
                                <th width="1%" nowrap">Platform&nbsp;</th>
                                <th width="1%" nowrap">Type&nbsp;</th>
                                <th width="95%" nowrap">Test Name&nbsp;</th>
                                <th width="1%" nowrap">Duration&nbsp;</th>
                                <th width="1%" nowrap">Outcome&nbsp;</th>
                              </tr>
                            </thead>
                          <%End If%>
                          <%While ((NOT utQry.BOF) AND (NOT utQry.EOF))%>
                          <tr > 
                            <td nowrap><%=utQry("platform")%></td>
                            <td nowrap><%=utQry("type")%></td>
                            <td nowrap><%=utQry("test_name")%></td>
                            <td nowrap><%=utQry("time_taken")%></td>
                            <td nowrap><%=utQry("test_outcome")%></td>
                          </tr>
                          <%
                          <!-- Set to hide all but the first element -->
                          utQry.MoveNext
                          WEnd
                          utQry.Close
                          Set utQry = nothing
                          %>
                        </table>
                    </td>
                </tr>
            </table>
        </td>
        <!-- End Display the Unit Test Results -->
      </tr>
      <%
      displayClass = "display-none"
      displayClass1 = "display-table"
      displayClassI = "display-none"
      displayClassI1 = "display-inline"
      biQry.MoveNext
      WEnd
      biQry.Close
      Set biQry = nothing
      %>
    </table>