Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5018 dpurdie 1
<%
2
'------------ Variable Definition -------------
3
Dim biQry
4
Dim utQry
5
Dim rsQry
6
'------------ Constants Declaration -----------
7
'------------ Variable Init -------------------
8
'----------------------------------------------
9
'   Get a set of Build Instances for the current package
10
'       Populates biQry
11
Sub getBuildInstances
12
   Dim query
13
   query = _
14
        "select bi.BUILD_ID, bi.PV_ID, bi.RTAG_ID,pv.pkg_id," &_
15
        "  SUBSTR(pj.PROJ_NAME, 0, 60) as PROJ_NAME, " &_
16
        "  pj.PROJ_ID, " &_
17
        "  SUBSTR(rt.RTAG_NAME, 0, 60) as RTAG_NAME, " &_
18
        "  TO_CHAR(bi.TIMESTAMP, 'Dy DD-Mon-YYYY HH24:MI:SS') as TIMESTAMP, " &_
19
        "  DECODE(bi.reason, 'N', 'New Version', 'R', 'Ripple', 'T', 'Test', 'P', 'Restored', 'Unknown') as REASON," &_
20
        "  DECODE(bi.state, 'B', 'Buiding', 'C', 'Complete', 'E', 'Error', 'S', 'SysErr', 'Unknown') as STATE"  &_
21
        " from BUILD_INSTANCES bi, " &_
22
        "     projects pj, " &_
23
        "     RELEASE_TAGS rt, " &_
24
        "     packages p, " &_
25
        "     PACKAGE_VERSIONS pv" &_
26
        " where bi.PV_ID = pv.pv_id " &_
27
        "  and pv.PKG_ID = p.PKG_ID" &_
28
        "  and bi.RTAG_ID = rt.RTAG_ID" &_
29
        "  and rt.proj_id = pj.proj_id" &_
30
        "  and bi.PV_ID = :PV_ID" &_
31
        " order by bi.BUILD_ID desc"
32
 
33
   Set biQry = nothing
34
 
35
   OraDatabase.Parameters.Add "PV_ID",   parPv_id,    ORAPARM_INPUT, ORATYPE_NUMBER
36
   Set biQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
37
   OraDatabase.Parameters.Remove "PV_ID"
38
End Sub
39
 
40
'   Get a set of test results for a specified build instance
41
'       Populates utQry
42
Sub getTestResults(nBuildId)
43
   Dim query
44
   query = _
45
        "select * from " &_
46
        " TEST_RUN tr" &_
47
        " where tr.BUILD_ID = :BUILD_ID" &_
48
        " order by PLATFORM desc,TYPE desc"
49
 
50
   Set utQry = nothing
51
 
52
   OraDatabase.Parameters.Add "BUILD_ID",   nBuildId,    ORAPARM_INPUT, ORATYPE_NUMBER
53
   Set utQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
54
   OraDatabase.Parameters.Remove "BUILD_ID"
55
End Sub
56
 
57
%>
5085 dpurdie 58
<!--#include file="_jquery_includes.asp"-->
5018 dpurdie 59
<script type="text/javascript" charset="utf-8">
60
function toggleTest(id)
61
{
62
    $( "#testResults_" + id ).toggle();
63
    $( "#testResultsH_" + id ).toggle();
64
    $( "#testImageMin_" + id ).toggle();
65
    $( "#testImageMax_" + id ).toggle();
66
}
67
 
68
</script>
69
 
70
     <table class="full_table">
71
      <tr class="form_field_hdr"> 
72
        <td nowrap">Project&nbsp;</td>
73
        <td nowrap">Release&nbsp;</td>
74
        <td nowrap">Time&nbsp;</td>
75
        <td nowrap">Reason&nbsp;</td>
76
        <td nowrap">Result&nbsp;</td>
77
      </tr>
78
      <%
79
       Call getBuildInstances                          
80
      %>
81
      <%If biQry.RecordCount < 1 Then%>
82
      <tr class="form_item_grey" > 
83
        <td nowrap>&nbsp;</td>
84
        <td nowrap>&nbsp;</td>
85
        <td nowrap>&nbsp;</td>
86
        <td nowrap>&nbsp;</td>
87
        <td nowrap>&nbsp;</td>
88
      </tr>
89
      <%End If%>
90
      <%
91
        Dim displayStyle  : displayStyle = "style='display:inline'"
92
        Dim displayStyle1 : displayStyle1 = "style='display:none'"
93
        While ((NOT biQry.BOF) AND (NOT biQry.EOF))
94
      %>
95
      <tr class="form_item_grey" > 
96
        <td nowrap><%=biQry("proj_name")%></td>
97
        <td nowrap><%=biQry("rtag_name")%></td>
98
        <td nowrap><%=biQry("timestamp")%></td>
99
        <td nowrap><%=biQry("reason")%></td>
100
        <td nowrap><%=biQry("state")%></td>
101
      </tr>
102
      <tr>
103
        <!-- Display the Unit Test Results -->
104
        <td colspan="4" >
105
            <%Call getTestResults(biQry("BUILD_ID"))%>
106
            <table class="full_table">
107
                <tr>
108
                <td valign="top" width="1%" class="form_field_hdrgap" nowrap>&nbsp;&nbsp;&nbsp;&nbsp;
109
                    <a href='javascript:;' onclick='toggleTest(<%=biQry("BUILD_ID")%>);'>
110
                        <img title='Hide Test Results'  id='testImageMin_<%=biQry("BUILD_ID")%>' src="images/btn_min.gif" <%=displayStyle%>>
111
                        <img title='Show Test Results'  id='testImageMax_<%=biQry("BUILD_ID")%>' src="images/btn_max.gif" <%=displayStyle1%> >
112
                    </a>
113
                <td>
114
            <table class="full_table" id='testResultsH_<%=biQry("BUILD_ID")%>' <%=displayStyle1%>>
115
                <tr class="form_item_grey" >
116
                <%If utQry.RecordCount < 1 Then %>
117
                  <td nowrap>No Test Results found</td>
118
                <%Else%>
119
                  <td nowrap >Tests : <%=utQry.RecordCount%></td>
120
                <%End If%>
121
                </tr>
122
            </table>
123
            <table class="full_table" id='testResults_<%=biQry("BUILD_ID")%>' <%=displayStyle%>>
124
              <%If utQry.RecordCount < 1 Then %>
125
              <tr class="form_item_grey" >
126
                <td nowrap>No Test Results found</td>
127
              </tr>
128
              <%Else%>
129
              <tr class="form_field_hdr"> 
130
                <td width="1%" nowrap">Platform&nbsp;</td>
131
                <td width="1%" nowrap">Type&nbsp;</td>
132
                <td width="95%" nowrap">Test Name&nbsp;</td>
133
                <td width="1%" nowrap">Duration&nbsp;</td>
134
                <td width="1%" nowrap">Outcome&nbsp;</td>
135
              </tr>
136
              <%End If%>
137
              <%While ((NOT utQry.BOF) AND (NOT utQry.EOF))%>
138
              <tr class="form_item_grey" > 
139
                <td nowrap><%=utQry("platform")%></td>
140
                <td nowrap><%=utQry("type")%></td>
141
                <td nowrap><%=utQry("test_name")%></td>
142
                <td nowrap><%=utQry("time_taken")%></td>
143
                <td nowrap><%=utQry("test_outcome")%></td>
144
              </tr>
145
              <%
146
              <!-- Set to hide all but the first element -->
147
              utQry.MoveNext
148
              WEnd
149
              utQry.Close
150
              Set utQry = nothing
151
              %>
152
            </table>
153
            </tr>
154
            </table>
155
        </td>
156
        <!-- End Display the Unit Test Results -->
157
      </tr>
158
      <%
159
      displayStyle = "style='display:none'"
160
      displayStyle1 = "style='display:inline'" 
161
      biQry.MoveNext
162
      WEnd
163
      biQry.Close
164
      Set biQry = nothing
165
      %>
166
    </table>
167