Subversion Repositories DevTools

Rev

Rev 6372 | Rev 6790 | 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
 
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
      <%
6372 dpurdie 91
        Dim displayClass   : displayClass   = "display-table"
92
        Dim displayClassI  : displayClassI  = "display-inline"
93
        Dim displayClass1  : displayClass1  = "display-none"
94
        Dim displayClassI1 : displayClassI1 = "display-none"
5018 dpurdie 95
        While ((NOT biQry.BOF) AND (NOT biQry.EOF))
96
      %>
97
      <tr class="form_item_grey" > 
98
        <td nowrap><%=biQry("proj_name")%></td>
99
        <td nowrap><%=biQry("rtag_name")%></td>
100
        <td nowrap><%=biQry("timestamp")%></td>
101
        <td nowrap><%=biQry("reason")%></td>
102
        <td nowrap><%=biQry("state")%></td>
103
      </tr>
104
      <tr>
6676 dpurdie 105
        <!-- Display the Unit Test Results <%=biQry("BUILD_ID")%>-->
5018 dpurdie 106
        <td colspan="4" >
107
            <%Call getTestResults(biQry("BUILD_ID"))%>
108
            <table class="full_table">
109
                <tr>
110
                <td valign="top" width="1%" class="form_field_hdrgap" nowrap>&nbsp;&nbsp;&nbsp;&nbsp;
111
                    <a href='javascript:;' onclick='toggleTest(<%=biQry("BUILD_ID")%>);'>
6372 dpurdie 112
                        <img title='Hide Test Results'  id='testImageMin_<%=biQry("BUILD_ID")%>' src="images/btn_min.gif" class='<%=displayClassI%>'>
113
                        <img title='Show Test Results'  id='testImageMax_<%=biQry("BUILD_ID")%>' src="images/btn_max.gif" class='<%=displayClassI1%>'>
5018 dpurdie 114
                    </a>
115
                <td>
6372 dpurdie 116
            <table class="full_table <%=displayClass1%>" id='testResultsH_<%=biQry("BUILD_ID")%>'>
5018 dpurdie 117
                <tr class="form_item_grey" >
118
                <%If utQry.RecordCount < 1 Then %>
119
                  <td nowrap>No Test Results found</td>
120
                <%Else%>
121
                  <td nowrap >Tests : <%=utQry.RecordCount%></td>
122
                <%End If%>
123
                </tr>
124
            </table>
6372 dpurdie 125
            <table class="full_table <%=displayClass%>" id='testResults_<%=biQry("BUILD_ID")%>'>
5018 dpurdie 126
              <%If utQry.RecordCount < 1 Then %>
127
              <tr class="form_item_grey" >
128
                <td nowrap>No Test Results found</td>
129
              </tr>
130
              <%Else%>
131
              <tr class="form_field_hdr"> 
132
                <td width="1%" nowrap">Platform&nbsp;</td>
133
                <td width="1%" nowrap">Type&nbsp;</td>
134
                <td width="95%" nowrap">Test Name&nbsp;</td>
135
                <td width="1%" nowrap">Duration&nbsp;</td>
136
                <td width="1%" nowrap">Outcome&nbsp;</td>
137
              </tr>
138
              <%End If%>
139
              <%While ((NOT utQry.BOF) AND (NOT utQry.EOF))%>
140
              <tr class="form_item_grey" > 
141
                <td nowrap><%=utQry("platform")%></td>
142
                <td nowrap><%=utQry("type")%></td>
143
                <td nowrap><%=utQry("test_name")%></td>
144
                <td nowrap><%=utQry("time_taken")%></td>
145
                <td nowrap><%=utQry("test_outcome")%></td>
146
              </tr>
147
              <%
148
              <!-- Set to hide all but the first element -->
149
              utQry.MoveNext
150
              WEnd
151
              utQry.Close
152
              Set utQry = nothing
153
              %>
154
            </table>
155
            </tr>
156
            </table>
157
        </td>
158
        <!-- End Display the Unit Test Results -->
159
      </tr>
160
      <%
6372 dpurdie 161
      displayClass = "display-none"
162
      displayClass1 = "display-table"
163
      displayClassI = "display-none"
164
      displayClassI1 = "display-inline"
5018 dpurdie 165
      biQry.MoveNext
166
      WEnd
167
      biQry.Close
168
      Set biQry = nothing
169
      %>
170
    </table>
171