test_result: allow to define slapos parameters in test suites
<?xml version="1.0"?> | |||
<ZopeData> | |||
<record id="1" aka="AAAAAAAAAAE="> | |||
<pickle> | |||
<global name="TextAreaField" module="Products.Formulator.StandardFields"/> | |||
</pickle> | |||
<pickle> | |||
<dictionary> | |||
<item> | |||
<key> <string>id</string> </key> | |||
<value> <string>my_cluster_configuration</string> </value> | |||
</item> | |||
<item> | |||
<key> <string>message_values</string> </key> | |||
<value> | |||
<dictionary> | |||
<item> | |||
<key> <string>external_validator_failed</string> </key> | |||
<value> <string>Please use correct JSON syntax.</string> </value> | |||
</item> | |||
<item> | |||
<key> <string>line_too_long</string> </key> | |||
<value> <string>A line was too long.</string> </value> | |||
</item> | |||
<item> | |||
<key> <string>required_not_found</string> </key> | |||
<value> <string>Input is required but no input given.</string> </value> | |||
</item> | |||
<item> | |||
<key> <string>too_long</string> </key> | |||
<value> <string>You entered too many characters.</string> </value> | |||
</item> | |||
<item> | |||
<key> <string>too_many_lines</string> </key> | |||
<value> <string>You entered too many lines.</string> </value> | |||
</item> | |||
</dictionary> | |||
</value> | |||
</item> | |||
<item> | |||
<key> <string>overrides</string> </key> | |||
<value> | |||
<dictionary> | |||
<item> | |||
<key> <string>alternate_name</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>css_class</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>default</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>description</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>editable</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>enabled</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>external_validator</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>extra</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>height</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>hidden</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>max_length</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>max_linelength</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>max_lines</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>required</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>title</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>unicode</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>whitespace_preserve</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>width</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
</dictionary> | |||
</value> | |||
</item> | |||
<item> | |||
<key> <string>tales</string> </key> | |||
<value> | |||
<dictionary> | |||
<item> | |||
<key> <string>alternate_name</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>css_class</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>default</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>description</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>editable</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>enabled</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>external_validator</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>extra</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>height</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>hidden</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>max_length</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>max_linelength</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>max_lines</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>required</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>title</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>unicode</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>whitespace_preserve</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>width</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
</dictionary> | |||
</value> | |||
</item> | |||
<item> | |||
<key> <string>values</string> </key> | |||
<value> | |||
<dictionary> | |||
<item> | |||
<key> <string>alternate_name</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>css_class</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>default</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>description</string> </key> | |||
<value> <string>Slapos parameters.\n | |||
\n | |||
Configuration structure has to look like a python dict, ex:\n | |||
\n | |||
{\n | |||
"x": "xxx",\n | |||
"y":{\n | |||
"q": "qqq",\n | |||
"r": "rrr"\n | |||
},\n | |||
"z", "zzz"\n | |||
}</string> </value> | |||
</item> | |||
<item> | |||
<key> <string>editable</string> </key> | |||
<value> <int>1</int> </value> | |||
</item> | |||
<item> | |||
<key> <string>enabled</string> </key> | |||
<value> <int>1</int> </value> | |||
</item> | |||
<item> | |||
<key> <string>external_validator</string> </key> | |||
<value> | |||
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> | |||
</value> | |||
</item> | |||
<item> | |||
<key> <string>extra</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>height</string> </key> | |||
<value> <int>10</int> </value> | |||
</item> | |||
<item> | |||
<key> <string>hidden</string> </key> | |||
<value> <int>0</int> </value> | |||
</item> | |||
<item> | |||
<key> <string>max_length</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>max_linelength</string> </key> | |||
<value> <int>80</int> </value> | |||
|
|||
</item> | |||
<item> | |||
<key> <string>max_lines</string> </key> | |||
<value> <string></string> </value> | |||
</item> | |||
<item> | |||
<key> <string>required</string> </key> | |||
<value> <int>0</int> </value> | |||
</item> | |||
<item> | |||
<key> <string>title</string> </key> | |||
<value> <string>Slapos Parameters</string> </value> | |||
</item> | |||
<item> | |||
<key> <string>unicode</string> </key> | |||
<value> <int>0</int> </value> | |||
</item> | |||
<item> | |||
<key> <string>whitespace_preserve</string> </key> | |||
<value> <int>1</int> </value> | |||
</item> | |||
<item> | |||
<key> <string>width</string> </key> | |||
<value> <int>80</int> </value> | |||
</item> | |||
</dictionary> | |||
</value> | |||
</item> | |||
</dictionary> | |||
</pickle> | |||
</record> | |||
<record id="2" aka="AAAAAAAAAAI="> | |||
<pickle> | |||
<global name="Method" module="Products.Formulator.MethodField"/> | |||
</pickle> | |||
<pickle> | |||
<dictionary> | |||
<item> | |||
<key> <string>method_name</string> </key> | |||
<value> <string>Base_validateJSON</string> </value> | |||
</item> | |||
</dictionary> | |||
</pickle> | |||
</record> | |||
</ZopeData> |
... | @@ -104,9 +104,10 @@ class TestTaskDistribution(ERP5TypeTestCase): | ... | @@ -104,9 +104,10 @@ class TestTaskDistribution(ERP5TypeTestCase): |
int_index = priority, | int_index = priority, | ||
specialise_value = specialise_value, | specialise_value = specialise_value, | ||
) | ) | ||
test_suite.setClusterConfiguration(cluster_configuration) | |||
if portal_type == "Scalability Test Suite": | if portal_type == "Scalability Test Suite": | ||
test_suite.setGraphCoordinate(graph_coordinate) | test_suite.setGraphCoordinate(graph_coordinate) | ||
test_suite.setClusterConfiguration(cluster_configuration) | |||
test_suite.newContent( portal_type= 'Test Suite Repository', | test_suite.newContent( portal_type= 'Test Suite Repository', | ||
... | @@ -391,6 +392,19 @@ class TestTaskDistribution(ERP5TypeTestCase): | ... | @@ -391,6 +392,19 @@ class TestTaskDistribution(ERP5TypeTestCase): |
def test_10_cancelTestResult(self): | def test_10_cancelTestResult(self): | ||
pass | pass | ||
def test_10b_generateConfiguration(self): | |||
|
|||
""" | |||
It shall be possible on a test suite to define configuration we would like | |||
to use to create slapos instance. | |||
""" | |||
test_suite, = self._createTestSuite(cluster_configuration=None) | |||
self.tic() | |||
self.assertEquals('{"configuration_list": [{}]}', self.distributor.generateConfiguration(test_suite.getTitle())) | |||
test_suite.setClusterConfiguration("{'foo': 3}") | |||
self.assertEquals('{"configuration_list": [{}]}', self.distributor.generateConfiguration(test_suite.getTitle())) | |||
test_suite.setClusterConfiguration('{"foo": 3}') | |||
self.assertEquals('{"configuration_list": [{"foo": 3}]}', self.distributor.generateConfiguration(test_suite.getTitle())) | |||
def _checkTestSuiteAggregateList(self, *args): | def _checkTestSuiteAggregateList(self, *args): | ||
self.tic() | self.tic() | ||
self._callOptimizeAlarm() | self._callOptimizeAlarm() | ||
... | ... |