Subversion Repositories DevTools

Rev

Rev 6790 | Rev 6873 | Go to most recent revision | Details | Compare with Previous | 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
{
6372 dpurdie 62
    $(  "#testResults_" + id ).toggleClass('display-table display-none');
63
    $( "#testResultsH_" + id ).toggleClass('display-table display-none');
64
    $( "#testImageMin_" + id ).toggleClass('display-inline display-none');
65
    $( "#testImageMax_" + id ).toggleClass('display-inline display-none');
5018 dpurdie 66
}
67
 
68
</script>
69
 
6790 dpurdie 70
     <table class="full_table stdGrey">
71
         <thead>
72
          <tr>
73
            <th nowrap">Project&nbsp;</th>
74
            <th nowrap">Release&nbsp;</th>
75
            <th nowrap">Time&nbsp;</th>
76
            <th nowrap">Reason&nbsp;</th>
77
            <th nowrap">Result&nbsp;</th>
78
          </tr>
79
         </thead>
5018 dpurdie 80
      <%
81
       Call getBuildInstances                          
82
      %>
83
      <%If biQry.RecordCount < 1 Then%>
6790 dpurdie 84
      <tr> 
5018 dpurdie 85
        <td nowrap>&nbsp;</td>
86
        <td nowrap>&nbsp;</td>
87
        <td nowrap>&nbsp;</td>
88
        <td nowrap>&nbsp;</td>
89
        <td nowrap>&nbsp;</td>
90
      </tr>
91
      <%End If%>
92
      <%
6372 dpurdie 93
        Dim displayClass   : displayClass   = "display-table"
94
        Dim displayClassI  : displayClassI  = "display-inline"
95
        Dim displayClass1  : displayClass1  = "display-none"
96
        Dim displayClassI1 : displayClassI1 = "display-none"
5018 dpurdie 97
        While ((NOT biQry.BOF) AND (NOT biQry.EOF))
98
      %>
6790 dpurdie 99
      <tr> 
5018 dpurdie 100
        <td nowrap><%=biQry("proj_name")%></td>
101
        <td nowrap><%=biQry("rtag_name")%></td>
102
        <td nowrap><%=biQry("timestamp")%></td>
103
        <td nowrap><%=biQry("reason")%></td>
104
        <td nowrap><%=biQry("state")%></td>
105
      </tr>
106
      <tr>
6676 dpurdie 107
        <!-- Display the Unit Test Results <%=biQry("BUILD_ID")%>-->
5018 dpurdie 108
        <td colspan="4" >
109
            <%Call getTestResults(biQry("BUILD_ID"))%>
110
            <table class="full_table">
111
                <tr>
6827 dpurdie 112
                    <td valign="top" width="1%" class="form_field_hdrgap" nowrap onclick='toggleTest(<%=biQry("BUILD_ID")%>);'>&nbsp;&nbsp;&nbsp;&nbsp;
6790 dpurdie 113
                            <img title='Hide Test Results'  id='testImageMin_<%=biQry("BUILD_ID")%>' src="images/btn_min.gif" class='<%=displayClassI%>'>
114
                            <img title='Show Test Results'  id='testImageMax_<%=biQry("BUILD_ID")%>' src="images/btn_max.gif" class='<%=displayClassI1%>'>
6827 dpurdie 115
                    </td>
6790 dpurdie 116
                    <td>
117
                        <table class="full_table <%=displayClass1%>" id='testResultsH_<%=biQry("BUILD_ID")%>'>
118
                            <tr class="form_item_grey" >
119
                            <%If utQry.RecordCount < 1 Then %>
120
                              <td nowrap>No Test Results found</td>
121
                            <%Else%>
122
                              <td nowrap >Tests : <%=utQry.RecordCount%></td>
123
                            <%End If%>
124
                            </tr>
125
                        </table>
126
                        <table class="full_table <%=displayClass%> stdGrey" id='testResults_<%=biQry("BUILD_ID")%>'>
127
                          <%If utQry.RecordCount < 1 Then %>
128
                          <tr>
129
                            <td nowrap>No Test Results found</td>
130
                          </tr>
131
                          <%Else%>
132
                            <thead>
133
                              <tr> 
134
                                <th width="1%" nowrap">Platform&nbsp;</th>
135
                                <th width="1%" nowrap">Type&nbsp;</th>
136
                                <th width="95%" nowrap">Test Name&nbsp;</th>
137
                                <th width="1%" nowrap">Duration&nbsp;</th>
138
                                <th width="1%" nowrap">Outcome&nbsp;</th>
139
                              </tr>
140
                            </thead>
141
                          <%End If%>
142
                          <%While ((NOT utQry.BOF) AND (NOT utQry.EOF))%>
143
                          <tr > 
144
                            <td nowrap><%=utQry("platform")%></td>
145
                            <td nowrap><%=utQry("type")%></td>
146
                            <td nowrap><%=utQry("test_name")%></td>
147
                            <td nowrap><%=utQry("time_taken")%></td>
148
                            <td nowrap><%=utQry("test_outcome")%></td>
149
                          </tr>
150
                          <%
151
                          <!-- Set to hide all but the first element -->
152
                          utQry.MoveNext
153
                          WEnd
154
                          utQry.Close
155
                          Set utQry = nothing
156
                          %>
157
                        </table>
158
                    </td>
5018 dpurdie 159
                </tr>
160
            </table>
161
        </td>
162
        <!-- End Display the Unit Test Results -->
163
      </tr>
164
      <%
6372 dpurdie 165
      displayClass = "display-none"
166
      displayClass1 = "display-table"
167
      displayClassI = "display-none"
168
      displayClassI1 = "display-inline"
5018 dpurdie 169
      biQry.MoveNext
170
      WEnd
171
      biQry.Close
172
      Set biQry = nothing
173
      %>
174
    </table>
175