587
|
1 |
#============================================================================
|
|
2 |
#Name : test_ccm_results.py
|
|
3 |
#Part of : Helium
|
|
4 |
|
|
5 |
#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
6 |
#All rights reserved.
|
|
7 |
#This component and the accompanying materials are made available
|
|
8 |
#under the terms of the License "Eclipse Public License v1.0"
|
|
9 |
#which accompanies this distribution, and is available
|
|
10 |
#at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
11 |
#
|
|
12 |
#Initial Contributors:
|
|
13 |
#Nokia Corporation - initial contribution.
|
|
14 |
#
|
|
15 |
#Contributors:
|
|
16 |
#
|
|
17 |
#Description:
|
|
18 |
#===============================================================================
|
|
19 |
|
|
20 |
""" Test cases for ccm python toolkit.
|
|
21 |
|
|
22 |
"""
|
|
23 |
import unittest
|
|
24 |
import ccm
|
|
25 |
import os
|
|
26 |
import logging
|
|
27 |
|
628
|
28 |
# pylint: disable=R0201
|
587
|
29 |
|
588
|
30 |
_logger = logging.getLogger('test.ccm_results')
|
587
|
31 |
logging.basicConfig(level=logging.INFO)
|
|
32 |
|
|
33 |
class CounterHandler(logging.Handler):
|
|
34 |
""" This class provides a logging handler to count errors, warnings and infos """
|
|
35 |
def __init__(self, level=logging.NOTSET):
|
|
36 |
logging.Handler.__init__(self, level)
|
|
37 |
self.warnings = 0
|
|
38 |
self.errors = 0
|
|
39 |
self.infos = 0
|
|
40 |
|
|
41 |
def emit(self, record):
|
|
42 |
""" Handle the count the errors. """
|
|
43 |
if record.levelno == logging.INFO:
|
|
44 |
self.infos += 1
|
|
45 |
elif record.levelno == logging.WARNING:
|
|
46 |
self.warnings += 1
|
|
47 |
elif record.levelno == logging.ERROR:
|
|
48 |
self.errors += 1
|
|
49 |
|
|
50 |
class MockResultSession(ccm.AbstractSession):
|
|
51 |
""" Fake session used to test Result"""
|
628
|
52 |
def __init__(self, behave=None, database="fakedb"):
|
587
|
53 |
ccm.AbstractSession.__init__(self, None, None, None, None)
|
628
|
54 |
if behave == None:
|
|
55 |
behave = {}
|
587
|
56 |
self._behave = behave
|
|
57 |
self._database = database
|
|
58 |
|
|
59 |
def database(self):
|
588
|
60 |
"""database"""
|
587
|
61 |
return self._database
|
|
62 |
|
|
63 |
def execute(self, cmdline, result=None):
|
588
|
64 |
"""execute"""
|
587
|
65 |
if result == None:
|
588
|
66 |
result = ccm.Result(self)
|
587
|
67 |
if self._behave.has_key(cmdline):
|
|
68 |
result.statuserrors = 0
|
|
69 |
result.output = self._behave[cmdline]
|
|
70 |
else:
|
|
71 |
result.status = -1
|
|
72 |
return result
|
|
73 |
|
|
74 |
|
|
75 |
class ResultTest(unittest.TestCase):
|
|
76 |
""" Testing Results parsers. """
|
|
77 |
def test_Result(self):
|
|
78 |
""" Test result. """
|
|
79 |
result = ccm.Result(None)
|
|
80 |
result.output = u"Nokia"
|
|
81 |
assert result.output == u"Nokia"
|
|
82 |
|
|
83 |
def test_Result_unicode_character(self):
|
|
84 |
""" Test result with unicode character. """
|
|
85 |
result = ccm.Result(None)
|
|
86 |
result.output = u"Nokia\xc2"
|
|
87 |
print result.output.encode('ascii', 'replace')
|
|
88 |
assert result.output == u"Nokia?"
|
|
89 |
|
|
90 |
def test_Result_str(self):
|
|
91 |
""" Test result from str. """
|
|
92 |
result = ccm.Result(None)
|
|
93 |
result.output = "Nokia"
|
|
94 |
assert result.output == "Nokia"
|
|
95 |
|
|
96 |
def test_Result_str_not_ascii(self):
|
|
97 |
""" Test result from str with not ascii. """
|
|
98 |
result = ccm.Result(None)
|
|
99 |
result.output = "Noki\xe4"
|
|
100 |
print result.output
|
|
101 |
assert result.output == "Noki"
|
|
102 |
|
|
103 |
|
|
104 |
def test_ObjectListResult(self):
|
588
|
105 |
"""test object list result"""
|
587
|
106 |
behave = { 'test_ObjectListResult': """mc-mc_0638:project:vc1s60p1#1
|
|
107 |
mc-mc_4031_0642:project:vc1s60p1#1
|
|
108 |
mc-mc_4031_0646:project:vc1s60p1#1
|
|
109 |
mc-mc_4031_0650:project:vc1s60p1#1
|
|
110 |
mc-mc_4031_0702:project:vc1s60p1#1
|
|
111 |
mc-mc_4031_0704:project:vc1s60p1#1
|
|
112 |
mc-mc_4031_0706:project:vc1s60p1#1
|
|
113 |
mc-mc_4031_0706_v2:project:vc1s60p1#1
|
|
114 |
mc-mc_4032_0708:project:vc1s60p1#1
|
|
115 |
mc-mc_4032_0710:project:vc1s60p1#1
|
|
116 |
mc-mc_4032_0712:project:vc1s60p1#1
|
|
117 |
mc-mc_4032_0714:project:vc1s60p1#1
|
|
118 |
mc-mc_4032_0716:project:vc1s60p1#1
|
|
119 |
mc-mc_4032_0718:project:vc1s60p1#1
|
|
120 |
mc-mc_4032_0720:project:vc1s60p1#1
|
|
121 |
mc-mc_4032_0722:project:vc1s60p1#1
|
|
122 |
mc-mc_4032_0724:project:vc1s60p1#1
|
|
123 |
mc-mc_4032_0726.lum.09:project:vc1s60p1#1
|
|
124 |
mc-mc_4032_0726:project:vc1s60p1#1
|
|
125 |
mc-mc_4032_0728:project:vc1s60p1#1
|
|
126 |
mc-mc_4032_0730:project:vc1s60p1#1
|
|
127 |
mc-mc_4032_0732:project:vc1s60p1#1
|
|
128 |
mc-mc_4032_0734:project:vc1s60p1#1
|
|
129 |
mc-mc_4032_0736:project:vc1s60p1#1
|
|
130 |
|
|
131 |
"""}
|
|
132 |
session = MockResultSession(behave)
|
|
133 |
result = session.execute('test_ObjectListResult', ccm.ObjectListResult(session))
|
|
134 |
assert len(result.output) == 24, "output doesn't contains the right number of result project."
|
588
|
135 |
for obj in result.output:
|
|
136 |
assert obj.type == 'project'
|
|
137 |
assert obj.name == 'mc'
|
587
|
138 |
|
|
139 |
def test_WorkAreaInfoResult(self):
|
588
|
140 |
""" test work area info result"""
|
587
|
141 |
behave = { 'test_WorkAreaInfoResult': """
|
|
142 |
Project Maintain Copies Relative Time Translate Modify Path
|
|
143 |
-------------------------------------------------------------------
|
|
144 |
mc_5132_build-fa1f5132#loc_0734:project:jk1f5132#1 TRUE TRUE TRUE TRUE TRUE FALSE 'E:\\WBERNARD\\ccm_wa\\fa1f5132\\mc-fa1f5132#loc_0734\\mc\\mc_build'
|
|
145 |
|
|
146 |
"""}
|
|
147 |
session = MockResultSession(behave)
|
|
148 |
result = session.execute('test_WorkAreaInfoResult', ccm.WorkAreaInfoResult(session))
|
|
149 |
print result.output
|
|
150 |
print result.output['path']
|
|
151 |
assert str(result.output['project']) == "mc_5132_build-fa1f5132#loc_0734:project:jk1f5132#1", "wrong project name."
|
|
152 |
assert result.output['maintain'] == True, "maintain value is wrong."
|
|
153 |
assert result.output['copies'] == True, "copies value is wrong."
|
|
154 |
assert result.output['relative'] == True, "relative value is wrong."
|
|
155 |
assert result.output['time'] == True, "time value is wrong."
|
|
156 |
assert result.output['translate'] == True, "translate value is wrong."
|
|
157 |
assert result.output['modify'] == False, "modify value is wrong."
|
|
158 |
assert result.output['path'] == "E:\\WBERNARD\\ccm_wa\\fa1f5132\\mc-fa1f5132#loc_0734\\mc\\mc_build", "path value is wrong."
|
|
159 |
|
|
160 |
def test_FinduseResult(self):
|
|
161 |
""" Test the parsing of the FinduseResult class. """
|
|
162 |
behave = { 'test_FinduseResult': """
|
|
163 |
Ibusal_internal-fa1f5132#wbernard16:project:jk1imeng#1 working wbernard project Ibusal_internal jk1imeng#1 fa1f5132#2561
|
|
164 |
IBUSAL_RapidoYawe\Ibusal_internal-fa1f5132#wbernard16@IBUSAL_RapidoYawe-fa1f5132#wbernard16:project:jk1imeng#1
|
|
165 |
|
|
166 |
"""}
|
|
167 |
session = MockResultSession(behave)
|
588
|
168 |
obj = session.create("Ibusal_internal-fa1f5132#wbernard16:project:jk1imeng#1")
|
|
169 |
result = session.execute('test_FinduseResult', ccm.FinduseResult(obj))
|
587
|
170 |
print result.output
|
|
171 |
assert len(result.output) == 1
|
|
172 |
assert result.output[0]['project'].objectname == "IBUSAL_RapidoYawe-fa1f5132#wbernard16:project:jk1imeng#1"
|
|
173 |
assert result.output[0]['path'] == "IBUSAL_RapidoYawe"
|
|
174 |
|
|
175 |
|
|
176 |
def test_read_ccmwaid_info(self):
|
|
177 |
""" Testing read_ccmwaid_info, open a _ccmwaid.inf file and check the extracted data. """
|
|
178 |
data = ccm.read_ccmwaid_info(os.path.join(os.environ['TEST_DATA'], 'data', 'test_ccmwaid.inf'))
|
588
|
179 |
_logger.debug(data)
|
587
|
180 |
assert data['database'] == "jk1f5132"
|
|
181 |
assert data['objectname'] == "sa1spp#1/project/S60/jk1f5132#wbernard"
|
|
182 |
|
|
183 |
def test_update_result(self):
|
|
184 |
""" Validating UpdateResult."""
|
|
185 |
behave = {'test_update' :"""Starting update process...
|
|
186 |
|
|
187 |
Updating project 'Cartman-wbernard5:project:tr1test1#1' from object version 'Cartman-wbernard5:project:tr1test1#1'...
|
|
188 |
Refreshing baseline and tasks for project grouping 'My cartman/060530_v2 Collaborative Development Projects'.
|
|
189 |
Replacing tasks in folder tr1test1#2008
|
|
190 |
Contents of folder tr1test1#2008 have not changed.
|
|
191 |
Replacing tasks in folder tr1test1#2009
|
|
192 |
Contents of folder tr1test1#2009 have not changed.
|
|
193 |
Added the following tasks to project grouping 'My cartman/060530_v2 Collaborative Development Projects':
|
|
194 |
Task tr1test1#3426: Update Cartman subprojects
|
|
195 |
Task tr1test1#3429: Create Kyle subprojects
|
|
196 |
Task tr1test1#3430: Add Kyle02 subpr hierarchy
|
|
197 |
Task tr1test1#3431: Add a file to cartman_sub_sub02
|
|
198 |
|
|
199 |
|
|
200 |
Updating project 'Cartman_sub01-wbernard3:project:tr1test1#1', reselecting root object version...
|
|
201 |
Update for 'Cartman-wbernard5:project:tr1test1#1' complete with 0 out of 3 objects replaced.
|
|
202 |
|
|
203 |
Updating project 'Cartman_sub_sub01-wbernard3:project:tr1test1#1', reselecting root object version...
|
|
204 |
Update for 'Cartman_sub01-wbernard3:project:tr1test1#1' complete with 0 out of 2 objects replaced.
|
|
205 |
|
|
206 |
Updating project 'Cartman_sub02-wbernard3:project:tr1test1#1', reselecting root object version...
|
|
207 |
Update for 'Cartman_sub_sub01-wbernard3:project:tr1test1#1' complete with 0 out of 1 objects replaced.
|
|
208 |
'Cartman_sub02-2:dir:tr1test1#1' replaces 'Cartman_sub02-1:dir:tr1test1#1' under 'Cartman_sub02-wbernard3:project:tr1test1#1'.
|
|
209 |
|
|
210 |
Updating project 'Cartman_sub_sub02-wbernard6:project:tr1test1#1', reselecting root object version...
|
|
211 |
Update for 'Cartman_sub02-wbernard3:project:tr1test1#1' complete with 2 out of 2 objects replaced.
|
|
212 |
Subproject 'Cartman_sub_sub02-wbernard6:project:tr1test1#1' is now bound under 'Cartman_sub02-2:dir:tr1test1#1'.
|
|
213 |
'Cartman_sub_sub02-2:dir:tr1test1#1' replaces 'Cartman_sub_sub02-1:dir:tr1test1#1' under 'Cartman_sub_sub02-wbernard6:project:tr1test1#1'.
|
|
214 |
Update for 'Cartman_sub_sub02-wbernard6:project:tr1test1#1' complete with 2 out of 2 objects replaced.
|
|
215 |
'xzx.iby-1:epocrom:tr1test1#1' is now bound under 'Cartman_sub_sub02-2:dir:tr1test1#1'.
|
|
216 |
|
|
217 |
|
|
218 |
Update Summary:
|
|
219 |
Cartman_sub_sub02:dir:tr1test1#1 in project Cartman_sub_sub02-wbernard2:project:tr1test1#1 had no candidates
|
|
220 |
|
|
221 |
Update complete.
|
|
222 |
"""}
|
|
223 |
session = MockResultSession(behave)
|
|
224 |
result = session.execute('test_update', ccm.UpdateResult(session))
|
588
|
225 |
#_logger.debug(result.output)
|
587
|
226 |
assert len(result.output['tasks']) == 4, "Number of tasks doesn't match."
|
|
227 |
assert len(result.output['modifications']) == 4, "Number of modifications doesn't match."
|
|
228 |
assert len(result.output['errors']) == 1, "Number of errors doesn't match."
|
|
229 |
|
|
230 |
def test_update_result_serious_failure(self):
|
|
231 |
""" Validating UpdateResult with serious failure."""
|
|
232 |
behave = {'test_update' :"""Starting update process...
|
|
233 |
|
|
234 |
Updating project 'MinibuildDomain-wbernard3:project:tr1test1#1' from object version 'MinibuildDomain-wbernard3:project:tr1test1#1'...
|
|
235 |
Refreshing baseline and tasks for project grouping 'My MinibuildDomain/next Insulated Development Projects'.
|
|
236 |
Replacing tasks in folder tr1test1#2068
|
|
237 |
Contents of folder tr1test1#2068 have not changed.
|
|
238 |
Setting path for work area of 'helloworldcons-wbernard2' to 'c:\users\ccm65\ccm_wa\tr1test1\MinibuildDomain'...
|
|
239 |
Warning: 'c:\users\ccm65\ccm_wa\tr1test1\MinibuildDomain\helloworldcons' already used as work area for project 'helloworldcons-wbernard'
|
|
240 |
Warning: Unable to update path for work area of 'helloworldcons-wbernard2'
|
|
241 |
Warning: Unable to update membership of project 'MinibuildDomain-wbernard3'
|
|
242 |
Work area delete of 'helloworldcons-wbernard2:project:tr1test1#1' failed
|
|
243 |
Warning: Unable to update membership of project MinibuildDomain-wbernard3 with MinibuildDomain-2:dir:tr1test1#1
|
|
244 |
Rebind of MinibuildDomain-1:dir:tr1test1#1 failed
|
|
245 |
Warning: Update for project 'MinibuildDomain-wbernard3:project:tr1test1#1' failed.
|
|
246 |
|
|
247 |
Update Summary
|
|
248 |
2 failures to use the selected object version
|
|
249 |
Failed to remove selected object helloworldcons-wbernard2:project:tr1test1#1 under directory MinibuildDomain-1:dir:tr1test1#1 from project MinibuildDomain-wbernard3 : work area delete failed
|
|
250 |
Failed to use selected object MinibuildDomain-2:dir:tr1test1#1 under directory MinibuildDomain-wbernard3:project:tr1test1#1 in project MinibuildDomain-wbernard3
|
|
251 |
Serious:
|
|
252 |
Update failed.
|
|
253 |
"""}
|
|
254 |
session = MockResultSession(behave)
|
|
255 |
result = session.execute('test_update', ccm.UpdateResult(session))
|
588
|
256 |
#_logger.debug(result.output)
|
|
257 |
#_logger.debug(result.output.keys())
|
|
258 |
#_logger.debug(len(result.output['tasks']))
|
|
259 |
#_logger.debug(len(result.output['modifications']))
|
|
260 |
#_logger.debug(len(result.output['errors']))
|
|
261 |
#_logger.debug(len(result.output['warnings']))
|
587
|
262 |
|
|
263 |
assert (len(result.output['tasks']) == 0), "Number of tasks doesn't match."
|
|
264 |
assert (len(result.output['modifications']) == 0), "Number of modifications doesn't match."
|
|
265 |
assert (len(result.output['errors']) == 1), "Number of errors doesn't match."
|
|
266 |
assert (len(result.output['warnings']) == 5), "Number of warnings doesn't match."
|
|
267 |
|
|
268 |
|
588
|
269 |
def test_UpdateTemplateInformation_result(self):
|
|
270 |
""" Validating UpdateTemplateInformation."""
|
587
|
271 |
behave = {'test_update' : """Baseline Selection Mode: Latest Baseline Projects
|
|
272 |
Prep Allowed: No
|
|
273 |
Versions Matching: *abs.50*
|
|
274 |
Release Purposes:
|
|
275 |
Use by Default: Yes
|
|
276 |
Modifiable in Database: tr1s60
|
|
277 |
In Use For Release: Yes
|
|
278 |
Folder Templates and Folders:
|
|
279 |
Template assigned or completed tasks for %owner for release %release
|
|
280 |
Template all completed tasks for release %release
|
|
281 |
Folder tr1s60#4844: All completed Xuikon/Xuikon_rel_X tasks
|
|
282 |
Folder tr1s60#4930: All tasks for release AppBaseDo_50
|
|
283 |
"""}
|
|
284 |
session = MockResultSession(behave)
|
|
285 |
result = session.execute('test_update', ccm.UpdateTemplateInformation(session))
|
588
|
286 |
#_logger.debug(result.output)
|
587
|
287 |
assert result.output['baseline_selection_mode'] == "Latest Baseline Projects", "BSM doesn't match."
|
|
288 |
assert result.output['prep_allowed'] == False, "Prep allowed doesn't match."
|
|
289 |
assert result.output['version_matching'] == "*abs.50*", "Version matching doesn't match."
|
|
290 |
assert result.output['release_purpose'] == "", "Release purpose doesn't match."
|
|
291 |
assert result.output['modifiable_in_database'] == "tr1s60", "Modifiable in Database doesn't match."
|
|
292 |
assert result.output['in_use_for_release'] == True, "In Use For Release doesn't match."
|
|
293 |
|
588
|
294 |
def test_ConflictsResult_result(self):
|
|
295 |
""" Validating ConflictsResult."""
|
|
296 |
behave = {'test_update' : """
|
587
|
297 |
Project: Cartman-Release_v4
|
|
298 |
|
|
299 |
No conflicts detected.
|
|
300 |
|
|
301 |
Project: Cartman_sub03-next
|
|
302 |
|
|
303 |
No conflicts detected.
|
|
304 |
|
|
305 |
Project: Cartman_sub01-Release_v2
|
|
306 |
|
|
307 |
No conflicts detected.
|
|
308 |
|
|
309 |
Project: Cartman_sub02-Release_v4
|
|
310 |
|
|
311 |
No conflicts detected.
|
|
312 |
|
|
313 |
Project: Cartman_sub_sub01-Release_v2
|
|
314 |
|
|
315 |
No conflicts detected.
|
|
316 |
|
|
317 |
Project: Cartman_sub_sub02-Release_v4
|
|
318 |
|
|
319 |
No conflicts detected.
|
|
320 |
|
|
321 |
Project: Cartman_sub_sub_sub02-Release_v4
|
|
322 |
|
|
323 |
tr1test1#5224 Explicitly specified but not included
|
|
324 |
tr1test1#5226 Explicitly specified but not included
|
|
325 |
"""}
|
|
326 |
session = MockResultSession(behave)
|
|
327 |
result = session.execute('test_update', ccm.ConflictsResult(session))
|
588
|
328 |
#_logger.debug(result.output)
|
628
|
329 |
# pylint: disable=E1103
|
587
|
330 |
assert len(result.output.keys()) == 7, "Should detect 7 projects."
|
|
331 |
subproj = session.create("Cartman_sub_sub_sub02-Release_v4:project:%s#1" % session.database())
|
|
332 |
assert len(result.output[subproj]) == 2, "%s should contain 2 conflicts" % subproj.objectname
|
|
333 |
|
|
334 |
|
588
|
335 |
def test_DataMapperListResult_result(self):
|
|
336 |
""" Validating DataMapperListResult."""
|
587
|
337 |
behave = {'test_query' : """>>>objectname>>>task5204-1:task:tr1test1>>>task_synopsis>>>Create Cartman_sub03>>>
|
|
338 |
>>>objectname>>>task5223-1:task:tr1test1>>>task_synopsis>>>cartman/next test1>>>
|
|
339 |
>>>objectname>>>task5224-1:task:tr1test1>>>task_synopsis>>>test.txt>>>
|
|
340 |
>>>objectname>>>task5225-1:task:tr1test1>>>task_synopsis>>>test.txt 2>>>
|
|
341 |
>>>objectname>>>task5226-1:task:tr1test1>>>task_synopsis>>>test.txt merge>>>
|
|
342 |
>>>objectname>>>task5240-1:task:tr1test1>>>task_synopsis>>>add calculator>>>
|
|
343 |
"""}
|
|
344 |
session = MockResultSession(behave)
|
|
345 |
result = session.execute('test_query', ccm.DataMapperListResult(session, '>>>', ['objectname', 'task_synopsis'], ['ccmobject', 'string']))
|
588
|
346 |
_logger.debug(result.output)
|
587
|
347 |
assert len(result.output) == 6
|
|
348 |
|
588
|
349 |
def test_UpdatePropertiesRefreshResult_result(self):
|
|
350 |
""" Validating UpdatePropertiesRefreshResult."""
|
587
|
351 |
behave = {'test_refresh' : """Refreshing baseline and tasks for project grouping 'All cartman/next Integration Testing Projects from Database tr1test1'.
|
|
352 |
Replacing tasks in folder tr1test1#2045
|
|
353 |
Removed the following tasks from folder tr1test1#2045
|
|
354 |
Task tr1test1#5225: test.txt 2
|
|
355 |
|
|
356 |
Added the following tasks to folder tr1test1#2045
|
|
357 |
Task tr1test1#5223: cartman/next test1
|
|
358 |
|
|
359 |
Added the following tasks to project grouping 'All cartman/next Integration Testing Projects from Database tr1test1':
|
|
360 |
Task tr1test1#5223: cartman/next test1
|
|
361 |
|
|
362 |
Removed the following tasks from project grouping 'All cartman/next Integration Testing Projects from Database tr1test1':
|
|
363 |
Task tr1test1#5225: test.txt 2
|
|
364 |
"""}
|
|
365 |
session = MockResultSession(behave)
|
|
366 |
result = session.execute('test_refresh', ccm.UpdatePropertiesRefreshResult(session))
|
588
|
367 |
_logger.debug(result.output)
|
587
|
368 |
assert result.output['added'] == [session.create("Task tr1test1#5223")]
|
|
369 |
assert result.output['removed'] == [session.create("Task tr1test1#5225")]
|
|
370 |
|
|
371 |
def test_update_log_result(self):
|
|
372 |
""" Testing update log parsing. """
|
|
373 |
log = """Starting update process...
|
|
374 |
|
|
375 |
Updating project 'MinibuildDomain-wbernard3:project:tr1test1#1' from object version 'MinibuildDomain-wbernard3:project:tr1test1#1'...
|
|
376 |
Refreshing baseline and tasks for project grouping 'My MinibuildDomain/next Insulated Development Projects'.
|
|
377 |
Replacing tasks in folder tr1test1#2068
|
|
378 |
Contents of folder tr1test1#2068 have not changed.
|
|
379 |
Setting path for work area of 'helloworldcons-wbernard2' to 'c:\users\ccm65\ccm_wa\tr1test1\MinibuildDomain'...
|
|
380 |
Warning: 'c:\users\ccm65\ccm_wa\tr1test1\MinibuildDomain\helloworldcons' already used as work area for project 'helloworldcons-wbernard'
|
|
381 |
Warning: Unable to update path for work area of 'helloworldcons-wbernard2'
|
|
382 |
Warning: Unable to update membership of project 'MinibuildDomain-wbernard3'
|
|
383 |
Work area delete of 'helloworldcons-wbernard2:project:tr1test1#1' failed
|
|
384 |
Warning: Unable to update membership of project MinibuildDomain-wbernard3 with MinibuildDomain-2:dir:tr1test1#1
|
|
385 |
Rebind of MinibuildDomain-1:dir:tr1test1#1 failed
|
|
386 |
Warning: Update for project 'MinibuildDomain-wbernard3:project:tr1test1#1' failed.
|
|
387 |
Warning: This work area 'c:\users\ccm65\ccm_wa\tr1sido\mrurlparserplugin\mrurlparserplugin' cannot be reused
|
|
388 |
Warning: No candidates found for directory entry ecompluginnotifier.cpp:cppsrc:e003sa01#1. It will be left empty!
|
|
389 |
WARNING: There is no matching baseline project for 'ci-hitchcock_nga' in baseline 'tr1s60#ABS_domain_mcl92-abs.mcl.92_200907'. This baseline might not be complete
|
|
390 |
|
|
391 |
Update Summary
|
|
392 |
2 failures to use the selected object version
|
|
393 |
Failed to remove selected object helloworldcons-wbernard2:project:tr1test1#1 under directory MinibuildDomain-1:dir:tr1test1#1 from project MinibuildDomain-wbernard3 : work area delete failed
|
|
394 |
Failed to use selected object MinibuildDomain-2:dir:tr1test1#1 under directory MinibuildDomain-wbernard3:project:tr1test1#1 in project MinibuildDomain-wbernard3
|
|
395 |
Serious:
|
|
396 |
Update failed.
|
|
397 |
"""
|
628
|
398 |
count_logger = logging.getLogger('count.logger')
|
|
399 |
count_logger.setLevel(logging.WARNING)
|
587
|
400 |
handler = CounterHandler()
|
628
|
401 |
count_logger.addHandler(handler)
|
|
402 |
ccm.log_result(log, ccm.UPDATE_LOG_RULES, count_logger)
|
587
|
403 |
print handler.warnings
|
|
404 |
print handler.errors
|
|
405 |
assert handler.warnings == 5
|
|
406 |
assert handler.errors == 9
|
|
407 |
|
|
408 |
|
|
409 |
def test_checkout_log_result(self):
|
|
410 |
""" Testing checkout log parsing. """
|
|
411 |
log = """Setting path for work area of 'swservices_domain-ssdo_7132_200912_Shakira_Gwen1' to 'E:\Build_E\DaveS\Integration\_no_context_\swservices_domain'...
|
|
412 |
Saved work area options for project: 'swservices_domain-ssdo_7132_200912_Shakira_Gwen1'
|
|
413 |
Derive failed for MobileSearch-MobileSearch_4_10_09w09_S60_3_2:project:sa1mosx1#1
|
|
414 |
Warning: Project name is either invalid or does not exist:
|
|
415 |
Warning: fa1ssdo#MobileSearch_4_10_09w09_S60_3_3 too long, use name less than 32 characters long.
|
|
416 |
Warning: Object version 'fa1ssdo#MobileSearch_4_10_09w09_S60_3_3' too long, use version less than 32 characters long.
|
|
417 |
Copy Project complete with 1 errors.
|
|
418 |
WARNING: There is no matching baseline project for 'ci-hitchcock_nga' in baseline 'tr1s60#ABS_domain_mcl92-abs.mcl.92_200907'. This baseline might not be complete
|
|
419 |
"""
|
628
|
420 |
count_logger = logging.getLogger('count.logger')
|
|
421 |
count_logger.setLevel(logging.WARNING)
|
587
|
422 |
handler = CounterHandler()
|
628
|
423 |
count_logger.addHandler(handler)
|
|
424 |
ccm.log_result(log, ccm.CHECKOUT_LOG_RULES, count_logger)
|
587
|
425 |
print handler.warnings
|
|
426 |
print handler.errors
|
|
427 |
assert handler.warnings == 4
|
|
428 |
assert handler.errors == 1
|
|
429 |
|
|
430 |
|
|
431 |
def test_sync_log_result(self):
|
|
432 |
""" Testing sync log parsing. """
|
|
433 |
log = """Synchronization summary:
|
|
434 |
0 Update(s) for project MinibuildDomain-wbernard7
|
|
435 |
0 Update(s) for project helloworldapi-wbernard7
|
|
436 |
0 Update(s) for project helloworldcons-wbernard5
|
|
437 |
0 Conflict(s) for project MinibuildDomain-wbernard7
|
|
438 |
1 Conflict(s) for project helloworldapi-wbernard7
|
|
439 |
0 Conflict(s) for project helloworldcons-wbernard5
|
|
440 |
You can use Reconcile to resolve work area conflicts
|
|
441 |
Warning: Conflicts detected during synchronization. Check your logs.
|
|
442 |
"""
|
628
|
443 |
count_logger = logging.getLogger('count.logger')
|
|
444 |
count_logger.setLevel(logging.WARNING)
|
587
|
445 |
handler = CounterHandler()
|
628
|
446 |
count_logger.addHandler(handler)
|
|
447 |
ccm.log_result(log, ccm.SYNC_LOG_RULES, count_logger)
|
587
|
448 |
print handler.warnings
|
|
449 |
print handler.errors
|
|
450 |
assert handler.warnings == 0
|
|
451 |
assert handler.errors == 2
|
|
452 |
|
|
453 |
def test_ResultWithError(self):
|
|
454 |
""" Test result. """
|
|
455 |
result = ccm.ResultWithError(None)
|
|
456 |
result.output = u"Nokia"
|
|
457 |
result.error = u"Nokio"
|
|
458 |
assert result.output == u"Nokia"
|
|
459 |
assert result.error == u"Nokio"
|
|
460 |
|
|
461 |
def test_ResultWithError_unicode_character(self):
|
|
462 |
""" Test result with unicode character. """
|
|
463 |
result = ccm.ResultWithError(None)
|
|
464 |
result.output = u"Nokia\xc2"
|
|
465 |
result.error = u"Nokio\xc2"
|
|
466 |
print result.output.encode('ascii', 'replace')
|
|
467 |
print result.error.encode('ascii', 'replace')
|
|
468 |
assert result.output == u"Nokia?"
|
|
469 |
assert result.error == u"Nokio?"
|
|
470 |
|
|
471 |
def test_ResultWithError_str(self):
|
|
472 |
""" Test result from str. """
|
|
473 |
result = ccm.ResultWithError(None)
|
|
474 |
result.output = "Nokia"
|
|
475 |
result.error = "Nokio"
|
|
476 |
assert result.output == "Nokia"
|
|
477 |
assert result.error == "Nokio"
|
|
478 |
|
|
479 |
def test_ResultWithError_str_not_ascii(self):
|
|
480 |
""" Test result from str with not ascii. """
|
|
481 |
result = ccm.ResultWithError(None)
|
|
482 |
result.output = "Noki\xe4"
|
|
483 |
result.error = "Nokio\xe5"
|
|
484 |
print result.output
|
|
485 |
print result.error
|
|
486 |
assert result.output == "Noki"
|
|
487 |
assert result.error == "Nokio"
|
|
488 |
|
|
489 |
if __name__ == "__main__":
|
|
490 |
unittest.main()
|