friendly-cukes 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/DETAILED_DESCRIPTION.md +235 -0
- data/Gemfile +17 -0
- data/LICENSE.txt +22 -0
- data/README.md +108 -0
- data/Rakefile +2 -0
- data/bin/build-extractor +69 -0
- data/bin/friendly-cukes +48 -0
- data/friendly-cukes.gemspec +41 -0
- data/lib/friendly/build_extractor.rb +647 -0
- data/lib/friendly/cukes.rb +29 -0
- data/lib/friendly/cukes/framework/Gemfile +16 -0
- data/lib/friendly/cukes/framework/Gemfile.lock +113 -0
- data/lib/friendly/cukes/framework/Rakefile.rb +19 -0
- data/lib/friendly/cukes/framework/config/config.yml +87 -0
- data/lib/friendly/cukes/framework/config/cucumber.yml +49 -0
- data/lib/friendly/cukes/framework/coverage/.last_run.json +5 -0
- data/lib/friendly/cukes/framework/coverage/.resultset.json +3519 -0
- data/lib/friendly/cukes/framework/coverage/.resultset.json.lock +0 -0
- data/lib/friendly/cukes/framework/coverage/rcov/assets/0.2.3/jquery-1.3.2.min.js +19 -0
- data/lib/friendly/cukes/framework/coverage/rcov/assets/0.2.3/jquery.tablesorter.min.js +15 -0
- data/lib/friendly/cukes/framework/coverage/rcov/assets/0.2.3/print.css +12 -0
- data/lib/friendly/cukes/framework/coverage/rcov/assets/0.2.3/rcov.js +42 -0
- data/lib/friendly/cukes/framework/coverage/rcov/assets/0.2.3/screen.css +270 -0
- data/lib/friendly/cukes/framework/coverage/rcov/index.html +392 -0
- data/lib/friendly/cukes/framework/coverage/rcov/library-app_init-app_driver_rb.html +98 -0
- data/lib/friendly/cukes/framework/coverage/rcov/library-app_utils-data_file_names_rb.html +65 -0
- data/lib/friendly/cukes/framework/coverage/rcov/library-app_utils-page_utils_rb.html +533 -0
- data/lib/friendly/cukes/framework/coverage/rcov/library-generic-create_log_rb.html +521 -0
- data/lib/friendly/cukes/framework/coverage/rcov/library-generic-custom_html_report_rb.html +2522 -0
- data/lib/friendly/cukes/framework/coverage/rcov/library-generic-datetime_library_rb.html +296 -0
- data/lib/friendly/cukes/framework/coverage/rcov/library-generic-file_library_rb.html +995 -0
- data/lib/friendly/cukes/framework/coverage/rcov/library-generic-performance_report_rb.html +1613 -0
- data/lib/friendly/cukes/framework/coverage/rcov/library-generic-read_from_yml_rb.html +944 -0
- data/lib/friendly/cukes/framework/coverage/rcov/object_repository-desktop-gem_search_rb.html +773 -0
- data/lib/friendly/cukes/framework/coverage/rcov/object_repository-desktop-google_search_rb.html +230 -0
- data/lib/friendly/cukes/framework/coverage/rcov/object_repository-mobile-mobile_google_search_rb.html +230 -0
- data/lib/friendly/cukes/framework/coverage/rcov/step_definitions-desktop-gem_search_rb.html +188 -0
- data/lib/friendly/cukes/framework/coverage/rcov/step_definitions-desktop-google_search_steps_rb.html +167 -0
- data/lib/friendly/cukes/framework/coverage/rcov/step_definitions-mobile-mobile_google_search_steps_rb.html +167 -0
- data/lib/friendly/cukes/framework/coverage/rcov/support-browser_settings_rb.html +851 -0
- data/lib/friendly/cukes/framework/coverage/rcov/support-env_rb.html +242 -0
- data/lib/friendly/cukes/framework/coverage/rcov/support-hooks_rb.html +878 -0
- data/lib/friendly/cukes/framework/coverage/rcov/support-html_formatter_rb.html +230 -0
- data/lib/friendly/cukes/framework/features/desktop/google_search/google_search.feature +19 -0
- data/lib/friendly/cukes/framework/features/desktop/rubygems_search/gem_name_tc_04.yml +2 -0
- data/lib/friendly/cukes/framework/features/desktop/rubygems_search/gem_search.feature +37 -0
- data/lib/friendly/cukes/framework/features/desktop/test_data/gem_name.yml +2 -0
- data/lib/friendly/cukes/framework/features/mobile/google_search/mobile_google_search.feature +19 -0
- data/lib/friendly/cukes/framework/library/app_init/app_init.rb +13 -0
- data/lib/friendly/cukes/framework/library/app_utils/data_file_names.rb +2 -0
- data/lib/friendly/cukes/framework/library/app_utils/page_utils.rb +157 -0
- data/lib/friendly/cukes/framework/library/generic/app_logo_1.png +0 -0
- data/lib/friendly/cukes/framework/library/generic/create_log.rb +154 -0
- data/lib/friendly/cukes/framework/library/generic/custom_html_report.rb +852 -0
- data/lib/friendly/cukes/framework/library/generic/datetime_library.rb +79 -0
- data/lib/friendly/cukes/framework/library/generic/file_library.rb +311 -0
- data/lib/friendly/cukes/framework/library/generic/performance_report.rb +518 -0
- data/lib/friendly/cukes/framework/library/generic/read_from_yml.rb +294 -0
- data/lib/friendly/cukes/framework/object_repository/desktop/desktop_web_object_repo.rb +50 -0
- data/lib/friendly/cukes/framework/object_repository/mobile/mobile_web_object_repo.rb +22 -0
- data/lib/friendly/cukes/framework/page_objects/desktop/gem_search.rb +213 -0
- data/lib/friendly/cukes/framework/page_objects/desktop/google_search.rb +53 -0
- data/lib/friendly/cukes/framework/page_objects/mobile/mobile_google_search.rb +53 -0
- data/lib/friendly/cukes/framework/step_definitions/desktop/gem_search.rb +43 -0
- data/lib/friendly/cukes/framework/step_definitions/desktop/google_search_steps.rb +36 -0
- data/lib/friendly/cukes/framework/step_definitions/mobile/mobile_google_search_steps.rb +36 -0
- data/lib/friendly/cukes/framework/support/browser_settings.rb +264 -0
- data/lib/friendly/cukes/framework/support/env.rb +65 -0
- data/lib/friendly/cukes/framework/support/hooks.rb +274 -0
- data/lib/friendly/cukes/framework/support/html_formatter.rb +57 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/app_env.log +15 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/custom_report/detailed_report/app_logo_1.png +0 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/custom_report/detailed_report/desktop_gem_search.html +647 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/custom_report/detailed_report/desktop_google_search.html +590 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/custom_report/report_home.html +593 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/desktop_rubygems_search.log +84 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/report_21_05_2015-11_04_54.html +472 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/report_21_05_2015-11_04_54.json +299 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_37/app_env.log +15 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_37/desktop_google_search.log +22 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_37/report_21_05_2015-11_03_49.html +472 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_37/report_21_05_2015-11_03_49.json +155 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-17_28_10/app_env.log +15 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-17_28_10/mobile_google_search.log +22 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-17_28_10/report_21_05_2015-17_29_26.html +472 -0
- data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-17_28_10/report_21_05_2015-17_29_26.json +143 -0
- data/lib/friendly/cukes/version.rb +61 -0
- metadata +309 -0
|
@@ -0,0 +1,1613 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2
|
+
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
|
|
3
|
+
<head>
|
|
4
|
+
<title>library/generic/performance_report.rb</title>
|
|
5
|
+
<link href="./assets/0.2.3/screen.css" media="all" rel="stylesheet" type="text/css" />
|
|
6
|
+
<link href="./assets/0.2.3/print.css" media="print" rel="stylesheet" type="text/css" />
|
|
7
|
+
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
|
|
8
|
+
<script type="text/javascript" src="./assets/0.2.3/rcov.js"></script>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<h1>Cukes C0 Coverage Information - Simploco - RCov</h1>
|
|
12
|
+
<h2>library/generic/performance_report.rb</h2>
|
|
13
|
+
|
|
14
|
+
<div class="report_table_wrapper">
|
|
15
|
+
<table class='report' id='report_table'>
|
|
16
|
+
<thead>
|
|
17
|
+
<tr>
|
|
18
|
+
<th class="left_align">Name</th>
|
|
19
|
+
<th class="right_align">Total Lines</th>
|
|
20
|
+
<th class="right_align">Lines of Code</th>
|
|
21
|
+
<th class="left_align">Total Coverage</th>
|
|
22
|
+
<th class="left_align">Code Coverage</th>
|
|
23
|
+
</tr>
|
|
24
|
+
</thead>
|
|
25
|
+
<tbody>
|
|
26
|
+
<tr>
|
|
27
|
+
<td class="left_align"><a href="library-generic-performance_report_rb.html">library/generic/performance_report.rb</a></td>
|
|
28
|
+
<td class='right_align'><tt>518</tt></td>
|
|
29
|
+
<td class='right_align'><tt>255</tt></td>
|
|
30
|
+
<td class="left_align"><div class="percent_graph_legend"><tt class=''>54.44%</tt></div>
|
|
31
|
+
<div class="percent_graph">
|
|
32
|
+
<div class="covered" style="width:54px"></div>
|
|
33
|
+
<div class="uncovered" style="width:46px"></div>
|
|
34
|
+
</div></td>
|
|
35
|
+
<td class="left_align"><div class="percent_graph_legend"><tt class=''>7.45%</tt></div>
|
|
36
|
+
<div class="percent_graph">
|
|
37
|
+
<div class="covered" style="width:7px"></div>
|
|
38
|
+
<div class="uncovered" style="width:93px"></div>
|
|
39
|
+
</div></td>
|
|
40
|
+
</tr>
|
|
41
|
+
</tbody>
|
|
42
|
+
</table>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<h3>Key</h3>
|
|
46
|
+
|
|
47
|
+
<div class="key"><pre><span class='marked'>Code reported as executed by Ruby looks like this...</span><span class='marked1'>and this: this line is also marked as covered.</span><span class='inferred'>Lines considered as run by rcov, but not reported by Ruby, look like this,</span><span class='inferred1'>and this: these lines were inferred by rcov (using simple heuristics).</span><span class='uncovered'>Finally, here's a line marked as not executed.</span></pre></div>
|
|
48
|
+
|
|
49
|
+
<h3>Coverage Details</h3>
|
|
50
|
+
|
|
51
|
+
<table class="details">
|
|
52
|
+
<tbody>
|
|
53
|
+
<tr class="inferred">
|
|
54
|
+
<td><pre><a name="line2">2</a> =begin</pre></td>
|
|
55
|
+
</tr>
|
|
56
|
+
<tr class="inferred">
|
|
57
|
+
<td><pre><a name="line3">3</a> *Name : CustomHtmlReport</pre></td>
|
|
58
|
+
</tr>
|
|
59
|
+
<tr class="inferred">
|
|
60
|
+
<td><pre><a name="line4">4</a> *Description : class that holds performance report data generator methods</pre></td>
|
|
61
|
+
</tr>
|
|
62
|
+
<tr class="inferred">
|
|
63
|
+
<td><pre><a name="line5">5</a> *Author : Chandra sekaran</pre></td>
|
|
64
|
+
</tr>
|
|
65
|
+
<tr class="inferred">
|
|
66
|
+
<td><pre><a name="line6">6</a> *Creation Date : 05/03/2015</pre></td>
|
|
67
|
+
</tr>
|
|
68
|
+
<tr class="inferred">
|
|
69
|
+
<td><pre><a name="line7">7</a> *Updation Date :</pre></td>
|
|
70
|
+
</tr>
|
|
71
|
+
<tr class="inferred">
|
|
72
|
+
<td><pre><a name="line8">8</a> =end</pre></td>
|
|
73
|
+
</tr>
|
|
74
|
+
<tr class="inferred">
|
|
75
|
+
<td><pre><a name="line9">9</a> </pre></td>
|
|
76
|
+
</tr>
|
|
77
|
+
<tr class="marked">
|
|
78
|
+
<td><pre><a name="line10">10</a> module CUKES</pre></td>
|
|
79
|
+
</tr>
|
|
80
|
+
<tr class="marked">
|
|
81
|
+
<td><pre><a name="line11">11</a> class PerformanceReport</pre></td>
|
|
82
|
+
</tr>
|
|
83
|
+
<tr class="inferred">
|
|
84
|
+
<td><pre><a name="line12">12</a> </pre></td>
|
|
85
|
+
</tr>
|
|
86
|
+
<tr class="inferred">
|
|
87
|
+
<td><pre><a name="line13">13</a> # Description : invoked automatically when an object of the class type is created</pre></td>
|
|
88
|
+
</tr>
|
|
89
|
+
<tr class="inferred">
|
|
90
|
+
<td><pre><a name="line14">14</a> # Author : Chandra sekaran</pre></td>
|
|
91
|
+
</tr>
|
|
92
|
+
<tr class="inferred">
|
|
93
|
+
<td><pre><a name="line15">15</a> # Arguments :</pre></td>
|
|
94
|
+
</tr>
|
|
95
|
+
<tr class="inferred">
|
|
96
|
+
<td><pre><a name="line16">16</a> # arr_file_paths : array of html report file paths</pre></td>
|
|
97
|
+
</tr>
|
|
98
|
+
<tr class="inferred">
|
|
99
|
+
<td><pre><a name="line17">17</a> #</pre></td>
|
|
100
|
+
</tr>
|
|
101
|
+
<tr class="marked">
|
|
102
|
+
<td><pre><a name="line18">18</a> def initialize(arr_file_path)</pre></td>
|
|
103
|
+
</tr>
|
|
104
|
+
<tr class="uncovered">
|
|
105
|
+
<td><pre><a name="line19">19</a> @arr_file_name = arr_file_path</pre></td>
|
|
106
|
+
</tr>
|
|
107
|
+
<tr class="uncovered">
|
|
108
|
+
<td><pre><a name="line20">20</a> @num_build_duration = 0</pre></td>
|
|
109
|
+
</tr>
|
|
110
|
+
<tr class="uncovered">
|
|
111
|
+
<td><pre><a name="line21">21</a> @bool_build_passed = true</pre></td>
|
|
112
|
+
</tr>
|
|
113
|
+
<tr class="uncovered">
|
|
114
|
+
<td><pre><a name="line22">22</a> @num_feature_count = 0</pre></td>
|
|
115
|
+
</tr>
|
|
116
|
+
<tr class="uncovered">
|
|
117
|
+
<td><pre><a name="line23">23</a> @num_feature_pass_count = 0</pre></td>
|
|
118
|
+
</tr>
|
|
119
|
+
<tr class="uncovered">
|
|
120
|
+
<td><pre><a name="line24">24</a> @num_feature_fail_count = 0</pre></td>
|
|
121
|
+
</tr>
|
|
122
|
+
<tr class="uncovered">
|
|
123
|
+
<td><pre><a name="line25">25</a> @num_feature_skip_count = 0</pre></td>
|
|
124
|
+
</tr>
|
|
125
|
+
<tr class="uncovered">
|
|
126
|
+
<td><pre><a name="line26">26</a> @str_connection_url = "DBI:SQLAnywhere:SERVER=#{DB_SERVER};DBN=#{DB_NAME}"</pre></td>
|
|
127
|
+
</tr>
|
|
128
|
+
<tr class="inferred">
|
|
129
|
+
<td><pre><a name="line27">27</a> end</pre></td>
|
|
130
|
+
</tr>
|
|
131
|
+
<tr class="inferred">
|
|
132
|
+
<td><pre><a name="line28">28</a> </pre></td>
|
|
133
|
+
</tr>
|
|
134
|
+
<tr class="inferred">
|
|
135
|
+
<td><pre><a name="line29">29</a> # Description : parses the json object saves the required execution data into Sybase DB</pre></td>
|
|
136
|
+
</tr>
|
|
137
|
+
<tr class="inferred">
|
|
138
|
+
<td><pre><a name="line30">30</a> # Author : Chandra sekaran</pre></td>
|
|
139
|
+
</tr>
|
|
140
|
+
<tr class="inferred">
|
|
141
|
+
<td><pre><a name="line31">31</a> #</pre></td>
|
|
142
|
+
</tr>
|
|
143
|
+
<tr class="marked">
|
|
144
|
+
<td><pre><a name="line32">32</a> def parse_json</pre></td>
|
|
145
|
+
</tr>
|
|
146
|
+
<tr class="uncovered">
|
|
147
|
+
<td><pre><a name="line33">33</a> @json.each_with_index do |json, index| # iterate each feature</pre></td>
|
|
148
|
+
</tr>
|
|
149
|
+
<tr class="uncovered">
|
|
150
|
+
<td><pre><a name="line34">34</a> str_feature_id, num_feature_result_id = set_feature(json["name"].to_s) # add feature name</pre></td>
|
|
151
|
+
</tr>
|
|
152
|
+
<tr class="uncovered">
|
|
153
|
+
<td><pre><a name="line35">35</a> @num_feature_count += 1</pre></td>
|
|
154
|
+
</tr>
|
|
155
|
+
<tr class="uncovered">
|
|
156
|
+
<td><pre><a name="line36">36</a> scenario_count = 0</pre></td>
|
|
157
|
+
</tr>
|
|
158
|
+
<tr class="uncovered">
|
|
159
|
+
<td><pre><a name="line37">37</a> feature_duration = 0</pre></td>
|
|
160
|
+
</tr>
|
|
161
|
+
<tr class="uncovered">
|
|
162
|
+
<td><pre><a name="line38">38</a> bool_feature_passed = true</pre></td>
|
|
163
|
+
</tr>
|
|
164
|
+
<tr class="uncovered">
|
|
165
|
+
<td><pre><a name="line39">39</a> num_scenario_pass_count = 0</pre></td>
|
|
166
|
+
</tr>
|
|
167
|
+
<tr class="uncovered">
|
|
168
|
+
<td><pre><a name="line40">40</a> num_scenario_fail_count = 0</pre></td>
|
|
169
|
+
</tr>
|
|
170
|
+
<tr class="uncovered">
|
|
171
|
+
<td><pre><a name="line41">41</a> num_scenario_skip_count = 0</pre></td>
|
|
172
|
+
</tr>
|
|
173
|
+
<tr class="inferred">
|
|
174
|
+
<td><pre><a name="line42">42</a> </pre></td>
|
|
175
|
+
</tr>
|
|
176
|
+
<tr class="uncovered">
|
|
177
|
+
<td><pre><a name="line43">43</a> json["elements"].each do |element|</pre></td>
|
|
178
|
+
</tr>
|
|
179
|
+
<tr class="inferred">
|
|
180
|
+
<td><pre><a name="line44">44</a> # for including the first background steps duration to the first scenario background steps as Cucumber json</pre></td>
|
|
181
|
+
</tr>
|
|
182
|
+
<tr class="inferred">
|
|
183
|
+
<td><pre><a name="line45">45</a> # report considers background for the first scenario and hence will have 0 duration for the background steps</pre></td>
|
|
184
|
+
</tr>
|
|
185
|
+
<tr class="inferred">
|
|
186
|
+
<td><pre><a name="line46">46</a> # under first scenario and the actual duration for the background will be set for the subsequent scenarios</pre></td>
|
|
187
|
+
</tr>
|
|
188
|
+
<tr class="uncovered">
|
|
189
|
+
<td><pre><a name="line47">47</a> if index == 0</pre></td>
|
|
190
|
+
</tr>
|
|
191
|
+
<tr class="uncovered">
|
|
192
|
+
<td><pre><a name="line48">48</a> if element["keyword"] == "Background"</pre></td>
|
|
193
|
+
</tr>
|
|
194
|
+
<tr class="uncovered">
|
|
195
|
+
<td><pre><a name="line49">49</a> element["steps"].each do |step|</pre></td>
|
|
196
|
+
</tr>
|
|
197
|
+
<tr class="uncovered">
|
|
198
|
+
<td><pre><a name="line50">50</a> @arr_background_step_duration << step["result"]["duration"].to_i</pre></td>
|
|
199
|
+
</tr>
|
|
200
|
+
<tr class="uncovered">
|
|
201
|
+
<td><pre><a name="line51">51</a> @bool = true</pre></td>
|
|
202
|
+
</tr>
|
|
203
|
+
<tr class="inferred">
|
|
204
|
+
<td><pre><a name="line52">52</a> end</pre></td>
|
|
205
|
+
</tr>
|
|
206
|
+
<tr class="inferred">
|
|
207
|
+
<td><pre><a name="line53">53</a> end</pre></td>
|
|
208
|
+
</tr>
|
|
209
|
+
<tr class="inferred">
|
|
210
|
+
<td><pre><a name="line54">54</a> end</pre></td>
|
|
211
|
+
</tr>
|
|
212
|
+
<tr class="uncovered">
|
|
213
|
+
<td><pre><a name="line55">55</a> num_step_pass_count = 0</pre></td>
|
|
214
|
+
</tr>
|
|
215
|
+
<tr class="uncovered">
|
|
216
|
+
<td><pre><a name="line56">56</a> num_step_fail_count = 0</pre></td>
|
|
217
|
+
</tr>
|
|
218
|
+
<tr class="uncovered">
|
|
219
|
+
<td><pre><a name="line57">57</a> num_step_skip_count = 0</pre></td>
|
|
220
|
+
</tr>
|
|
221
|
+
<tr class="inferred">
|
|
222
|
+
<td><pre><a name="line58">58</a> </pre></td>
|
|
223
|
+
</tr>
|
|
224
|
+
<tr class="uncovered">
|
|
225
|
+
<td><pre><a name="line59">59</a> if element["keyword"] == "Scenario" # take scenario for scenario level details</pre></td>
|
|
226
|
+
</tr>
|
|
227
|
+
<tr class="uncovered">
|
|
228
|
+
<td><pre><a name="line60">60</a> str_scenario_id, scenario_result_id = set_scenario(element["name"], element["tags"][0]["name"], str_feature_id) # add scenario name</pre></td>
|
|
229
|
+
</tr>
|
|
230
|
+
<tr class="inferred">
|
|
231
|
+
<td><pre><a name="line61">61</a> </pre></td>
|
|
232
|
+
</tr>
|
|
233
|
+
<tr class="uncovered">
|
|
234
|
+
<td><pre><a name="line62">62</a> scenario_count += 1 # as it counts only 'Scenarios' and not 'Backgrounds'</pre></td>
|
|
235
|
+
</tr>
|
|
236
|
+
<tr class="uncovered">
|
|
237
|
+
<td><pre><a name="line63">63</a> step_count = 0</pre></td>
|
|
238
|
+
</tr>
|
|
239
|
+
<tr class="uncovered">
|
|
240
|
+
<td><pre><a name="line64">64</a> scenario_duration = 0</pre></td>
|
|
241
|
+
</tr>
|
|
242
|
+
<tr class="uncovered">
|
|
243
|
+
<td><pre><a name="line65">65</a> bool_scenario_passed = true</pre></td>
|
|
244
|
+
</tr>
|
|
245
|
+
<tr class="inferred">
|
|
246
|
+
<td><pre><a name="line66">66</a> </pre></td>
|
|
247
|
+
</tr>
|
|
248
|
+
<tr class="uncovered">
|
|
249
|
+
<td><pre><a name="line67">67</a> element["steps"].each_with_index do |step, indx| # iterate each steps of the current scenario</pre></td>
|
|
250
|
+
</tr>
|
|
251
|
+
<tr class="inferred">
|
|
252
|
+
<td><pre><a name="line68">68</a> #num_step_id, num_step_result_id = set_step(step['keyword']+step['name'], str_scenario_id, scenario_result_id) # add step name</pre></td>
|
|
253
|
+
</tr>
|
|
254
|
+
<tr class="uncovered">
|
|
255
|
+
<td><pre><a name="line69">69</a> num_step_id = set_step(step['keyword']+step['name'], str_scenario_id, scenario_result_id) # add step name</pre></td>
|
|
256
|
+
</tr>
|
|
257
|
+
<tr class="inferred">
|
|
258
|
+
<td><pre><a name="line70">70</a> </pre></td>
|
|
259
|
+
</tr>
|
|
260
|
+
<tr class="uncovered">
|
|
261
|
+
<td><pre><a name="line71">71</a> step_count += 1</pre></td>
|
|
262
|
+
</tr>
|
|
263
|
+
<tr class="uncovered">
|
|
264
|
+
<td><pre><a name="line72">72</a> step_duration = 0</pre></td>
|
|
265
|
+
</tr>
|
|
266
|
+
<tr class="uncovered">
|
|
267
|
+
<td><pre><a name="line73">73</a> bool_step_passed = true</pre></td>
|
|
268
|
+
</tr>
|
|
269
|
+
<tr class="uncovered">
|
|
270
|
+
<td><pre><a name="line74">74</a> if (index == 0) && (indx < @arr_background_step_duration.size) && @bool</pre></td>
|
|
271
|
+
</tr>
|
|
272
|
+
<tr class="uncovered">
|
|
273
|
+
<td><pre><a name="line75">75</a> step_duration = @arr_background_step_duration[indx] # take duration from Background for the first scenario</pre></td>
|
|
274
|
+
</tr>
|
|
275
|
+
<tr class="inferred">
|
|
276
|
+
<td><pre><a name="line76">76</a> else</pre></td>
|
|
277
|
+
</tr>
|
|
278
|
+
<tr class="uncovered">
|
|
279
|
+
<td><pre><a name="line77">77</a> step_duration = step['result']['duration'].to_i # take usual duration</pre></td>
|
|
280
|
+
</tr>
|
|
281
|
+
<tr class="uncovered">
|
|
282
|
+
<td><pre><a name="line78">78</a> @bool = false</pre></td>
|
|
283
|
+
</tr>
|
|
284
|
+
<tr class="inferred">
|
|
285
|
+
<td><pre><a name="line79">79</a> end</pre></td>
|
|
286
|
+
</tr>
|
|
287
|
+
<tr class="uncovered">
|
|
288
|
+
<td><pre><a name="line80">80</a> scenario_duration += step_duration</pre></td>
|
|
289
|
+
</tr>
|
|
290
|
+
<tr class="uncovered">
|
|
291
|
+
<td><pre><a name="line81">81</a> if step['result']['status'] == "passed"</pre></td>
|
|
292
|
+
</tr>
|
|
293
|
+
<tr class="uncovered">
|
|
294
|
+
<td><pre><a name="line82">82</a> num_step_pass_count += 1</pre></td>
|
|
295
|
+
</tr>
|
|
296
|
+
<tr class="inferred">
|
|
297
|
+
<td><pre><a name="line83">83</a> elsif step['result']['status'] == "failed"</pre></td>
|
|
298
|
+
</tr>
|
|
299
|
+
<tr class="uncovered">
|
|
300
|
+
<td><pre><a name="line84">84</a> num_step_fail_count += 1</pre></td>
|
|
301
|
+
</tr>
|
|
302
|
+
<tr class="inferred">
|
|
303
|
+
<td><pre><a name="line85">85</a> elsif step['result']['status'] == "skipped"</pre></td>
|
|
304
|
+
</tr>
|
|
305
|
+
<tr class="uncovered">
|
|
306
|
+
<td><pre><a name="line86">86</a> num_step_skip_count += 1</pre></td>
|
|
307
|
+
</tr>
|
|
308
|
+
<tr class="inferred">
|
|
309
|
+
<td><pre><a name="line87">87</a> end</pre></td>
|
|
310
|
+
</tr>
|
|
311
|
+
<tr class="uncovered">
|
|
312
|
+
<td><pre><a name="line88">88</a> bool_step_passed = ["passed", "pending"].include?(step['result']['status']) ? true : false</pre></td>
|
|
313
|
+
</tr>
|
|
314
|
+
<tr class="uncovered">
|
|
315
|
+
<td><pre><a name="line89">89</a> bool_scenario_passed &&= bool_step_passed</pre></td>
|
|
316
|
+
</tr>
|
|
317
|
+
<tr class="inferred">
|
|
318
|
+
<td><pre><a name="line90">90</a> #puts "\t\t Step : #{step['keyword']+step['name']} - #{step_duration} - #{bool_step_passed}"</pre></td>
|
|
319
|
+
</tr>
|
|
320
|
+
<tr class="inferred">
|
|
321
|
+
<td><pre><a name="line91">91</a> #reset_step_result(bool_step_passed, step_duration, num_step_result_id)</pre></td>
|
|
322
|
+
</tr>
|
|
323
|
+
<tr class="uncovered">
|
|
324
|
+
<td><pre><a name="line92">92</a> set_step_result_new(num_step_id, str_scenario_id, scenario_result_id, bool_step_passed, step_duration)</pre></td>
|
|
325
|
+
</tr>
|
|
326
|
+
<tr class="inferred">
|
|
327
|
+
<td><pre><a name="line93">93</a> end</pre></td>
|
|
328
|
+
</tr>
|
|
329
|
+
<tr class="inferred">
|
|
330
|
+
<td><pre><a name="line94">94</a> #puts "Scenario : #{element["tags"][0]["name"]} - #{element['name']} - #{scenario_duration} - #{bool_scenario_passed} - #{step_count}"</pre></td>
|
|
331
|
+
</tr>
|
|
332
|
+
<tr class="uncovered">
|
|
333
|
+
<td><pre><a name="line95">95</a> reset_scenario_result(scenario_result_id, scenario_duration, num_step_pass_count, num_step_fail_count, num_step_skip_count, bool_scenario_passed)</pre></td>
|
|
334
|
+
</tr>
|
|
335
|
+
<tr class="uncovered">
|
|
336
|
+
<td><pre><a name="line96">96</a> feature_duration += scenario_duration</pre></td>
|
|
337
|
+
</tr>
|
|
338
|
+
<tr class="uncovered">
|
|
339
|
+
<td><pre><a name="line97">97</a> bool_feature_passed &&= bool_scenario_passed</pre></td>
|
|
340
|
+
</tr>
|
|
341
|
+
<tr class="inferred">
|
|
342
|
+
<td><pre><a name="line98">98</a> </pre></td>
|
|
343
|
+
</tr>
|
|
344
|
+
<tr class="uncovered">
|
|
345
|
+
<td><pre><a name="line99">99</a> if bool_scenario_passed</pre></td>
|
|
346
|
+
</tr>
|
|
347
|
+
<tr class="uncovered">
|
|
348
|
+
<td><pre><a name="line100">100</a> num_scenario_pass_count += 1 # scenario pass count</pre></td>
|
|
349
|
+
</tr>
|
|
350
|
+
<tr class="inferred">
|
|
351
|
+
<td><pre><a name="line101">101</a> else</pre></td>
|
|
352
|
+
</tr>
|
|
353
|
+
<tr class="uncovered">
|
|
354
|
+
<td><pre><a name="line102">102</a> if num_step_pass_count == 0 && num_step_fail_count == 0 && num_step_skip_count > 0</pre></td>
|
|
355
|
+
</tr>
|
|
356
|
+
<tr class="uncovered">
|
|
357
|
+
<td><pre><a name="line103">103</a> num_scenario_skip_count += 1 # scenario skip count</pre></td>
|
|
358
|
+
</tr>
|
|
359
|
+
<tr class="inferred">
|
|
360
|
+
<td><pre><a name="line104">104</a> else</pre></td>
|
|
361
|
+
</tr>
|
|
362
|
+
<tr class="uncovered">
|
|
363
|
+
<td><pre><a name="line105">105</a> num_scenario_fail_count += 1 # scenario fail count</pre></td>
|
|
364
|
+
</tr>
|
|
365
|
+
<tr class="inferred">
|
|
366
|
+
<td><pre><a name="line106">106</a> end</pre></td>
|
|
367
|
+
</tr>
|
|
368
|
+
<tr class="inferred">
|
|
369
|
+
<td><pre><a name="line107">107</a> end</pre></td>
|
|
370
|
+
</tr>
|
|
371
|
+
<tr class="inferred">
|
|
372
|
+
<td><pre><a name="line108">108</a> </pre></td>
|
|
373
|
+
</tr>
|
|
374
|
+
<tr class="inferred">
|
|
375
|
+
<td><pre><a name="line109">109</a> end</pre></td>
|
|
376
|
+
</tr>
|
|
377
|
+
<tr class="inferred">
|
|
378
|
+
<td><pre><a name="line110">110</a> end</pre></td>
|
|
379
|
+
</tr>
|
|
380
|
+
<tr class="inferred">
|
|
381
|
+
<td><pre><a name="line111">111</a> #puts "Feature : #{json['name']} - #{feature_duration} - #{bool_feature_passed} - #{scenario_count}"</pre></td>
|
|
382
|
+
</tr>
|
|
383
|
+
<tr class="uncovered">
|
|
384
|
+
<td><pre><a name="line112">112</a> reset_feature_result(feature_duration, num_scenario_pass_count, num_scenario_fail_count, num_scenario_skip_count, bool_feature_passed, num_feature_result_id)</pre></td>
|
|
385
|
+
</tr>
|
|
386
|
+
<tr class="uncovered">
|
|
387
|
+
<td><pre><a name="line113">113</a> @num_build_duration += feature_duration</pre></td>
|
|
388
|
+
</tr>
|
|
389
|
+
<tr class="uncovered">
|
|
390
|
+
<td><pre><a name="line114">114</a> @bool_build_passed &&= bool_feature_passed</pre></td>
|
|
391
|
+
</tr>
|
|
392
|
+
<tr class="inferred">
|
|
393
|
+
<td><pre><a name="line115">115</a> </pre></td>
|
|
394
|
+
</tr>
|
|
395
|
+
<tr class="uncovered">
|
|
396
|
+
<td><pre><a name="line116">116</a> if bool_feature_passed</pre></td>
|
|
397
|
+
</tr>
|
|
398
|
+
<tr class="uncovered">
|
|
399
|
+
<td><pre><a name="line117">117</a> @num_feature_pass_count += 1</pre></td>
|
|
400
|
+
</tr>
|
|
401
|
+
<tr class="inferred">
|
|
402
|
+
<td><pre><a name="line118">118</a> else</pre></td>
|
|
403
|
+
</tr>
|
|
404
|
+
<tr class="uncovered">
|
|
405
|
+
<td><pre><a name="line119">119</a> @num_feature_fail_count += 1 # to do feature skip count</pre></td>
|
|
406
|
+
</tr>
|
|
407
|
+
<tr class="inferred">
|
|
408
|
+
<td><pre><a name="line120">120</a> end</pre></td>
|
|
409
|
+
</tr>
|
|
410
|
+
<tr class="inferred">
|
|
411
|
+
<td><pre><a name="line121">121</a> end</pre></td>
|
|
412
|
+
</tr>
|
|
413
|
+
<tr class="inferred">
|
|
414
|
+
<td><pre><a name="line122">122</a> rescue Exception => ex</pre></td>
|
|
415
|
+
</tr>
|
|
416
|
+
<tr class="uncovered">
|
|
417
|
+
<td><pre><a name="line123">123</a> $log.error("Error while parsing JSON : #{ex}")</pre></td>
|
|
418
|
+
</tr>
|
|
419
|
+
<tr class="uncovered">
|
|
420
|
+
<td><pre><a name="line124">124</a> exit</pre></td>
|
|
421
|
+
</tr>
|
|
422
|
+
<tr class="inferred">
|
|
423
|
+
<td><pre><a name="line125">125</a> end</pre></td>
|
|
424
|
+
</tr>
|
|
425
|
+
<tr class="inferred">
|
|
426
|
+
<td><pre><a name="line126">126</a> </pre></td>
|
|
427
|
+
</tr>
|
|
428
|
+
<tr class="inferred">
|
|
429
|
+
<td><pre><a name="line127">127</a> # Description : sets the build data with default details into Sybase</pre></td>
|
|
430
|
+
</tr>
|
|
431
|
+
<tr class="inferred">
|
|
432
|
+
<td><pre><a name="line128">128</a> # Author : Chandra sekaran</pre></td>
|
|
433
|
+
</tr>
|
|
434
|
+
<tr class="inferred">
|
|
435
|
+
<td><pre><a name="line129">129</a> #</pre></td>
|
|
436
|
+
</tr>
|
|
437
|
+
<tr class="marked">
|
|
438
|
+
<td><pre><a name="line130">130</a> def set_build</pre></td>
|
|
439
|
+
</tr>
|
|
440
|
+
<tr class="uncovered">
|
|
441
|
+
<td><pre><a name="line131">131</a> num_host_id = get_host_data</pre></td>
|
|
442
|
+
</tr>
|
|
443
|
+
<tr class="uncovered">
|
|
444
|
+
<td><pre><a name="line132">132</a> build_name = Time.now.strftime("%d_%m_%Y-%H_%M_%S")</pre></td>
|
|
445
|
+
</tr>
|
|
446
|
+
<tr class="uncovered">
|
|
447
|
+
<td><pre><a name="line133">133</a> DBI.connect(@str_connection_url, DB_USER_NAME, DB_PASSWORD) do |dbh|</pre></td>
|
|
448
|
+
</tr>
|
|
449
|
+
<tr class="uncovered">
|
|
450
|
+
<td><pre><a name="line134">134</a> str_query = "insert into BuildData(BuildName,HostDataID) values (?,?)"</pre></td>
|
|
451
|
+
</tr>
|
|
452
|
+
<tr class="uncovered">
|
|
453
|
+
<td><pre><a name="line135">135</a> sth = dbh.prepare(str_query)</pre></td>
|
|
454
|
+
</tr>
|
|
455
|
+
<tr class="uncovered">
|
|
456
|
+
<td><pre><a name="line136">136</a> sth.execute(build_name, num_host_id)</pre></td>
|
|
457
|
+
</tr>
|
|
458
|
+
<tr class="uncovered">
|
|
459
|
+
<td><pre><a name="line137">137</a> sth.finish</pre></td>
|
|
460
|
+
</tr>
|
|
461
|
+
<tr class="uncovered">
|
|
462
|
+
<td><pre><a name="line138">138</a> dbh.commit</pre></td>
|
|
463
|
+
</tr>
|
|
464
|
+
<tr class="inferred">
|
|
465
|
+
<td><pre><a name="line139">139</a> #puts "Added a record to BuildData table successfully"</pre></td>
|
|
466
|
+
</tr>
|
|
467
|
+
<tr class="inferred">
|
|
468
|
+
<td><pre><a name="line140">140</a> </pre></td>
|
|
469
|
+
</tr>
|
|
470
|
+
<tr class="uncovered">
|
|
471
|
+
<td><pre><a name="line141">141</a> str_query = "select BuildID from BuildData where BuildName='#{build_name}' and HostDataID=#{num_host_id}"</pre></td>
|
|
472
|
+
</tr>
|
|
473
|
+
<tr class="uncovered">
|
|
474
|
+
<td><pre><a name="line142">142</a> sth = dbh.prepare(str_query)</pre></td>
|
|
475
|
+
</tr>
|
|
476
|
+
<tr class="uncovered">
|
|
477
|
+
<td><pre><a name="line143">143</a> sth.execute()</pre></td>
|
|
478
|
+
</tr>
|
|
479
|
+
<tr class="uncovered">
|
|
480
|
+
<td><pre><a name="line144">144</a> @build_id = sth.fetch[0]</pre></td>
|
|
481
|
+
</tr>
|
|
482
|
+
<tr class="uncovered">
|
|
483
|
+
<td><pre><a name="line145">145</a> dbh.disconnect()</pre></td>
|
|
484
|
+
</tr>
|
|
485
|
+
<tr class="inferred">
|
|
486
|
+
<td><pre><a name="line146">146</a> end</pre></td>
|
|
487
|
+
</tr>
|
|
488
|
+
<tr class="inferred">
|
|
489
|
+
<td><pre><a name="line147">147</a> rescue Exception => ex</pre></td>
|
|
490
|
+
</tr>
|
|
491
|
+
<tr class="uncovered">
|
|
492
|
+
<td><pre><a name="line148">148</a> $log.error("Error in setting build data to BuildData table: #{ex}")</pre></td>
|
|
493
|
+
</tr>
|
|
494
|
+
<tr class="uncovered">
|
|
495
|
+
<td><pre><a name="line149">149</a> exit</pre></td>
|
|
496
|
+
</tr>
|
|
497
|
+
<tr class="inferred">
|
|
498
|
+
<td><pre><a name="line150">150</a> end</pre></td>
|
|
499
|
+
</tr>
|
|
500
|
+
<tr class="inferred">
|
|
501
|
+
<td><pre><a name="line151">151</a> </pre></td>
|
|
502
|
+
</tr>
|
|
503
|
+
<tr class="inferred">
|
|
504
|
+
<td><pre><a name="line152">152</a> # Description : gets the host data from Sybase based on current execution host</pre></td>
|
|
505
|
+
</tr>
|
|
506
|
+
<tr class="inferred">
|
|
507
|
+
<td><pre><a name="line153">153</a> # Author : Chandra sekaran</pre></td>
|
|
508
|
+
</tr>
|
|
509
|
+
<tr class="inferred">
|
|
510
|
+
<td><pre><a name="line154">154</a> # Return Arguments :</pre></td>
|
|
511
|
+
</tr>
|
|
512
|
+
<tr class="inferred">
|
|
513
|
+
<td><pre><a name="line155">155</a> # num_host_id : primary key the host</pre></td>
|
|
514
|
+
</tr>
|
|
515
|
+
<tr class="inferred">
|
|
516
|
+
<td><pre><a name="line156">156</a> #</pre></td>
|
|
517
|
+
</tr>
|
|
518
|
+
<tr class="marked">
|
|
519
|
+
<td><pre><a name="line157">157</a> def get_host_data</pre></td>
|
|
520
|
+
</tr>
|
|
521
|
+
<tr class="uncovered">
|
|
522
|
+
<td><pre><a name="line158">158</a> DBI.connect(@str_connection_url, DB_USER_NAME, DB_PASSWORD) do |dbh|</pre></td>
|
|
523
|
+
</tr>
|
|
524
|
+
<tr class="uncovered">
|
|
525
|
+
<td><pre><a name="line159">159</a> str_query = "select HostDataID from HostData where HostName like '#{ENV['COMPUTERNAME'].downcase}' and OS like '#{ENV['OS'].downcase}' and Browser like '#{BROWSER.downcase}'"</pre></td>
|
|
526
|
+
</tr>
|
|
527
|
+
<tr class="uncovered">
|
|
528
|
+
<td><pre><a name="line160">160</a> sth = dbh.prepare(str_query)</pre></td>
|
|
529
|
+
</tr>
|
|
530
|
+
<tr class="uncovered">
|
|
531
|
+
<td><pre><a name="line161">161</a> sth.execute()</pre></td>
|
|
532
|
+
</tr>
|
|
533
|
+
<tr class="uncovered">
|
|
534
|
+
<td><pre><a name="line162">162</a> num_host_id = sth.fetch[0]</pre></td>
|
|
535
|
+
</tr>
|
|
536
|
+
<tr class="uncovered">
|
|
537
|
+
<td><pre><a name="line163">163</a> dbh.disconnect()</pre></td>
|
|
538
|
+
</tr>
|
|
539
|
+
<tr class="uncovered">
|
|
540
|
+
<td><pre><a name="line164">164</a> $log.info("------------host id : #{num_host_id.nil?}")</pre></td>
|
|
541
|
+
</tr>
|
|
542
|
+
<tr class="uncovered">
|
|
543
|
+
<td><pre><a name="line165">165</a> num_host_id.nil? ? 5 : num_host_id</pre></td>
|
|
544
|
+
</tr>
|
|
545
|
+
<tr class="inferred">
|
|
546
|
+
<td><pre><a name="line166">166</a> end</pre></td>
|
|
547
|
+
</tr>
|
|
548
|
+
<tr class="inferred">
|
|
549
|
+
<td><pre><a name="line167">167</a> rescue Exception => ex</pre></td>
|
|
550
|
+
</tr>
|
|
551
|
+
<tr class="uncovered">
|
|
552
|
+
<td><pre><a name="line168">168</a> $log.error("Error in getting host data from HostData table: #{ex}")</pre></td>
|
|
553
|
+
</tr>
|
|
554
|
+
<tr class="uncovered">
|
|
555
|
+
<td><pre><a name="line169">169</a> exit</pre></td>
|
|
556
|
+
</tr>
|
|
557
|
+
<tr class="inferred">
|
|
558
|
+
<td><pre><a name="line170">170</a> end</pre></td>
|
|
559
|
+
</tr>
|
|
560
|
+
<tr class="inferred">
|
|
561
|
+
<td><pre><a name="line171">171</a> </pre></td>
|
|
562
|
+
</tr>
|
|
563
|
+
<tr class="inferred">
|
|
564
|
+
<td><pre><a name="line172">172</a> # Description : resets the build data with execution details into Sybase</pre></td>
|
|
565
|
+
</tr>
|
|
566
|
+
<tr class="inferred">
|
|
567
|
+
<td><pre><a name="line173">173</a> # Author : Chandra sekaran</pre></td>
|
|
568
|
+
</tr>
|
|
569
|
+
<tr class="inferred">
|
|
570
|
+
<td><pre><a name="line174">174</a> # Arguments :</pre></td>
|
|
571
|
+
</tr>
|
|
572
|
+
<tr class="inferred">
|
|
573
|
+
<td><pre><a name="line175">175</a> # num_run_length : total execution time in nanoseconds</pre></td>
|
|
574
|
+
</tr>
|
|
575
|
+
<tr class="inferred">
|
|
576
|
+
<td><pre><a name="line176">176</a> # num_pass_count : number of features passed</pre></td>
|
|
577
|
+
</tr>
|
|
578
|
+
<tr class="inferred">
|
|
579
|
+
<td><pre><a name="line177">177</a> # num_fail_count : number of features failed</pre></td>
|
|
580
|
+
</tr>
|
|
581
|
+
<tr class="inferred">
|
|
582
|
+
<td><pre><a name="line178">178</a> # num_skip_count : number of features skipped</pre></td>
|
|
583
|
+
</tr>
|
|
584
|
+
<tr class="inferred">
|
|
585
|
+
<td><pre><a name="line179">179</a> # bool_result : boolean value resembling the state of build result</pre></td>
|
|
586
|
+
</tr>
|
|
587
|
+
<tr class="inferred">
|
|
588
|
+
<td><pre><a name="line180">180</a> #</pre></td>
|
|
589
|
+
</tr>
|
|
590
|
+
<tr class="marked">
|
|
591
|
+
<td><pre><a name="line181">181</a> def reset_build(num_run_length, num_pass_count, num_fail_count, num_skip_count, bool_result)</pre></td>
|
|
592
|
+
</tr>
|
|
593
|
+
<tr class="uncovered">
|
|
594
|
+
<td><pre><a name="line182">182</a> num_result = bool_result ? 1 : 0</pre></td>
|
|
595
|
+
</tr>
|
|
596
|
+
<tr class="uncovered">
|
|
597
|
+
<td><pre><a name="line183">183</a> DBI.connect(@str_connection_url, DB_USER_NAME, DB_PASSWORD) do |dbh|</pre></td>
|
|
598
|
+
</tr>
|
|
599
|
+
<tr class="uncovered">
|
|
600
|
+
<td><pre><a name="line184">184</a> sth = dbh.prepare("update BuildData set RunLength=?, Passes=?, Failures=?, Skips=?, Result=? where BuildID=?")</pre></td>
|
|
601
|
+
</tr>
|
|
602
|
+
<tr class="uncovered">
|
|
603
|
+
<td><pre><a name="line185">185</a> sth.execute(convert_duration(num_run_length), num_pass_count, num_fail_count, num_skip_count, num_result, @build_id)</pre></td>
|
|
604
|
+
</tr>
|
|
605
|
+
<tr class="uncovered">
|
|
606
|
+
<td><pre><a name="line186">186</a> sth.finish</pre></td>
|
|
607
|
+
</tr>
|
|
608
|
+
<tr class="uncovered">
|
|
609
|
+
<td><pre><a name="line187">187</a> dbh.commit</pre></td>
|
|
610
|
+
</tr>
|
|
611
|
+
<tr class="inferred">
|
|
612
|
+
<td><pre><a name="line188">188</a> #puts "Updated a record (#{@build_id}) in BuildData table successfully"</pre></td>
|
|
613
|
+
</tr>
|
|
614
|
+
<tr class="uncovered">
|
|
615
|
+
<td><pre><a name="line189">189</a> dbh.disconnect()</pre></td>
|
|
616
|
+
</tr>
|
|
617
|
+
<tr class="inferred">
|
|
618
|
+
<td><pre><a name="line190">190</a> end</pre></td>
|
|
619
|
+
</tr>
|
|
620
|
+
<tr class="inferred">
|
|
621
|
+
<td><pre><a name="line191">191</a> rescue Exception => ex</pre></td>
|
|
622
|
+
</tr>
|
|
623
|
+
<tr class="uncovered">
|
|
624
|
+
<td><pre><a name="line192">192</a> $log.error("Error in resetting build data to BuildData table: #{ex}")</pre></td>
|
|
625
|
+
</tr>
|
|
626
|
+
<tr class="uncovered">
|
|
627
|
+
<td><pre><a name="line193">193</a> exit</pre></td>
|
|
628
|
+
</tr>
|
|
629
|
+
<tr class="inferred">
|
|
630
|
+
<td><pre><a name="line194">194</a> end</pre></td>
|
|
631
|
+
</tr>
|
|
632
|
+
<tr class="inferred">
|
|
633
|
+
<td><pre><a name="line195">195</a> </pre></td>
|
|
634
|
+
</tr>
|
|
635
|
+
<tr class="inferred">
|
|
636
|
+
<td><pre><a name="line196">196</a> # Description : sets the feature data with default details into Sybase</pre></td>
|
|
637
|
+
</tr>
|
|
638
|
+
<tr class="inferred">
|
|
639
|
+
<td><pre><a name="line197">197</a> # Author : Chandra sekaran</pre></td>
|
|
640
|
+
</tr>
|
|
641
|
+
<tr class="inferred">
|
|
642
|
+
<td><pre><a name="line198">198</a> # Arguments :</pre></td>
|
|
643
|
+
</tr>
|
|
644
|
+
<tr class="inferred">
|
|
645
|
+
<td><pre><a name="line199">199</a> # str_feature_name : feature name</pre></td>
|
|
646
|
+
</tr>
|
|
647
|
+
<tr class="inferred">
|
|
648
|
+
<td><pre><a name="line200">200</a> # Return Arguments :</pre></td>
|
|
649
|
+
</tr>
|
|
650
|
+
<tr class="inferred">
|
|
651
|
+
<td><pre><a name="line201">201</a> # num_feature_id : primary key the feature</pre></td>
|
|
652
|
+
</tr>
|
|
653
|
+
<tr class="inferred">
|
|
654
|
+
<td><pre><a name="line202">202</a> # num_feature_result_id : primary key of the feature result</pre></td>
|
|
655
|
+
</tr>
|
|
656
|
+
<tr class="inferred">
|
|
657
|
+
<td><pre><a name="line203">203</a> #</pre></td>
|
|
658
|
+
</tr>
|
|
659
|
+
<tr class="marked">
|
|
660
|
+
<td><pre><a name="line204">204</a> def set_feature(str_feature_name)</pre></td>
|
|
661
|
+
</tr>
|
|
662
|
+
<tr class="uncovered">
|
|
663
|
+
<td><pre><a name="line205">205</a> DBI.connect(@str_connection_url, DB_USER_NAME, DB_PASSWORD) do |dbh|</pre></td>
|
|
664
|
+
</tr>
|
|
665
|
+
<tr class="uncovered">
|
|
666
|
+
<td><pre><a name="line206">206</a> str_query = "select TestFeatureID from TestFeature where FeatureName=?"</pre></td>
|
|
667
|
+
</tr>
|
|
668
|
+
<tr class="uncovered">
|
|
669
|
+
<td><pre><a name="line207">207</a> sth = dbh.prepare(str_query)</pre></td>
|
|
670
|
+
</tr>
|
|
671
|
+
<tr class="uncovered">
|
|
672
|
+
<td><pre><a name="line208">208</a> sth.execute(str_feature_name)</pre></td>
|
|
673
|
+
</tr>
|
|
674
|
+
<tr class="inferred">
|
|
675
|
+
<td><pre><a name="line209">209</a> </pre></td>
|
|
676
|
+
</tr>
|
|
677
|
+
<tr class="uncovered">
|
|
678
|
+
<td><pre><a name="line210">210</a> if sth.fetch.nil? # insert only if the data is not present in the table</pre></td>
|
|
679
|
+
</tr>
|
|
680
|
+
<tr class="uncovered">
|
|
681
|
+
<td><pre><a name="line211">211</a> sth = dbh.prepare("insert into TestFeature(FeatureName) values (?)")</pre></td>
|
|
682
|
+
</tr>
|
|
683
|
+
<tr class="uncovered">
|
|
684
|
+
<td><pre><a name="line212">212</a> sth.execute(str_feature_name)</pre></td>
|
|
685
|
+
</tr>
|
|
686
|
+
<tr class="uncovered">
|
|
687
|
+
<td><pre><a name="line213">213</a> dbh.commit</pre></td>
|
|
688
|
+
</tr>
|
|
689
|
+
<tr class="inferred">
|
|
690
|
+
<td><pre><a name="line214">214</a> #puts "Added a record to TestFeature table successfully"</pre></td>
|
|
691
|
+
</tr>
|
|
692
|
+
<tr class="inferred">
|
|
693
|
+
<td><pre><a name="line215">215</a> end</pre></td>
|
|
694
|
+
</tr>
|
|
695
|
+
<tr class="uncovered">
|
|
696
|
+
<td><pre><a name="line216">216</a> str_query = "select TestFeatureID from TestFeature where FeatureName='#{str_feature_name}'"</pre></td>
|
|
697
|
+
</tr>
|
|
698
|
+
<tr class="uncovered">
|
|
699
|
+
<td><pre><a name="line217">217</a> sth = dbh.prepare(str_query)</pre></td>
|
|
700
|
+
</tr>
|
|
701
|
+
<tr class="uncovered">
|
|
702
|
+
<td><pre><a name="line218">218</a> sth.execute()</pre></td>
|
|
703
|
+
</tr>
|
|
704
|
+
<tr class="uncovered">
|
|
705
|
+
<td><pre><a name="line219">219</a> num_feature_id = sth.fetch[0]</pre></td>
|
|
706
|
+
</tr>
|
|
707
|
+
<tr class="inferred">
|
|
708
|
+
<td><pre><a name="line220">220</a> #puts "********** Record found with Primary key '#{num_feature_id}' in TestFeature *************"</pre></td>
|
|
709
|
+
</tr>
|
|
710
|
+
<tr class="uncovered">
|
|
711
|
+
<td><pre><a name="line221">221</a> dbh.disconnect()</pre></td>
|
|
712
|
+
</tr>
|
|
713
|
+
<tr class="uncovered">
|
|
714
|
+
<td><pre><a name="line222">222</a> num_feature_result_id = set_feature_result(num_feature_id)</pre></td>
|
|
715
|
+
</tr>
|
|
716
|
+
<tr class="uncovered">
|
|
717
|
+
<td><pre><a name="line223">223</a> return num_feature_id, num_feature_result_id # return the feature id and feature result id of the feature</pre></td>
|
|
718
|
+
</tr>
|
|
719
|
+
<tr class="inferred">
|
|
720
|
+
<td><pre><a name="line224">224</a> end</pre></td>
|
|
721
|
+
</tr>
|
|
722
|
+
<tr class="inferred">
|
|
723
|
+
<td><pre><a name="line225">225</a> rescue Exception => ex</pre></td>
|
|
724
|
+
</tr>
|
|
725
|
+
<tr class="uncovered">
|
|
726
|
+
<td><pre><a name="line226">226</a> $log.error("Error in setting feature data to TestFeature table : #{ex}")</pre></td>
|
|
727
|
+
</tr>
|
|
728
|
+
<tr class="uncovered">
|
|
729
|
+
<td><pre><a name="line227">227</a> exit</pre></td>
|
|
730
|
+
</tr>
|
|
731
|
+
<tr class="inferred">
|
|
732
|
+
<td><pre><a name="line228">228</a> end</pre></td>
|
|
733
|
+
</tr>
|
|
734
|
+
<tr class="inferred">
|
|
735
|
+
<td><pre><a name="line229">229</a> </pre></td>
|
|
736
|
+
</tr>
|
|
737
|
+
<tr class="inferred">
|
|
738
|
+
<td><pre><a name="line230">230</a> # Description : sets the feature result data with default details into Sybase</pre></td>
|
|
739
|
+
</tr>
|
|
740
|
+
<tr class="inferred">
|
|
741
|
+
<td><pre><a name="line231">231</a> # Author : Chandra sekaran</pre></td>
|
|
742
|
+
</tr>
|
|
743
|
+
<tr class="inferred">
|
|
744
|
+
<td><pre><a name="line232">232</a> # Arguments :</pre></td>
|
|
745
|
+
</tr>
|
|
746
|
+
<tr class="inferred">
|
|
747
|
+
<td><pre><a name="line233">233</a> # str_feature_name : feature_id of the feature</pre></td>
|
|
748
|
+
</tr>
|
|
749
|
+
<tr class="inferred">
|
|
750
|
+
<td><pre><a name="line234">234</a> # Return Arguments :</pre></td>
|
|
751
|
+
</tr>
|
|
752
|
+
<tr class="inferred">
|
|
753
|
+
<td><pre><a name="line235">235</a> # num_feature_result_id : primary key of the feature result</pre></td>
|
|
754
|
+
</tr>
|
|
755
|
+
<tr class="inferred">
|
|
756
|
+
<td><pre><a name="line236">236</a> #</pre></td>
|
|
757
|
+
</tr>
|
|
758
|
+
<tr class="marked">
|
|
759
|
+
<td><pre><a name="line237">237</a> def set_feature_result(num_feature_id)</pre></td>
|
|
760
|
+
</tr>
|
|
761
|
+
<tr class="uncovered">
|
|
762
|
+
<td><pre><a name="line238">238</a> DBI.connect(@str_connection_url, DB_USER_NAME, DB_PASSWORD) do |dbh|</pre></td>
|
|
763
|
+
</tr>
|
|
764
|
+
<tr class="uncovered">
|
|
765
|
+
<td><pre><a name="line239">239</a> str_query = "select TestFeatureResultID from TestFeatureResult where TestFeatureID=? and BuildID=?"</pre></td>
|
|
766
|
+
</tr>
|
|
767
|
+
<tr class="uncovered">
|
|
768
|
+
<td><pre><a name="line240">240</a> sth = dbh.prepare(str_query)</pre></td>
|
|
769
|
+
</tr>
|
|
770
|
+
<tr class="uncovered">
|
|
771
|
+
<td><pre><a name="line241">241</a> sth.execute(num_feature_id, @build_id)</pre></td>
|
|
772
|
+
</tr>
|
|
773
|
+
<tr class="inferred">
|
|
774
|
+
<td><pre><a name="line242">242</a> </pre></td>
|
|
775
|
+
</tr>
|
|
776
|
+
<tr class="uncovered">
|
|
777
|
+
<td><pre><a name="line243">243</a> if sth.fetch.nil? # insert only if the data is not present in the table</pre></td>
|
|
778
|
+
</tr>
|
|
779
|
+
<tr class="uncovered">
|
|
780
|
+
<td><pre><a name="line244">244</a> sth = dbh.prepare("insert into TestFeatureResult(TestFeatureID,BuildID) values (?,?)")</pre></td>
|
|
781
|
+
</tr>
|
|
782
|
+
<tr class="uncovered">
|
|
783
|
+
<td><pre><a name="line245">245</a> sth.execute(num_feature_id, @build_id)</pre></td>
|
|
784
|
+
</tr>
|
|
785
|
+
<tr class="uncovered">
|
|
786
|
+
<td><pre><a name="line246">246</a> dbh.commit</pre></td>
|
|
787
|
+
</tr>
|
|
788
|
+
<tr class="inferred">
|
|
789
|
+
<td><pre><a name="line247">247</a> #puts "Added a record to TestFeatureResult table successfully"</pre></td>
|
|
790
|
+
</tr>
|
|
791
|
+
<tr class="inferred">
|
|
792
|
+
<td><pre><a name="line248">248</a> end</pre></td>
|
|
793
|
+
</tr>
|
|
794
|
+
<tr class="inferred">
|
|
795
|
+
<td><pre><a name="line249">249</a> </pre></td>
|
|
796
|
+
</tr>
|
|
797
|
+
<tr class="uncovered">
|
|
798
|
+
<td><pre><a name="line250">250</a> str_query = "select TestFeatureResultID from TestFeatureResult where TestFeatureID=#{num_feature_id} and BuildID=#{@build_id}"</pre></td>
|
|
799
|
+
</tr>
|
|
800
|
+
<tr class="uncovered">
|
|
801
|
+
<td><pre><a name="line251">251</a> sth = dbh.prepare(str_query)</pre></td>
|
|
802
|
+
</tr>
|
|
803
|
+
<tr class="uncovered">
|
|
804
|
+
<td><pre><a name="line252">252</a> sth.execute()</pre></td>
|
|
805
|
+
</tr>
|
|
806
|
+
<tr class="uncovered">
|
|
807
|
+
<td><pre><a name="line253">253</a> num_feature_result_id = sth.fetch[0]</pre></td>
|
|
808
|
+
</tr>
|
|
809
|
+
<tr class="inferred">
|
|
810
|
+
<td><pre><a name="line254">254</a> #puts "********** Record found with Primary key '#{num_feature_result_id}' in TestFeatureResult *************"</pre></td>
|
|
811
|
+
</tr>
|
|
812
|
+
<tr class="uncovered">
|
|
813
|
+
<td><pre><a name="line255">255</a> dbh.disconnect()</pre></td>
|
|
814
|
+
</tr>
|
|
815
|
+
<tr class="uncovered">
|
|
816
|
+
<td><pre><a name="line256">256</a> return num_feature_result_id # return the feature result id of the feature</pre></td>
|
|
817
|
+
</tr>
|
|
818
|
+
<tr class="inferred">
|
|
819
|
+
<td><pre><a name="line257">257</a> end</pre></td>
|
|
820
|
+
</tr>
|
|
821
|
+
<tr class="inferred">
|
|
822
|
+
<td><pre><a name="line258">258</a> rescue Exception => ex</pre></td>
|
|
823
|
+
</tr>
|
|
824
|
+
<tr class="uncovered">
|
|
825
|
+
<td><pre><a name="line259">259</a> $log.error("Error in setting feature result data to TestFeatureResult table : #{ex}")</pre></td>
|
|
826
|
+
</tr>
|
|
827
|
+
<tr class="uncovered">
|
|
828
|
+
<td><pre><a name="line260">260</a> exit</pre></td>
|
|
829
|
+
</tr>
|
|
830
|
+
<tr class="inferred">
|
|
831
|
+
<td><pre><a name="line261">261</a> end</pre></td>
|
|
832
|
+
</tr>
|
|
833
|
+
<tr class="inferred">
|
|
834
|
+
<td><pre><a name="line262">262</a> </pre></td>
|
|
835
|
+
</tr>
|
|
836
|
+
<tr class="inferred">
|
|
837
|
+
<td><pre><a name="line263">263</a> # Description : resets the feature result data with execution details into Sybase</pre></td>
|
|
838
|
+
</tr>
|
|
839
|
+
<tr class="inferred">
|
|
840
|
+
<td><pre><a name="line264">264</a> # Author : Chandra sekaran</pre></td>
|
|
841
|
+
</tr>
|
|
842
|
+
<tr class="inferred">
|
|
843
|
+
<td><pre><a name="line265">265</a> # Arguments :</pre></td>
|
|
844
|
+
</tr>
|
|
845
|
+
<tr class="inferred">
|
|
846
|
+
<td><pre><a name="line266">266</a> # num_run_length : feature execution time in nanoseconds</pre></td>
|
|
847
|
+
</tr>
|
|
848
|
+
<tr class="inferred">
|
|
849
|
+
<td><pre><a name="line267">267</a> # num_pass_count : number of scenarios passed</pre></td>
|
|
850
|
+
</tr>
|
|
851
|
+
<tr class="inferred">
|
|
852
|
+
<td><pre><a name="line268">268</a> # num_fail_count : number of scenarios failed</pre></td>
|
|
853
|
+
</tr>
|
|
854
|
+
<tr class="inferred">
|
|
855
|
+
<td><pre><a name="line269">269</a> # num_skip_count : number of scenarios skipped</pre></td>
|
|
856
|
+
</tr>
|
|
857
|
+
<tr class="inferred">
|
|
858
|
+
<td><pre><a name="line270">270</a> # bool_result : boolean value resembling the state of build result</pre></td>
|
|
859
|
+
</tr>
|
|
860
|
+
<tr class="inferred">
|
|
861
|
+
<td><pre><a name="line271">271</a> # num_feature_result_id : primary key of the TestFeatureResult table</pre></td>
|
|
862
|
+
</tr>
|
|
863
|
+
<tr class="inferred">
|
|
864
|
+
<td><pre><a name="line272">272</a> #</pre></td>
|
|
865
|
+
</tr>
|
|
866
|
+
<tr class="marked">
|
|
867
|
+
<td><pre><a name="line273">273</a> def reset_feature_result(num_run_length, num_pass_count, num_fail_count, num_skip_count, bool_result, num_feature_result_id)</pre></td>
|
|
868
|
+
</tr>
|
|
869
|
+
<tr class="uncovered">
|
|
870
|
+
<td><pre><a name="line274">274</a> num_result = bool_result ? 1 : 0</pre></td>
|
|
871
|
+
</tr>
|
|
872
|
+
<tr class="uncovered">
|
|
873
|
+
<td><pre><a name="line275">275</a> DBI.connect(@str_connection_url, DB_USER_NAME, DB_PASSWORD) do |dbh|</pre></td>
|
|
874
|
+
</tr>
|
|
875
|
+
<tr class="uncovered">
|
|
876
|
+
<td><pre><a name="line276">276</a> sth = dbh.prepare("update TestFeatureResult set RunLength=?, Passes=?, Failures=?, Skips=?, Result=? where TestFeatureResultID=?")</pre></td>
|
|
877
|
+
</tr>
|
|
878
|
+
<tr class="uncovered">
|
|
879
|
+
<td><pre><a name="line277">277</a> sth.execute(convert_duration(num_run_length), num_pass_count, num_fail_count, num_skip_count, num_result, num_feature_result_id)</pre></td>
|
|
880
|
+
</tr>
|
|
881
|
+
<tr class="uncovered">
|
|
882
|
+
<td><pre><a name="line278">278</a> sth.finish</pre></td>
|
|
883
|
+
</tr>
|
|
884
|
+
<tr class="uncovered">
|
|
885
|
+
<td><pre><a name="line279">279</a> dbh.commit</pre></td>
|
|
886
|
+
</tr>
|
|
887
|
+
<tr class="inferred">
|
|
888
|
+
<td><pre><a name="line280">280</a> #puts "Updated a record (#{num_feature_result_id}) in TestFeatureResult table successfully"</pre></td>
|
|
889
|
+
</tr>
|
|
890
|
+
<tr class="uncovered">
|
|
891
|
+
<td><pre><a name="line281">281</a> dbh.disconnect()</pre></td>
|
|
892
|
+
</tr>
|
|
893
|
+
<tr class="inferred">
|
|
894
|
+
<td><pre><a name="line282">282</a> end</pre></td>
|
|
895
|
+
</tr>
|
|
896
|
+
<tr class="inferred">
|
|
897
|
+
<td><pre><a name="line283">283</a> rescue Exception => ex</pre></td>
|
|
898
|
+
</tr>
|
|
899
|
+
<tr class="uncovered">
|
|
900
|
+
<td><pre><a name="line284">284</a> $log.error("Error in resetting feature result data to TestFeatureResult table : #{ex}")</pre></td>
|
|
901
|
+
</tr>
|
|
902
|
+
<tr class="uncovered">
|
|
903
|
+
<td><pre><a name="line285">285</a> exit</pre></td>
|
|
904
|
+
</tr>
|
|
905
|
+
<tr class="inferred">
|
|
906
|
+
<td><pre><a name="line286">286</a> end</pre></td>
|
|
907
|
+
</tr>
|
|
908
|
+
<tr class="inferred">
|
|
909
|
+
<td><pre><a name="line287">287</a> </pre></td>
|
|
910
|
+
</tr>
|
|
911
|
+
<tr class="inferred">
|
|
912
|
+
<td><pre><a name="line288">288</a> # Description : sets the scenario data with default details into Sybase</pre></td>
|
|
913
|
+
</tr>
|
|
914
|
+
<tr class="inferred">
|
|
915
|
+
<td><pre><a name="line289">289</a> # Author : Chandra sekaran</pre></td>
|
|
916
|
+
</tr>
|
|
917
|
+
<tr class="inferred">
|
|
918
|
+
<td><pre><a name="line290">290</a> # Arguments :</pre></td>
|
|
919
|
+
</tr>
|
|
920
|
+
<tr class="inferred">
|
|
921
|
+
<td><pre><a name="line291">291</a> # str_scenario_name : scenario name</pre></td>
|
|
922
|
+
</tr>
|
|
923
|
+
<tr class="inferred">
|
|
924
|
+
<td><pre><a name="line292">292</a> # str_qa_complete_id : QA Complete ID (Scenario ID) of the scenario</pre></td>
|
|
925
|
+
</tr>
|
|
926
|
+
<tr class="inferred">
|
|
927
|
+
<td><pre><a name="line293">293</a> # str_feature_id : primary key of the feature</pre></td>
|
|
928
|
+
</tr>
|
|
929
|
+
<tr class="inferred">
|
|
930
|
+
<td><pre><a name="line294">294</a> # Return Arguments :</pre></td>
|
|
931
|
+
</tr>
|
|
932
|
+
<tr class="inferred">
|
|
933
|
+
<td><pre><a name="line295">295</a> # num_scenario_id : primary key of the scenario</pre></td>
|
|
934
|
+
</tr>
|
|
935
|
+
<tr class="inferred">
|
|
936
|
+
<td><pre><a name="line296">296</a> # scenario_result_id : primary key of the scenario result</pre></td>
|
|
937
|
+
</tr>
|
|
938
|
+
<tr class="inferred">
|
|
939
|
+
<td><pre><a name="line297">297</a> #</pre></td>
|
|
940
|
+
</tr>
|
|
941
|
+
<tr class="marked">
|
|
942
|
+
<td><pre><a name="line298">298</a> def set_scenario(str_scenario_name, str_qa_complete_id, str_feature_id)</pre></td>
|
|
943
|
+
</tr>
|
|
944
|
+
<tr class="uncovered">
|
|
945
|
+
<td><pre><a name="line299">299</a> DBI.connect(@str_connection_url, DB_USER_NAME, DB_PASSWORD) do |dbh|</pre></td>
|
|
946
|
+
</tr>
|
|
947
|
+
<tr class="uncovered">
|
|
948
|
+
<td><pre><a name="line300">300</a> str_query = "select TestScenarioID from TestScenario where ScenarioName=? and TestFeatureID=?"</pre></td>
|
|
949
|
+
</tr>
|
|
950
|
+
<tr class="uncovered">
|
|
951
|
+
<td><pre><a name="line301">301</a> sth = dbh.prepare(str_query)</pre></td>
|
|
952
|
+
</tr>
|
|
953
|
+
<tr class="uncovered">
|
|
954
|
+
<td><pre><a name="line302">302</a> sth.execute(str_scenario_name, str_feature_id.to_i)</pre></td>
|
|
955
|
+
</tr>
|
|
956
|
+
<tr class="inferred">
|
|
957
|
+
<td><pre><a name="line303">303</a> </pre></td>
|
|
958
|
+
</tr>
|
|
959
|
+
<tr class="uncovered">
|
|
960
|
+
<td><pre><a name="line304">304</a> if sth.fetch.nil? # insert only if the data is not present in the table</pre></td>
|
|
961
|
+
</tr>
|
|
962
|
+
<tr class="uncovered">
|
|
963
|
+
<td><pre><a name="line305">305</a> sth = dbh.prepare("insert into TestScenario(ScenarioName,QACompleteID,TestFeatureID) values (?,?,?)")</pre></td>
|
|
964
|
+
</tr>
|
|
965
|
+
<tr class="uncovered">
|
|
966
|
+
<td><pre><a name="line306">306</a> sth.execute(str_scenario_name, str_qa_complete_id, str_feature_id.to_i)</pre></td>
|
|
967
|
+
</tr>
|
|
968
|
+
<tr class="uncovered">
|
|
969
|
+
<td><pre><a name="line307">307</a> sth.finish</pre></td>
|
|
970
|
+
</tr>
|
|
971
|
+
<tr class="uncovered">
|
|
972
|
+
<td><pre><a name="line308">308</a> dbh.commit</pre></td>
|
|
973
|
+
</tr>
|
|
974
|
+
<tr class="inferred">
|
|
975
|
+
<td><pre><a name="line309">309</a> #puts "Added a record to TestScenario table successfully"</pre></td>
|
|
976
|
+
</tr>
|
|
977
|
+
<tr class="inferred">
|
|
978
|
+
<td><pre><a name="line310">310</a> end</pre></td>
|
|
979
|
+
</tr>
|
|
980
|
+
<tr class="inferred">
|
|
981
|
+
<td><pre><a name="line311">311</a> </pre></td>
|
|
982
|
+
</tr>
|
|
983
|
+
<tr class="uncovered">
|
|
984
|
+
<td><pre><a name="line312">312</a> str_query = "select TestScenarioID from TestScenario where ScenarioName='#{str_scenario_name}' and TestFeatureID=#{str_feature_id}"</pre></td>
|
|
985
|
+
</tr>
|
|
986
|
+
<tr class="uncovered">
|
|
987
|
+
<td><pre><a name="line313">313</a> sth = dbh.prepare(str_query)</pre></td>
|
|
988
|
+
</tr>
|
|
989
|
+
<tr class="uncovered">
|
|
990
|
+
<td><pre><a name="line314">314</a> sth.execute()</pre></td>
|
|
991
|
+
</tr>
|
|
992
|
+
<tr class="uncovered">
|
|
993
|
+
<td><pre><a name="line315">315</a> num_scenario_id = sth.fetch[0]</pre></td>
|
|
994
|
+
</tr>
|
|
995
|
+
<tr class="inferred">
|
|
996
|
+
<td><pre><a name="line316">316</a> #puts "********** Record found with Primary key '#{num_scenario_id}' in TestScenario *************"</pre></td>
|
|
997
|
+
</tr>
|
|
998
|
+
<tr class="uncovered">
|
|
999
|
+
<td><pre><a name="line317">317</a> scenario_result_id = set_scenario_result(num_scenario_id, str_feature_id)</pre></td>
|
|
1000
|
+
</tr>
|
|
1001
|
+
<tr class="uncovered">
|
|
1002
|
+
<td><pre><a name="line318">318</a> dbh.disconnect()</pre></td>
|
|
1003
|
+
</tr>
|
|
1004
|
+
<tr class="uncovered">
|
|
1005
|
+
<td><pre><a name="line319">319</a> return num_scenario_id, scenario_result_id # return the scenario id and scenario result id of the scenario</pre></td>
|
|
1006
|
+
</tr>
|
|
1007
|
+
<tr class="inferred">
|
|
1008
|
+
<td><pre><a name="line320">320</a> end</pre></td>
|
|
1009
|
+
</tr>
|
|
1010
|
+
<tr class="inferred">
|
|
1011
|
+
<td><pre><a name="line321">321</a> rescue Exception => ex</pre></td>
|
|
1012
|
+
</tr>
|
|
1013
|
+
<tr class="uncovered">
|
|
1014
|
+
<td><pre><a name="line322">322</a> $log.error("Error in setting scenario data to TestScenario table : #{ex}")</pre></td>
|
|
1015
|
+
</tr>
|
|
1016
|
+
<tr class="uncovered">
|
|
1017
|
+
<td><pre><a name="line323">323</a> exit</pre></td>
|
|
1018
|
+
</tr>
|
|
1019
|
+
<tr class="inferred">
|
|
1020
|
+
<td><pre><a name="line324">324</a> end</pre></td>
|
|
1021
|
+
</tr>
|
|
1022
|
+
<tr class="inferred">
|
|
1023
|
+
<td><pre><a name="line325">325</a> </pre></td>
|
|
1024
|
+
</tr>
|
|
1025
|
+
<tr class="inferred">
|
|
1026
|
+
<td><pre><a name="line326">326</a> # Description : sets the scenario result data with default details into Sybase</pre></td>
|
|
1027
|
+
</tr>
|
|
1028
|
+
<tr class="inferred">
|
|
1029
|
+
<td><pre><a name="line327">327</a> # Author : Chandra sekaran</pre></td>
|
|
1030
|
+
</tr>
|
|
1031
|
+
<tr class="inferred">
|
|
1032
|
+
<td><pre><a name="line328">328</a> # Arguments :</pre></td>
|
|
1033
|
+
</tr>
|
|
1034
|
+
<tr class="inferred">
|
|
1035
|
+
<td><pre><a name="line329">329</a> # num_scenario_id : primary key of the scenario</pre></td>
|
|
1036
|
+
</tr>
|
|
1037
|
+
<tr class="inferred">
|
|
1038
|
+
<td><pre><a name="line330">330</a> # num_feature_id : primary key of the feature</pre></td>
|
|
1039
|
+
</tr>
|
|
1040
|
+
<tr class="inferred">
|
|
1041
|
+
<td><pre><a name="line331">331</a> # Return Arguments :</pre></td>
|
|
1042
|
+
</tr>
|
|
1043
|
+
<tr class="inferred">
|
|
1044
|
+
<td><pre><a name="line332">332</a> # num_scenario_result_id : primary key of the scenario result</pre></td>
|
|
1045
|
+
</tr>
|
|
1046
|
+
<tr class="inferred">
|
|
1047
|
+
<td><pre><a name="line333">333</a> #</pre></td>
|
|
1048
|
+
</tr>
|
|
1049
|
+
<tr class="marked">
|
|
1050
|
+
<td><pre><a name="line334">334</a> def set_scenario_result(num_scenario_id, num_feature_id)</pre></td>
|
|
1051
|
+
</tr>
|
|
1052
|
+
<tr class="uncovered">
|
|
1053
|
+
<td><pre><a name="line335">335</a> DBI.connect(@str_connection_url, DB_USER_NAME, DB_PASSWORD) do |dbh|</pre></td>
|
|
1054
|
+
</tr>
|
|
1055
|
+
<tr class="uncovered">
|
|
1056
|
+
<td><pre><a name="line336">336</a> sth = dbh.prepare("insert into TestScenarioResult(TestFeatureID,TestScenarioID,BuildID) values (?,?,?)")</pre></td>
|
|
1057
|
+
</tr>
|
|
1058
|
+
<tr class="uncovered">
|
|
1059
|
+
<td><pre><a name="line337">337</a> sth.execute(num_feature_id, num_scenario_id, @build_id)</pre></td>
|
|
1060
|
+
</tr>
|
|
1061
|
+
<tr class="uncovered">
|
|
1062
|
+
<td><pre><a name="line338">338</a> sth.finish</pre></td>
|
|
1063
|
+
</tr>
|
|
1064
|
+
<tr class="uncovered">
|
|
1065
|
+
<td><pre><a name="line339">339</a> dbh.commit</pre></td>
|
|
1066
|
+
</tr>
|
|
1067
|
+
<tr class="inferred">
|
|
1068
|
+
<td><pre><a name="line340">340</a> #puts "Added a record to TestScenarioResult table successfully"</pre></td>
|
|
1069
|
+
</tr>
|
|
1070
|
+
<tr class="inferred">
|
|
1071
|
+
<td><pre><a name="line341">341</a> </pre></td>
|
|
1072
|
+
</tr>
|
|
1073
|
+
<tr class="uncovered">
|
|
1074
|
+
<td><pre><a name="line342">342</a> str_query = "select TestScenarioResultID from TestScenarioResult where TestFeatureID=#{num_feature_id} and TestScenarioID=#{num_scenario_id} and BuildID=#{@build_id}"</pre></td>
|
|
1075
|
+
</tr>
|
|
1076
|
+
<tr class="uncovered">
|
|
1077
|
+
<td><pre><a name="line343">343</a> sth = dbh.prepare(str_query)</pre></td>
|
|
1078
|
+
</tr>
|
|
1079
|
+
<tr class="uncovered">
|
|
1080
|
+
<td><pre><a name="line344">344</a> sth.execute()</pre></td>
|
|
1081
|
+
</tr>
|
|
1082
|
+
<tr class="uncovered">
|
|
1083
|
+
<td><pre><a name="line345">345</a> num_scenario_result_id = sth.fetch[0]</pre></td>
|
|
1084
|
+
</tr>
|
|
1085
|
+
<tr class="inferred">
|
|
1086
|
+
<td><pre><a name="line346">346</a> #puts "********** Record found with Primary key '#{num_scenario_result_id}' in TestScenarioResult *************"</pre></td>
|
|
1087
|
+
</tr>
|
|
1088
|
+
<tr class="uncovered">
|
|
1089
|
+
<td><pre><a name="line347">347</a> dbh.disconnect()</pre></td>
|
|
1090
|
+
</tr>
|
|
1091
|
+
<tr class="uncovered">
|
|
1092
|
+
<td><pre><a name="line348">348</a> return num_scenario_result_id # return the scenario id of the scenario</pre></td>
|
|
1093
|
+
</tr>
|
|
1094
|
+
<tr class="inferred">
|
|
1095
|
+
<td><pre><a name="line349">349</a> end</pre></td>
|
|
1096
|
+
</tr>
|
|
1097
|
+
<tr class="inferred">
|
|
1098
|
+
<td><pre><a name="line350">350</a> rescue Exception => ex</pre></td>
|
|
1099
|
+
</tr>
|
|
1100
|
+
<tr class="uncovered">
|
|
1101
|
+
<td><pre><a name="line351">351</a> $log.error("Error in setting scenario data to TestScenarioResult table : #{ex}")</pre></td>
|
|
1102
|
+
</tr>
|
|
1103
|
+
<tr class="uncovered">
|
|
1104
|
+
<td><pre><a name="line352">352</a> exit</pre></td>
|
|
1105
|
+
</tr>
|
|
1106
|
+
<tr class="inferred">
|
|
1107
|
+
<td><pre><a name="line353">353</a> end</pre></td>
|
|
1108
|
+
</tr>
|
|
1109
|
+
<tr class="inferred">
|
|
1110
|
+
<td><pre><a name="line354">354</a> </pre></td>
|
|
1111
|
+
</tr>
|
|
1112
|
+
<tr class="inferred">
|
|
1113
|
+
<td><pre><a name="line355">355</a> # Description : resets the scenario result data with execution details into Sybase</pre></td>
|
|
1114
|
+
</tr>
|
|
1115
|
+
<tr class="inferred">
|
|
1116
|
+
<td><pre><a name="line356">356</a> # Author : Chandra sekaran</pre></td>
|
|
1117
|
+
</tr>
|
|
1118
|
+
<tr class="inferred">
|
|
1119
|
+
<td><pre><a name="line357">357</a> # Arguments :</pre></td>
|
|
1120
|
+
</tr>
|
|
1121
|
+
<tr class="inferred">
|
|
1122
|
+
<td><pre><a name="line358">358</a> # num_scenario_result_id : primary key of the scenario result</pre></td>
|
|
1123
|
+
</tr>
|
|
1124
|
+
<tr class="inferred">
|
|
1125
|
+
<td><pre><a name="line359">359</a> # num_run_length : steps execution time in nanoseconds</pre></td>
|
|
1126
|
+
</tr>
|
|
1127
|
+
<tr class="inferred">
|
|
1128
|
+
<td><pre><a name="line360">360</a> # num_pass_count : number of steps passed</pre></td>
|
|
1129
|
+
</tr>
|
|
1130
|
+
<tr class="inferred">
|
|
1131
|
+
<td><pre><a name="line361">361</a> # num_fail_count : number of steps failed</pre></td>
|
|
1132
|
+
</tr>
|
|
1133
|
+
<tr class="inferred">
|
|
1134
|
+
<td><pre><a name="line362">362</a> # num_skip_count : number of steps skipped</pre></td>
|
|
1135
|
+
</tr>
|
|
1136
|
+
<tr class="inferred">
|
|
1137
|
+
<td><pre><a name="line363">363</a> # bool_result : boolean value resembling the state of steps result</pre></td>
|
|
1138
|
+
</tr>
|
|
1139
|
+
<tr class="inferred">
|
|
1140
|
+
<td><pre><a name="line364">364</a> #</pre></td>
|
|
1141
|
+
</tr>
|
|
1142
|
+
<tr class="marked">
|
|
1143
|
+
<td><pre><a name="line365">365</a> def reset_scenario_result(num_scenario_result_id, num_run_length, num_pass_count, num_fail_count, num_skip_count, bool_result)</pre></td>
|
|
1144
|
+
</tr>
|
|
1145
|
+
<tr class="uncovered">
|
|
1146
|
+
<td><pre><a name="line366">366</a> num_result = bool_result ? 1 : 0</pre></td>
|
|
1147
|
+
</tr>
|
|
1148
|
+
<tr class="uncovered">
|
|
1149
|
+
<td><pre><a name="line367">367</a> DBI.connect(@str_connection_url, DB_USER_NAME, DB_PASSWORD) do |dbh|</pre></td>
|
|
1150
|
+
</tr>
|
|
1151
|
+
<tr class="uncovered">
|
|
1152
|
+
<td><pre><a name="line368">368</a> sth = dbh.prepare("update TestScenarioResult set RunLength=?, Passes=?, Failures=?, Skips=?, Result=? where TestScenarioResultID=?")</pre></td>
|
|
1153
|
+
</tr>
|
|
1154
|
+
<tr class="uncovered">
|
|
1155
|
+
<td><pre><a name="line369">369</a> sth.execute(convert_duration(num_run_length), num_pass_count, num_fail_count, num_skip_count, num_result, num_scenario_result_id)</pre></td>
|
|
1156
|
+
</tr>
|
|
1157
|
+
<tr class="uncovered">
|
|
1158
|
+
<td><pre><a name="line370">370</a> sth.finish</pre></td>
|
|
1159
|
+
</tr>
|
|
1160
|
+
<tr class="uncovered">
|
|
1161
|
+
<td><pre><a name="line371">371</a> dbh.commit</pre></td>
|
|
1162
|
+
</tr>
|
|
1163
|
+
<tr class="inferred">
|
|
1164
|
+
<td><pre><a name="line372">372</a> #puts "Updated a record (#{num_scenario_result_id}) in TestScenarioResult table successfully"</pre></td>
|
|
1165
|
+
</tr>
|
|
1166
|
+
<tr class="uncovered">
|
|
1167
|
+
<td><pre><a name="line373">373</a> dbh.disconnect()</pre></td>
|
|
1168
|
+
</tr>
|
|
1169
|
+
<tr class="inferred">
|
|
1170
|
+
<td><pre><a name="line374">374</a> end</pre></td>
|
|
1171
|
+
</tr>
|
|
1172
|
+
<tr class="inferred">
|
|
1173
|
+
<td><pre><a name="line375">375</a> rescue Exception => ex</pre></td>
|
|
1174
|
+
</tr>
|
|
1175
|
+
<tr class="uncovered">
|
|
1176
|
+
<td><pre><a name="line376">376</a> $log.error("Error in resetting scenario data to TestScenarioResult table : #{ex}")</pre></td>
|
|
1177
|
+
</tr>
|
|
1178
|
+
<tr class="uncovered">
|
|
1179
|
+
<td><pre><a name="line377">377</a> exit</pre></td>
|
|
1180
|
+
</tr>
|
|
1181
|
+
<tr class="inferred">
|
|
1182
|
+
<td><pre><a name="line378">378</a> end</pre></td>
|
|
1183
|
+
</tr>
|
|
1184
|
+
<tr class="inferred">
|
|
1185
|
+
<td><pre><a name="line379">379</a> </pre></td>
|
|
1186
|
+
</tr>
|
|
1187
|
+
<tr class="inferred">
|
|
1188
|
+
<td><pre><a name="line380">380</a> # Description : sets the step data with default details into Sybase</pre></td>
|
|
1189
|
+
</tr>
|
|
1190
|
+
<tr class="inferred">
|
|
1191
|
+
<td><pre><a name="line381">381</a> # Author : Chandra sekaran</pre></td>
|
|
1192
|
+
</tr>
|
|
1193
|
+
<tr class="inferred">
|
|
1194
|
+
<td><pre><a name="line382">382</a> # Arguments :</pre></td>
|
|
1195
|
+
</tr>
|
|
1196
|
+
<tr class="inferred">
|
|
1197
|
+
<td><pre><a name="line383">383</a> # str_step_name : step name</pre></td>
|
|
1198
|
+
</tr>
|
|
1199
|
+
<tr class="inferred">
|
|
1200
|
+
<td><pre><a name="line384">384</a> # str_scenario_id : primary key of scenario</pre></td>
|
|
1201
|
+
</tr>
|
|
1202
|
+
<tr class="inferred">
|
|
1203
|
+
<td><pre><a name="line385">385</a> # num_scenario_result_id : primary key of scenario result</pre></td>
|
|
1204
|
+
</tr>
|
|
1205
|
+
<tr class="inferred">
|
|
1206
|
+
<td><pre><a name="line386">386</a> # Return Arguments :</pre></td>
|
|
1207
|
+
</tr>
|
|
1208
|
+
<tr class="inferred">
|
|
1209
|
+
<td><pre><a name="line387">387</a> # num_step_id : primary key of step</pre></td>
|
|
1210
|
+
</tr>
|
|
1211
|
+
<tr class="inferred">
|
|
1212
|
+
<td><pre><a name="line388">388</a> # num_step_result_id : primary key of step result</pre></td>
|
|
1213
|
+
</tr>
|
|
1214
|
+
<tr class="inferred">
|
|
1215
|
+
<td><pre><a name="line389">389</a> #</pre></td>
|
|
1216
|
+
</tr>
|
|
1217
|
+
<tr class="marked">
|
|
1218
|
+
<td><pre><a name="line390">390</a> def set_step(str_step_name, str_scenario_id, num_scenario_result_id)</pre></td>
|
|
1219
|
+
</tr>
|
|
1220
|
+
<tr class="uncovered">
|
|
1221
|
+
<td><pre><a name="line391">391</a> DBI.connect(@str_connection_url, DB_USER_NAME, DB_PASSWORD) do |dbh|</pre></td>
|
|
1222
|
+
</tr>
|
|
1223
|
+
<tr class="uncovered">
|
|
1224
|
+
<td><pre><a name="line392">392</a> str_query = "select TestStepID from TestStep where StepName=? and TestScenarioID=?"</pre></td>
|
|
1225
|
+
</tr>
|
|
1226
|
+
<tr class="uncovered">
|
|
1227
|
+
<td><pre><a name="line393">393</a> sth = dbh.prepare(str_query)</pre></td>
|
|
1228
|
+
</tr>
|
|
1229
|
+
<tr class="uncovered">
|
|
1230
|
+
<td><pre><a name="line394">394</a> sth.execute(str_step_name, str_scenario_id)</pre></td>
|
|
1231
|
+
</tr>
|
|
1232
|
+
<tr class="inferred">
|
|
1233
|
+
<td><pre><a name="line395">395</a> </pre></td>
|
|
1234
|
+
</tr>
|
|
1235
|
+
<tr class="uncovered">
|
|
1236
|
+
<td><pre><a name="line396">396</a> if sth.fetch.nil? # insert only if the data is not present in the table</pre></td>
|
|
1237
|
+
</tr>
|
|
1238
|
+
<tr class="uncovered">
|
|
1239
|
+
<td><pre><a name="line397">397</a> sth = dbh.prepare("insert into TestStep(StepName,TestScenarioID) values (?,?)")</pre></td>
|
|
1240
|
+
</tr>
|
|
1241
|
+
<tr class="uncovered">
|
|
1242
|
+
<td><pre><a name="line398">398</a> sth.execute(str_step_name, str_scenario_id)</pre></td>
|
|
1243
|
+
</tr>
|
|
1244
|
+
<tr class="uncovered">
|
|
1245
|
+
<td><pre><a name="line399">399</a> dbh.commit</pre></td>
|
|
1246
|
+
</tr>
|
|
1247
|
+
<tr class="inferred">
|
|
1248
|
+
<td><pre><a name="line400">400</a> #puts "Added a record to TestStep table successfully"</pre></td>
|
|
1249
|
+
</tr>
|
|
1250
|
+
<tr class="inferred">
|
|
1251
|
+
<td><pre><a name="line401">401</a> end</pre></td>
|
|
1252
|
+
</tr>
|
|
1253
|
+
<tr class="inferred">
|
|
1254
|
+
<td><pre><a name="line402">402</a> </pre></td>
|
|
1255
|
+
</tr>
|
|
1256
|
+
<tr class="uncovered">
|
|
1257
|
+
<td><pre><a name="line403">403</a> str_query = "select TestStepID from TestStep where StepName='#{str_step_name}' and TestScenarioID=#{str_scenario_id}"</pre></td>
|
|
1258
|
+
</tr>
|
|
1259
|
+
<tr class="uncovered">
|
|
1260
|
+
<td><pre><a name="line404">404</a> sth = dbh.prepare(str_query)</pre></td>
|
|
1261
|
+
</tr>
|
|
1262
|
+
<tr class="uncovered">
|
|
1263
|
+
<td><pre><a name="line405">405</a> sth.execute()</pre></td>
|
|
1264
|
+
</tr>
|
|
1265
|
+
<tr class="uncovered">
|
|
1266
|
+
<td><pre><a name="line406">406</a> num_step_id = sth.fetch[0]</pre></td>
|
|
1267
|
+
</tr>
|
|
1268
|
+
<tr class="inferred">
|
|
1269
|
+
<td><pre><a name="line407">407</a> #puts "********** Record found with Primary key '#{num_step_id}' in TestStep *************"</pre></td>
|
|
1270
|
+
</tr>
|
|
1271
|
+
<tr class="uncovered">
|
|
1272
|
+
<td><pre><a name="line408">408</a> dbh.disconnect()</pre></td>
|
|
1273
|
+
</tr>
|
|
1274
|
+
<tr class="uncovered">
|
|
1275
|
+
<td><pre><a name="line409">409</a> return num_step_id</pre></td>
|
|
1276
|
+
</tr>
|
|
1277
|
+
<tr class="inferred">
|
|
1278
|
+
<td><pre><a name="line410">410</a> end</pre></td>
|
|
1279
|
+
</tr>
|
|
1280
|
+
<tr class="inferred">
|
|
1281
|
+
<td><pre><a name="line411">411</a> rescue Exception => ex</pre></td>
|
|
1282
|
+
</tr>
|
|
1283
|
+
<tr class="uncovered">
|
|
1284
|
+
<td><pre><a name="line412">412</a> $log.error("Error in setting step data to TestStep table : #{ex}")</pre></td>
|
|
1285
|
+
</tr>
|
|
1286
|
+
<tr class="uncovered">
|
|
1287
|
+
<td><pre><a name="line413">413</a> exit</pre></td>
|
|
1288
|
+
</tr>
|
|
1289
|
+
<tr class="inferred">
|
|
1290
|
+
<td><pre><a name="line414">414</a> end</pre></td>
|
|
1291
|
+
</tr>
|
|
1292
|
+
<tr class="inferred">
|
|
1293
|
+
<td><pre><a name="line415">415</a> </pre></td>
|
|
1294
|
+
</tr>
|
|
1295
|
+
<tr class="inferred">
|
|
1296
|
+
<td><pre><a name="line416">416</a> # Description : sets the step result data with execution details into Sybase</pre></td>
|
|
1297
|
+
</tr>
|
|
1298
|
+
<tr class="inferred">
|
|
1299
|
+
<td><pre><a name="line417">417</a> # Author : Chandra sekaran</pre></td>
|
|
1300
|
+
</tr>
|
|
1301
|
+
<tr class="inferred">
|
|
1302
|
+
<td><pre><a name="line418">418</a> # Arguments :</pre></td>
|
|
1303
|
+
</tr>
|
|
1304
|
+
<tr class="inferred">
|
|
1305
|
+
<td><pre><a name="line419">419</a> # num_step_id : primary key of step</pre></td>
|
|
1306
|
+
</tr>
|
|
1307
|
+
<tr class="inferred">
|
|
1308
|
+
<td><pre><a name="line420">420</a> # num_scenario_id : primary key of scenario</pre></td>
|
|
1309
|
+
</tr>
|
|
1310
|
+
<tr class="inferred">
|
|
1311
|
+
<td><pre><a name="line421">421</a> # num_scenario_result_id : primary key of scenario result</pre></td>
|
|
1312
|
+
</tr>
|
|
1313
|
+
<tr class="inferred">
|
|
1314
|
+
<td><pre><a name="line422">422</a> # bool_result : boolean value resembling the state of step result</pre></td>
|
|
1315
|
+
</tr>
|
|
1316
|
+
<tr class="inferred">
|
|
1317
|
+
<td><pre><a name="line423">423</a> # num_run_length : steps execution time in nanoseconds</pre></td>
|
|
1318
|
+
</tr>
|
|
1319
|
+
<tr class="inferred">
|
|
1320
|
+
<td><pre><a name="line424">424</a> #</pre></td>
|
|
1321
|
+
</tr>
|
|
1322
|
+
<tr class="marked">
|
|
1323
|
+
<td><pre><a name="line425">425</a> def set_step_result_new(num_step_id, num_scenario_id, num_scenario_result_id, bool_result, num_run_length)</pre></td>
|
|
1324
|
+
</tr>
|
|
1325
|
+
<tr class="uncovered">
|
|
1326
|
+
<td><pre><a name="line426">426</a> num_result = bool_result ? 1 : 0</pre></td>
|
|
1327
|
+
</tr>
|
|
1328
|
+
<tr class="uncovered">
|
|
1329
|
+
<td><pre><a name="line427">427</a> DBI.connect(@str_connection_url, DB_USER_NAME, DB_PASSWORD) do |dbh|</pre></td>
|
|
1330
|
+
</tr>
|
|
1331
|
+
<tr class="uncovered">
|
|
1332
|
+
<td><pre><a name="line428">428</a> sth = dbh.prepare("insert into TestStepResult(TestScenarioResultID,Result,RunLength,TestStepID,BuildID,TestScenarioID) values (?,?,?,?,?,?)")</pre></td>
|
|
1333
|
+
</tr>
|
|
1334
|
+
<tr class="uncovered">
|
|
1335
|
+
<td><pre><a name="line429">429</a> sth.execute(num_scenario_result_id, num_result, convert_duration(num_run_length), num_step_id, @build_id, num_scenario_id)</pre></td>
|
|
1336
|
+
</tr>
|
|
1337
|
+
<tr class="uncovered">
|
|
1338
|
+
<td><pre><a name="line430">430</a> dbh.commit</pre></td>
|
|
1339
|
+
</tr>
|
|
1340
|
+
<tr class="uncovered">
|
|
1341
|
+
<td><pre><a name="line431">431</a> dbh.disconnect()</pre></td>
|
|
1342
|
+
</tr>
|
|
1343
|
+
<tr class="inferred">
|
|
1344
|
+
<td><pre><a name="line432">432</a> #puts "Added a record to TestStepResult table successfully"</pre></td>
|
|
1345
|
+
</tr>
|
|
1346
|
+
<tr class="inferred">
|
|
1347
|
+
<td><pre><a name="line433">433</a> end</pre></td>
|
|
1348
|
+
</tr>
|
|
1349
|
+
<tr class="inferred">
|
|
1350
|
+
<td><pre><a name="line434">434</a> rescue Exception => ex</pre></td>
|
|
1351
|
+
</tr>
|
|
1352
|
+
<tr class="uncovered">
|
|
1353
|
+
<td><pre><a name="line435">435</a> $log.error("(set_step_result_new)Error in setting step data to TestStepResult table : #{ex}")</pre></td>
|
|
1354
|
+
</tr>
|
|
1355
|
+
<tr class="uncovered">
|
|
1356
|
+
<td><pre><a name="line436">436</a> exit</pre></td>
|
|
1357
|
+
</tr>
|
|
1358
|
+
<tr class="inferred">
|
|
1359
|
+
<td><pre><a name="line437">437</a> end</pre></td>
|
|
1360
|
+
</tr>
|
|
1361
|
+
<tr class="inferred">
|
|
1362
|
+
<td><pre><a name="line438">438</a> </pre></td>
|
|
1363
|
+
</tr>
|
|
1364
|
+
<tr class="inferred">
|
|
1365
|
+
<td><pre><a name="line439">439</a> # Description : sets the step result data with default details into Sybase</pre></td>
|
|
1366
|
+
</tr>
|
|
1367
|
+
<tr class="inferred">
|
|
1368
|
+
<td><pre><a name="line440">440</a> # Author : Chandra sekaran</pre></td>
|
|
1369
|
+
</tr>
|
|
1370
|
+
<tr class="inferred">
|
|
1371
|
+
<td><pre><a name="line441">441</a> # Arguments :</pre></td>
|
|
1372
|
+
</tr>
|
|
1373
|
+
<tr class="inferred">
|
|
1374
|
+
<td><pre><a name="line442">442</a> # num_step_id : primary key of step</pre></td>
|
|
1375
|
+
</tr>
|
|
1376
|
+
<tr class="inferred">
|
|
1377
|
+
<td><pre><a name="line443">443</a> # str_scenario_id : primary key of scenario</pre></td>
|
|
1378
|
+
</tr>
|
|
1379
|
+
<tr class="inferred">
|
|
1380
|
+
<td><pre><a name="line444">444</a> # num_scenario_result_id : primary key of scenario result</pre></td>
|
|
1381
|
+
</tr>
|
|
1382
|
+
<tr class="inferred">
|
|
1383
|
+
<td><pre><a name="line445">445</a> # Return Arguments :</pre></td>
|
|
1384
|
+
</tr>
|
|
1385
|
+
<tr class="inferred">
|
|
1386
|
+
<td><pre><a name="line446">446</a> # num_step_result_id : primary key of step result</pre></td>
|
|
1387
|
+
</tr>
|
|
1388
|
+
<tr class="inferred">
|
|
1389
|
+
<td><pre><a name="line447">447</a> #</pre></td>
|
|
1390
|
+
</tr>
|
|
1391
|
+
<tr class="marked">
|
|
1392
|
+
<td><pre><a name="line448">448</a> def set_step_result(num_step_id, num_scenario_id, num_scenario_result_id)</pre></td>
|
|
1393
|
+
</tr>
|
|
1394
|
+
<tr class="uncovered">
|
|
1395
|
+
<td><pre><a name="line449">449</a> DBI.connect(@str_connection_url, DB_USER_NAME, DB_PASSWORD) do |dbh|</pre></td>
|
|
1396
|
+
</tr>
|
|
1397
|
+
<tr class="uncovered">
|
|
1398
|
+
<td><pre><a name="line450">450</a> sth = dbh.prepare("insert into TestStepResult(TestScenarioResultID,TestStepID,BuildID,TestScenarioID) values (?,?,?,?)")</pre></td>
|
|
1399
|
+
</tr>
|
|
1400
|
+
<tr class="uncovered">
|
|
1401
|
+
<td><pre><a name="line451">451</a> sth.execute(num_scenario_result_id, num_step_id, @build_id, num_scenario_id)</pre></td>
|
|
1402
|
+
</tr>
|
|
1403
|
+
<tr class="uncovered">
|
|
1404
|
+
<td><pre><a name="line452">452</a> dbh.commit</pre></td>
|
|
1405
|
+
</tr>
|
|
1406
|
+
<tr class="inferred">
|
|
1407
|
+
<td><pre><a name="line453">453</a> #puts "Added a record to TestStepResult table successfully"</pre></td>
|
|
1408
|
+
</tr>
|
|
1409
|
+
<tr class="inferred">
|
|
1410
|
+
<td><pre><a name="line454">454</a> </pre></td>
|
|
1411
|
+
</tr>
|
|
1412
|
+
<tr class="uncovered">
|
|
1413
|
+
<td><pre><a name="line455">455</a> str_query = "select TestStepResultID from TestStepResult where TestScenarioResultID=#{num_scenario_result_id} and TestStepID=#{num_step_id} and BuildID=#{@build_id} and TestScenarioID=#{num_scenario_id}"</pre></td>
|
|
1414
|
+
</tr>
|
|
1415
|
+
<tr class="uncovered">
|
|
1416
|
+
<td><pre><a name="line456">456</a> sth = dbh.prepare(str_query)</pre></td>
|
|
1417
|
+
</tr>
|
|
1418
|
+
<tr class="uncovered">
|
|
1419
|
+
<td><pre><a name="line457">457</a> sth.execute()</pre></td>
|
|
1420
|
+
</tr>
|
|
1421
|
+
<tr class="uncovered">
|
|
1422
|
+
<td><pre><a name="line458">458</a> num_step_result_id = sth.fetch[0]</pre></td>
|
|
1423
|
+
</tr>
|
|
1424
|
+
<tr class="inferred">
|
|
1425
|
+
<td><pre><a name="line459">459</a> #puts "********** Record found with Primary key '#{num_step_result_id}' in TestStepResult *************"</pre></td>
|
|
1426
|
+
</tr>
|
|
1427
|
+
<tr class="uncovered">
|
|
1428
|
+
<td><pre><a name="line460">460</a> dbh.disconnect()</pre></td>
|
|
1429
|
+
</tr>
|
|
1430
|
+
<tr class="uncovered">
|
|
1431
|
+
<td><pre><a name="line461">461</a> return num_step_result_id # return the step result id of the step</pre></td>
|
|
1432
|
+
</tr>
|
|
1433
|
+
<tr class="inferred">
|
|
1434
|
+
<td><pre><a name="line462">462</a> end</pre></td>
|
|
1435
|
+
</tr>
|
|
1436
|
+
<tr class="inferred">
|
|
1437
|
+
<td><pre><a name="line463">463</a> rescue Exception => ex</pre></td>
|
|
1438
|
+
</tr>
|
|
1439
|
+
<tr class="uncovered">
|
|
1440
|
+
<td><pre><a name="line464">464</a> $log.error("Error in setting step data to TestStep table : #{ex}")</pre></td>
|
|
1441
|
+
</tr>
|
|
1442
|
+
<tr class="uncovered">
|
|
1443
|
+
<td><pre><a name="line465">465</a> exit</pre></td>
|
|
1444
|
+
</tr>
|
|
1445
|
+
<tr class="inferred">
|
|
1446
|
+
<td><pre><a name="line466">466</a> end</pre></td>
|
|
1447
|
+
</tr>
|
|
1448
|
+
<tr class="inferred">
|
|
1449
|
+
<td><pre><a name="line467">467</a> </pre></td>
|
|
1450
|
+
</tr>
|
|
1451
|
+
<tr class="inferred">
|
|
1452
|
+
<td><pre><a name="line468">468</a> # Description : resets the step result data with execution details into Sybase</pre></td>
|
|
1453
|
+
</tr>
|
|
1454
|
+
<tr class="inferred">
|
|
1455
|
+
<td><pre><a name="line469">469</a> # Author : Chandra sekaran</pre></td>
|
|
1456
|
+
</tr>
|
|
1457
|
+
<tr class="inferred">
|
|
1458
|
+
<td><pre><a name="line470">470</a> # Arguments :</pre></td>
|
|
1459
|
+
</tr>
|
|
1460
|
+
<tr class="inferred">
|
|
1461
|
+
<td><pre><a name="line471">471</a> # bool_result : boolean value resembling the state of step result</pre></td>
|
|
1462
|
+
</tr>
|
|
1463
|
+
<tr class="inferred">
|
|
1464
|
+
<td><pre><a name="line472">472</a> # num_run_length : step execution time in nanoseconds</pre></td>
|
|
1465
|
+
</tr>
|
|
1466
|
+
<tr class="inferred">
|
|
1467
|
+
<td><pre><a name="line473">473</a> # num_step_result_id : primary key of step result</pre></td>
|
|
1468
|
+
</tr>
|
|
1469
|
+
<tr class="inferred">
|
|
1470
|
+
<td><pre><a name="line474">474</a> #</pre></td>
|
|
1471
|
+
</tr>
|
|
1472
|
+
<tr class="marked">
|
|
1473
|
+
<td><pre><a name="line475">475</a> def reset_step_result(bool_result, num_run_length, num_step_result_id)</pre></td>
|
|
1474
|
+
</tr>
|
|
1475
|
+
<tr class="uncovered">
|
|
1476
|
+
<td><pre><a name="line476">476</a> num_result = bool_result ? 1 : 0</pre></td>
|
|
1477
|
+
</tr>
|
|
1478
|
+
<tr class="uncovered">
|
|
1479
|
+
<td><pre><a name="line477">477</a> DBI.connect(@str_connection_url, DB_USER_NAME, DB_PASSWORD) do |dbh|</pre></td>
|
|
1480
|
+
</tr>
|
|
1481
|
+
<tr class="uncovered">
|
|
1482
|
+
<td><pre><a name="line478">478</a> sth = dbh.prepare("update TestStepResult set Result=?, RunLength=? where TestStepResultID=?")</pre></td>
|
|
1483
|
+
</tr>
|
|
1484
|
+
<tr class="uncovered">
|
|
1485
|
+
<td><pre><a name="line479">479</a> sth.execute(num_result, convert_duration(num_run_length), num_step_result_id)</pre></td>
|
|
1486
|
+
</tr>
|
|
1487
|
+
<tr class="uncovered">
|
|
1488
|
+
<td><pre><a name="line480">480</a> sth.finish</pre></td>
|
|
1489
|
+
</tr>
|
|
1490
|
+
<tr class="uncovered">
|
|
1491
|
+
<td><pre><a name="line481">481</a> dbh.commit</pre></td>
|
|
1492
|
+
</tr>
|
|
1493
|
+
<tr class="inferred">
|
|
1494
|
+
<td><pre><a name="line482">482</a> #puts "Updated a record (#{num_step_result_id}) in TestStepResult table successfully"</pre></td>
|
|
1495
|
+
</tr>
|
|
1496
|
+
<tr class="uncovered">
|
|
1497
|
+
<td><pre><a name="line483">483</a> dbh.disconnect()</pre></td>
|
|
1498
|
+
</tr>
|
|
1499
|
+
<tr class="inferred">
|
|
1500
|
+
<td><pre><a name="line484">484</a> end</pre></td>
|
|
1501
|
+
</tr>
|
|
1502
|
+
<tr class="inferred">
|
|
1503
|
+
<td><pre><a name="line485">485</a> rescue Exception => ex</pre></td>
|
|
1504
|
+
</tr>
|
|
1505
|
+
<tr class="uncovered">
|
|
1506
|
+
<td><pre><a name="line486">486</a> $log.error("Error in resetting step results data in TestStepResult table : #{ex}")</pre></td>
|
|
1507
|
+
</tr>
|
|
1508
|
+
<tr class="uncovered">
|
|
1509
|
+
<td><pre><a name="line487">487</a> exit</pre></td>
|
|
1510
|
+
</tr>
|
|
1511
|
+
<tr class="inferred">
|
|
1512
|
+
<td><pre><a name="line488">488</a> end</pre></td>
|
|
1513
|
+
</tr>
|
|
1514
|
+
<tr class="inferred">
|
|
1515
|
+
<td><pre><a name="line489">489</a> </pre></td>
|
|
1516
|
+
</tr>
|
|
1517
|
+
<tr class="inferred">
|
|
1518
|
+
<td><pre><a name="line490">490</a> # Description : converts nanoseconds to seconds</pre></td>
|
|
1519
|
+
</tr>
|
|
1520
|
+
<tr class="inferred">
|
|
1521
|
+
<td><pre><a name="line491">491</a> # Author : Chandra sekaran</pre></td>
|
|
1522
|
+
</tr>
|
|
1523
|
+
<tr class="inferred">
|
|
1524
|
+
<td><pre><a name="line492">492</a> # Arguments :</pre></td>
|
|
1525
|
+
</tr>
|
|
1526
|
+
<tr class="inferred">
|
|
1527
|
+
<td><pre><a name="line493">493</a> # num_duration : time in nanoseconds</pre></td>
|
|
1528
|
+
</tr>
|
|
1529
|
+
<tr class="inferred">
|
|
1530
|
+
<td><pre><a name="line494">494</a> # Return Argument : time in seconds</pre></td>
|
|
1531
|
+
</tr>
|
|
1532
|
+
<tr class="inferred">
|
|
1533
|
+
<td><pre><a name="line495">495</a> #</pre></td>
|
|
1534
|
+
</tr>
|
|
1535
|
+
<tr class="marked">
|
|
1536
|
+
<td><pre><a name="line496">496</a> def convert_duration(num_duration)</pre></td>
|
|
1537
|
+
</tr>
|
|
1538
|
+
<tr class="uncovered">
|
|
1539
|
+
<td><pre><a name="line497">497</a> num_duration/(1000*1000*1000) #.to_f # convert nanosecond to second</pre></td>
|
|
1540
|
+
</tr>
|
|
1541
|
+
<tr class="inferred">
|
|
1542
|
+
<td><pre><a name="line498">498</a> end</pre></td>
|
|
1543
|
+
</tr>
|
|
1544
|
+
<tr class="inferred">
|
|
1545
|
+
<td><pre><a name="line499">499</a> </pre></td>
|
|
1546
|
+
</tr>
|
|
1547
|
+
<tr class="inferred">
|
|
1548
|
+
<td><pre><a name="line500">500</a> # Description : function that creates performance report data and stores it in Sybase</pre></td>
|
|
1549
|
+
</tr>
|
|
1550
|
+
<tr class="inferred">
|
|
1551
|
+
<td><pre><a name="line501">501</a> # Author : Chandra sekaran</pre></td>
|
|
1552
|
+
</tr>
|
|
1553
|
+
<tr class="inferred">
|
|
1554
|
+
<td><pre><a name="line502">502</a> #</pre></td>
|
|
1555
|
+
</tr>
|
|
1556
|
+
<tr class="marked">
|
|
1557
|
+
<td><pre><a name="line503">503</a> def create_performance_report</pre></td>
|
|
1558
|
+
</tr>
|
|
1559
|
+
<tr class="uncovered">
|
|
1560
|
+
<td><pre><a name="line504">504</a> set_build # set Build data only once for each execution (Single or Parallel)</pre></td>
|
|
1561
|
+
</tr>
|
|
1562
|
+
<tr class="uncovered">
|
|
1563
|
+
<td><pre><a name="line505">505</a> @arr_file_name.each do |path|</pre></td>
|
|
1564
|
+
</tr>
|
|
1565
|
+
<tr class="uncovered">
|
|
1566
|
+
<td><pre><a name="line506">506</a> @arr_background_step_duration = []</pre></td>
|
|
1567
|
+
</tr>
|
|
1568
|
+
<tr class="uncovered">
|
|
1569
|
+
<td><pre><a name="line507">507</a> file = File.read(path)</pre></td>
|
|
1570
|
+
</tr>
|
|
1571
|
+
<tr class="uncovered">
|
|
1572
|
+
<td><pre><a name="line508">508</a> @json = JSON.parse(file)</pre></td>
|
|
1573
|
+
</tr>
|
|
1574
|
+
<tr class="uncovered">
|
|
1575
|
+
<td><pre><a name="line509">509</a> parse_json # parse each json file and extract report data</pre></td>
|
|
1576
|
+
</tr>
|
|
1577
|
+
<tr class="inferred">
|
|
1578
|
+
<td><pre><a name="line510">510</a> end</pre></td>
|
|
1579
|
+
</tr>
|
|
1580
|
+
<tr class="inferred">
|
|
1581
|
+
<td><pre><a name="line511">511</a> #puts "Build duration : #{@num_build_duration} - #{@bool_build_passed} - #{@num_feature_count}"</pre></td>
|
|
1582
|
+
</tr>
|
|
1583
|
+
<tr class="uncovered">
|
|
1584
|
+
<td><pre><a name="line512">512</a> reset_build(@num_build_duration, @num_feature_pass_count, @num_feature_fail_count, @num_feature_skip_count, @bool_build_passed) # Update the Build data with execution summary</pre></td>
|
|
1585
|
+
</tr>
|
|
1586
|
+
<tr class="inferred">
|
|
1587
|
+
<td><pre><a name="line513">513</a> rescue Exception => ex</pre></td>
|
|
1588
|
+
</tr>
|
|
1589
|
+
<tr class="uncovered">
|
|
1590
|
+
<td><pre><a name="line514">514</a> $log.error("Error while creating report : #{ex}")</pre></td>
|
|
1591
|
+
</tr>
|
|
1592
|
+
<tr class="uncovered">
|
|
1593
|
+
<td><pre><a name="line515">515</a> exit</pre></td>
|
|
1594
|
+
</tr>
|
|
1595
|
+
<tr class="inferred">
|
|
1596
|
+
<td><pre><a name="line516">516</a> end</pre></td>
|
|
1597
|
+
</tr>
|
|
1598
|
+
<tr class="inferred">
|
|
1599
|
+
<td><pre><a name="line517">517</a> </pre></td>
|
|
1600
|
+
</tr>
|
|
1601
|
+
<tr class="inferred">
|
|
1602
|
+
<td><pre><a name="line518">518</a> end</pre></td>
|
|
1603
|
+
</tr>
|
|
1604
|
+
<tr class="inferred">
|
|
1605
|
+
<td><pre><a name="line519">519</a> end</pre></td>
|
|
1606
|
+
</tr>
|
|
1607
|
+
</tbody>
|
|
1608
|
+
</table>
|
|
1609
|
+
|
|
1610
|
+
<p>Generated on 2015-05-08 10:40:30 +0530 with <a href="https://github.com/fguillen/simplecov-rcov">SimpleCov-RCov 0.2.3</a></p>
|
|
1611
|
+
|
|
1612
|
+
</body>
|
|
1613
|
+
</html>
|