Commit fa9c4e83 authored by Łukasz Nowak's avatar Łukasz Nowak

[erp5_test_result] Silence some warnings

parent ae7eed02
...@@ -138,14 +138,14 @@ class TestTaskDistribution(ERP5TypeTestCase): ...@@ -138,14 +138,14 @@ class TestTaskDistribution(ERP5TypeTestCase):
def test_02_createTestSuite(self): def test_02_createTestSuite(self):
# Test Test Suite # Test Test Suite
test_suite, = self._createTestSuite() test_suite = self._createTestSuite()[0]
self.assertEquals(test_suite.getPortalType(), "Test Suite") self.assertEquals(test_suite.getPortalType(), "Test Suite")
self.assertEquals(test_suite.getSpecialise(), self.distributor.getRelativeUrl()) self.assertEquals(test_suite.getSpecialise(), self.distributor.getRelativeUrl())
# Test Scalability Test Suite # Test Scalability Test Suite
scalability_test_suite, = self._createTestSuite( scalability_test_suite = self._createTestSuite(
portal_type="Scalability Test Suite", portal_type="Scalability Test Suite",
specialise_value = self.scalability_distributor specialise_value = self.scalability_distributor
) )[0]
self.assertEquals(scalability_test_suite.getPortalType(), self.assertEquals(scalability_test_suite.getPortalType(),
"Scalability Test Suite") "Scalability Test Suite")
self.assertEquals(scalability_test_suite.getSpecialise(), self.assertEquals(scalability_test_suite.getSpecialise(),
...@@ -353,10 +353,10 @@ class TestTaskDistribution(ERP5TypeTestCase): ...@@ -353,10 +353,10 @@ class TestTaskDistribution(ERP5TypeTestCase):
self.assertEqual(2, len(line_list)) self.assertEqual(2, len(line_list))
self.assertEqual(set(['testFoo', 'testBar']), set([x.getTitle() for x self.assertEqual(set(['testFoo', 'testBar']), set([x.getTitle() for x
in line_list])) in line_list]))
line_url, test = self.tool.startUnitTest(test_result_path) line_url, _ = self.tool.startUnitTest(test_result_path)
result = self._createTestResult(test_list=['testFoo', 'testBar']) result = self._createTestResult(test_list=['testFoo', 'testBar'])
self.assertEqual((test_result_path, revision), result) self.assertEqual((test_result_path, revision), result)
next_line_url, next_test = self.tool.startUnitTest(test_result_path) self.tool.startUnitTest(test_result_path)
# all tests of this test suite are now started, stop affecting test node to it # all tests of this test suite are now started, stop affecting test node to it
result = self._createTestResult(test_list=['testFoo', 'testBar']) result = self._createTestResult(test_list=['testFoo', 'testBar'])
self.assertEqual(None, result) self.assertEqual(None, result)
...@@ -365,7 +365,7 @@ class TestTaskDistribution(ERP5TypeTestCase): ...@@ -365,7 +365,7 @@ class TestTaskDistribution(ERP5TypeTestCase):
self.commit() self.commit()
result = self._createTestResult(test_list=['testFoo', 'testBar']) result = self._createTestResult(test_list=['testFoo', 'testBar'])
self.assertEqual((test_result_path, revision), result) self.assertEqual((test_result_path, revision), result)
next_line_url, next_test = self.tool.startUnitTest(test_result_path) self.tool.startUnitTest(test_result_path)
def test_05b_createTestResultDoesNotReexecuteRevision(self): def test_05b_createTestResultDoesNotReexecuteRevision(self):
""" """
...@@ -377,16 +377,16 @@ class TestTaskDistribution(ERP5TypeTestCase): ...@@ -377,16 +377,16 @@ class TestTaskDistribution(ERP5TypeTestCase):
- if testnode ask for r0=c, then usual test is created/executed - if testnode ask for r0=c, then usual test is created/executed
""" """
# launch test r0=b # launch test r0=b
test_result_path, revision = self._createTestResult(revision="r0=b", test_list=["testFoo"]) test_result_path, _ = self._createTestResult(revision="r0=b", test_list=["testFoo"])
line_url, test = self.tool.startUnitTest(test_result_path) line_url, _ = self.tool.startUnitTest(test_result_path)
status_dict = {} status_dict = {}
self.tool.stopUnitTest(line_url, status_dict) self.tool.stopUnitTest(line_url, status_dict)
test_result = self.getPortalObject().unrestrictedTraverse(test_result_path) test_result = self.getPortalObject().unrestrictedTraverse(test_result_path)
self.tic() self.tic()
self.assertEqual("stopped", test_result.getSimulationState()) self.assertEqual("stopped", test_result.getSimulationState())
# launch test r0=a # launch test r0=a
test_result_path, revision = self._createTestResult(revision="r0=a", test_list=["testFoo"]) test_result_path, _ = self._createTestResult(revision="r0=a", test_list=["testFoo"])
line_url, test = self.tool.startUnitTest(test_result_path) line_url, _ = self.tool.startUnitTest(test_result_path)
self.tool.stopUnitTest(line_url, status_dict) self.tool.stopUnitTest(line_url, status_dict)
test_result = self.getPortalObject().unrestrictedTraverse(test_result_path) test_result = self.getPortalObject().unrestrictedTraverse(test_result_path)
self.tic() self.tic()
...@@ -395,15 +395,15 @@ class TestTaskDistribution(ERP5TypeTestCase): ...@@ -395,15 +395,15 @@ class TestTaskDistribution(ERP5TypeTestCase):
result = self._createTestResult(revision="r0=b", test_list=["testFoo"]) result = self._createTestResult(revision="r0=b", test_list=["testFoo"])
self.assertEqual(None, result) self.assertEqual(None, result)
# launch test r0=c # launch test r0=c
test_result_path, revision = self._createTestResult(revision="r0=c", test_list=["testFoo"]) test_result_path, _ = self._createTestResult(revision="r0=c", test_list=["testFoo"])
line_url, test = self.tool.startUnitTest(test_result_path) line_url, _ = self.tool.startUnitTest(test_result_path)
self.tool.stopUnitTest(line_url, status_dict) self.tool.stopUnitTest(line_url, status_dict)
test_result = self.getPortalObject().unrestrictedTraverse(test_result_path) test_result = self.getPortalObject().unrestrictedTraverse(test_result_path)
self.tic() self.tic()
self.assertEqual("stopped", test_result.getSimulationState()) self.assertEqual("stopped", test_result.getSimulationState())
def test_05c_createTestResult_with_registered_test_node(self): def test_05c_createTestResult_with_registered_test_node(self):
test_result_path, revision = self._createTestResult() test_result_path, _ = self._createTestResult()
# check that Test Node Result used in Test Result is specialised # check that Test Node Result used in Test Result is specialised
# into registered Test Node # into registered Test Node
test_result = self.getPortalObject().unrestrictedTraverse(test_result_path) test_result = self.getPortalObject().unrestrictedTraverse(test_result_path)
...@@ -414,7 +414,7 @@ class TestTaskDistribution(ERP5TypeTestCase): ...@@ -414,7 +414,7 @@ class TestTaskDistribution(ERP5TypeTestCase):
""" """
We will check methods startUnitTest/stopUnitTest of task distribution tool We will check methods startUnitTest/stopUnitTest of task distribution tool
""" """
test_result_path, revision = self._createTestResult( test_result_path, _ = self._createTestResult(
test_list=['testFoo', 'testBar']) test_list=['testFoo', 'testBar'])
test_result = self.getPortalObject().unrestrictedTraverse(test_result_path) test_result = self.getPortalObject().unrestrictedTraverse(test_result_path)
line_url, test = self.tool.startUnitTest(test_result_path) line_url, test = self.tool.startUnitTest(test_result_path)
...@@ -443,7 +443,7 @@ class TestTaskDistribution(ERP5TypeTestCase): ...@@ -443,7 +443,7 @@ class TestTaskDistribution(ERP5TypeTestCase):
self.tic() self.tic()
self.assertEqual("stopped", test_result.getSimulationState()) self.assertEqual("stopped", test_result.getSimulationState())
self.tic() self.tic()
next_test_result_path, revision = self._createTestResult( next_test_result_path, _ = self._createTestResult(
test_list=['testFoo', 'testBar'], revision="r0=a,r1=b") test_list=['testFoo', 'testBar'], revision="r0=a,r1=b")
self.assertNotEquals(next_test_result_path, test_result_path) self.assertNotEquals(next_test_result_path, test_result_path)
line_url, test = self.tool.startUnitTest(next_test_result_path) line_url, test = self.tool.startUnitTest(next_test_result_path)
...@@ -455,10 +455,10 @@ class TestTaskDistribution(ERP5TypeTestCase): ...@@ -455,10 +455,10 @@ class TestTaskDistribution(ERP5TypeTestCase):
Check if a test result line is not stuck in 'started', if so, redraft Check if a test result line is not stuck in 'started', if so, redraft
if with alarm to let opportunity of another test node to work on it if with alarm to let opportunity of another test node to work on it
""" """
test_result_path, revision = self._createTestResult( test_result_path, _ = self._createTestResult(
test_list=['testFoo', 'testBar']) test_list=['testFoo', 'testBar'])
test_result = self.portal.unrestrictedTraverse(test_result_path) test_result = self.portal.unrestrictedTraverse(test_result_path)
line_url, test = self.tool.startUnitTest(test_result_path) line_url, _ = self.tool.startUnitTest(test_result_path)
now = DateTime() now = DateTime()
def checkTestResultLine(expected): def checkTestResultLine(expected):
line_list = test_result.objectValues(portal_type="Test Result Line") line_list = test_result.objectValues(portal_type="Test Result Line")
...@@ -468,7 +468,7 @@ class TestTaskDistribution(ERP5TypeTestCase): ...@@ -468,7 +468,7 @@ class TestTaskDistribution(ERP5TypeTestCase):
checkTestResultLine([('testBar', 'started'), ('testFoo', 'draft')]) checkTestResultLine([('testBar', 'started'), ('testFoo', 'draft')])
self._callRestartStuckTestResultAlarm() self._callRestartStuckTestResultAlarm()
checkTestResultLine([('testBar', 'started'), ('testFoo', 'draft')]) checkTestResultLine([('testBar', 'started'), ('testFoo', 'draft')])
line_url, test = self.tool.startUnitTest(test_result_path) line_url, _ = self.tool.startUnitTest(test_result_path)
checkTestResultLine([('testBar', 'started'), ('testFoo', 'started')]) checkTestResultLine([('testBar', 'started'), ('testFoo', 'started')])
self._callRestartStuckTestResultAlarm() self._callRestartStuckTestResultAlarm()
checkTestResultLine([('testBar', 'started'), ('testFoo', 'started')]) checkTestResultLine([('testBar', 'started'), ('testFoo', 'started')])
...@@ -530,14 +530,14 @@ class TestTaskDistribution(ERP5TypeTestCase): ...@@ -530,14 +530,14 @@ class TestTaskDistribution(ERP5TypeTestCase):
now = DateTime() now = DateTime()
try: try:
self.pinDateTime(now - 1.0/24*2) self.pinDateTime(now - 1.0/24*2)
test_result_path, revision = self._createTestResult( test_result_path, _ = self._createTestResult(
test_list=['testFoo', 'testBar']) test_list=['testFoo', 'testBar'])
test_result = self.getPortalObject().unrestrictedTraverse(test_result_path) test_result = self.getPortalObject().unrestrictedTraverse(test_result_path)
self.assertEqual("started", test_result.getSimulationState()) self.assertEqual("started", test_result.getSimulationState())
node, = test_result.objectValues(portal_type="Test Result Node", node, = test_result.objectValues(portal_type="Test Result Node",
sort_on=[("title", "ascending")]) sort_on=[("title", "ascending")])
self.assertEqual("started", node.getSimulationState()) self.assertEqual("started", node.getSimulationState())
line_url, test = self.tool.startUnitTest(test_result_path) self.tool.startUnitTest(test_result_path)
# We have a failure but with recent activities on tests # We have a failure but with recent activities on tests
self.pinDateTime(now - 1.0/24*1.5) self.pinDateTime(now - 1.0/24*1.5)
self.tool.reportTaskFailure(test_result_path, {}, "Node0") self.tool.reportTaskFailure(test_result_path, {}, "Node0")
...@@ -565,15 +565,15 @@ class TestTaskDistribution(ERP5TypeTestCase): ...@@ -565,15 +565,15 @@ class TestTaskDistribution(ERP5TypeTestCase):
self.assertEqual(test_result_path, next_test_result_path) self.assertEqual(test_result_path, next_test_result_path)
def _checkCreateTestResultAndAllowRestart(self, tic=False): def _checkCreateTestResultAndAllowRestart(self, tic=False):
test_result_path, revision = self._createTestResult(test_list=["testFoo"]) test_result_path, _ = self._createTestResult(test_list=["testFoo"])
line_url, test = self.tool.startUnitTest(test_result_path) line_url, _ = self.tool.startUnitTest(test_result_path)
status_dict = {} status_dict = {}
self.tool.stopUnitTest(line_url, status_dict) self.tool.stopUnitTest(line_url, status_dict)
if tic: if tic:
self.tic() self.tic()
test_result = self.getPortalObject().unrestrictedTraverse(test_result_path) test_result = self.getPortalObject().unrestrictedTraverse(test_result_path)
self.assertEqual(None, self._createTestResult(test_list=["testFoo"])) self.assertEqual(None, self._createTestResult(test_list=["testFoo"]))
next_test_result_path, next_revision = self._createTestResult( next_test_result_path, _ = self._createTestResult(
test_list=["testFoo"], allow_restart=True) test_list=["testFoo"], allow_restart=True)
self.assertTrue(next_test_result_path != test_result_path) self.assertTrue(next_test_result_path != test_result_path)
self.tic() self.tic()
...@@ -777,8 +777,8 @@ class TestTaskDistribution(ERP5TypeTestCase): ...@@ -777,8 +777,8 @@ class TestTaskDistribution(ERP5TypeTestCase):
""" """
test_node_one, test_node_two = self._createTestNode(quantity=2, test_node_one, test_node_two = self._createTestNode(quantity=2,
specialise_value=self.performance_distributor) specialise_value=self.performance_distributor)
test_suite_one, = self._createTestSuite( test_suite_one = self._createTestSuite(
title='one', specialise_value=self.performance_distributor) title='one', specialise_value=self.performance_distributor)[0]
self._createTestSuite(title='two', reference_correction=+1, self._createTestSuite(title='two', reference_correction=+1,
specialise_value=self.performance_distributor) specialise_value=self.performance_distributor)
self.tic() self.tic()
...@@ -939,12 +939,12 @@ class TestTaskDistribution(ERP5TypeTestCase): ...@@ -939,12 +939,12 @@ class TestTaskDistribution(ERP5TypeTestCase):
test_node_module = self.test_node_module test_node_module = self.test_node_module
# Subscribe nodes # Subscribe nodes
nodes = [self.scalability_distributor.subscribeNode("COMP1-Scalability-Node1", computer_guid="COMP-1"), self.scalability_distributor.subscribeNode("COMP1-Scalability-Node1", computer_guid="COMP-1")
self.scalability_distributor.subscribeNode("COMP2-Scalability-Node2", computer_guid="COMP-2"), self.scalability_distributor.subscribeNode("COMP2-Scalability-Node2", computer_guid="COMP-2")
self.scalability_distributor.subscribeNode("COMP3-Scalability-Node3", computer_guid="COMP-3"), self.scalability_distributor.subscribeNode("COMP3-Scalability-Node3", computer_guid="COMP-3")
self.scalability_distributor.subscribeNode("COMP4-Scalability-Node4", computer_guid="COMP-4")] self.scalability_distributor.subscribeNode("COMP4-Scalability-Node4", computer_guid="COMP-4")
# Create test suite # Create test suite
test_suite = self._createTestSuite(quantity=1,priority=1, reference_correction=0, self._createTestSuite(quantity=1,priority=1, reference_correction=0,
specialise_value=self.scalability_distributor, portal_type="Scalability Test Suite") specialise_value=self.scalability_distributor, portal_type="Scalability Test Suite")
self.tic() self.tic()
self._callOptimizeAlarm() self._callOptimizeAlarm()
...@@ -1007,8 +1007,6 @@ class TestTaskDistribution(ERP5TypeTestCase): ...@@ -1007,8 +1007,6 @@ class TestTaskDistribution(ERP5TypeTestCase):
""" """
Check configuration generation Check configuration generation
""" """
test_node_module = self.test_node_module
# Subscribe nodes # Subscribe nodes
node_list = [ node_list = [
('NODE-%s' % (i,), self.scalability_distributor.subscribeNode("COMP%s-Scalability-Node%s" % (i, i), computer_guid="COMP-%s" % (i,))) for i in range(1,5) ('NODE-%s' % (i,), self.scalability_distributor.subscribeNode("COMP%s-Scalability-Node%s" % (i, i), computer_guid="COMP-%s" % (i,))) for i in range(1,5)
...@@ -1048,7 +1046,7 @@ class TestTaskDistribution(ERP5TypeTestCase): ...@@ -1048,7 +1046,7 @@ class TestTaskDistribution(ERP5TypeTestCase):
# -Generate graph coordinate # -Generate graph coordinate
graph_coordinate = range(1, len(node_list)+1) graph_coordinate = range(1, len(node_list)+1)
# -Create the test suite # -Create the test suite
test_suite = self._createTestSuite(quantity=1,priority=1, reference_correction=0, self._createTestSuite(quantity=1,priority=1, reference_correction=0,
specialise_value=self.scalability_distributor, portal_type="Scalability Test Suite", specialise_value=self.scalability_distributor, portal_type="Scalability Test Suite",
graph_coordinate=graph_coordinate, cluster_configuration=cluster_configuration) graph_coordinate=graph_coordinate, cluster_configuration=cluster_configuration)
self.tic() self.tic()
...@@ -1065,6 +1063,6 @@ class TestTaskDistribution(ERP5TypeTestCase): ...@@ -1065,6 +1063,6 @@ class TestTaskDistribution(ERP5TypeTestCase):
# # logs # # logs
## log(configuration_list) ## log(configuration_list)
def test_19_testMultiDistributor(self): def test_19_testMultiDistributor(self):
pass pass
...@@ -6,10 +6,22 @@ ...@@ -6,10 +6,22 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>testTaskDistribution</string> </value> <value> <string>testTaskDistribution</string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>test.erp5.testTaskDistribution</string> </value> <value> <string>test.erp5.testTaskDistribution</string> </value>
...@@ -24,6 +36,28 @@ ...@@ -24,6 +36,28 @@
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W:607, 4: Possible unbalanced tuple unpacking with sequence defined at line 105: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:634, 4: Possible unbalanced tuple unpacking with sequence defined at line 88: left side has 2 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:727, 4: Possible unbalanced tuple unpacking with sequence defined at line 88: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:734, 4: Possible unbalanced tuple unpacking with sequence defined at line 88: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:735, 4: Possible unbalanced tuple unpacking with sequence defined at line 88: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:742, 4: Possible unbalanced tuple unpacking with sequence defined at line 88: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:743, 4: Possible unbalanced tuple unpacking with sequence defined at line 88: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:758, 4: Possible unbalanced tuple unpacking with sequence defined at line 88: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:778, 4: Possible unbalanced tuple unpacking with sequence defined at line 88: left side has 2 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>version</string> </key> <key> <string>version</string> </key>
<value> <string>erp5</string> </value> <value> <string>erp5</string> </value>
...@@ -31,13 +65,28 @@ ...@@ -31,13 +65,28 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -50,7 +99,7 @@ ...@@ -50,7 +99,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -59,7 +108,7 @@ ...@@ -59,7 +108,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle> </pickle>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment