Subversion Repositories DevTools

Rev

Rev 6372 | Rev 6827 | 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," &_
        "  SUBSTR(pj.PROJ_NAME, 0, 60) as PROJ_NAME, " &_
        "  pj.PROJ_ID, " &_
        "  SUBSTR(rt.RTAG_NAME, 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', '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

%>
<!--#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">
      <tr class="form_field_hdr"> 
        <td nowrap">Project&nbsp;</td>
        <td nowrap">Release&nbsp;</td>
        <td nowrap">Time&nbsp;</td>
        <td nowrap">Reason&nbsp;</td>
        <td nowrap">Result&nbsp;</td>
      </tr>
      <%
       Call getBuildInstances                          
      %>
      <%If biQry.RecordCount < 1 Then%>
      <tr class="form_item_grey" > 
        <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 class="form_item_grey" > 
        <td nowrap><%=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>&nbsp;&nbsp;&nbsp;&nbsp;
                    <a href='javascript:;' onclick='toggleTest(<%=biQry("BUILD_ID")%>);'>
                        <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%>'>
                    </a>
                <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%>" id='testResults_<%=biQry("BUILD_ID")%>'>
              <%If utQry.RecordCount < 1 Then %>
              <tr class="form_item_grey" >
                <td nowrap>No Test Results found</td>
              </tr>
              <%Else%>
              <tr class="form_field_hdr"> 
                <td width="1%" nowrap">Platform&nbsp;</td>
                <td width="1%" nowrap">Type&nbsp;</td>
                <td width="95%" nowrap">Test Name&nbsp;</td>
                <td width="1%" nowrap">Duration&nbsp;</td>
                <td width="1%" nowrap">Outcome&nbsp;</td>
              </tr>
              <%End If%>
              <%While ((NOT utQry.BOF) AND (NOT utQry.EOF))%>
              <tr class="form_item_grey" > 
                <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>
            </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>