Commit bbedf149 authored by Roque's avatar Roque

testnode: minor changes for scalability testing

- testnode saves in its config the repositories paths
- minor refactoring and cleanup

/reviewed-on nexedi/erp5!606
parent f8d308bb
...@@ -93,9 +93,11 @@ class TestNode(object): ...@@ -93,9 +93,11 @@ class TestNode(object):
software_config_path = None software_config_path = None
profile_content_list = [] profile_content_list = []
revision_dict = dict(node_test_suite.revision_list) revision_dict = dict(node_test_suite.revision_list)
self.config['repository_path_list'] = []
for vcs_repository in node_test_suite.vcs_repository_list: for vcs_repository in node_test_suite.vcs_repository_list:
buildout_section_id = vcs_repository.get('buildout_section_id') buildout_section_id = vcs_repository.get('buildout_section_id')
repository_path = vcs_repository['repository_path'] repository_path = vcs_repository['repository_path']
self.config['repository_path_list'].append(repository_path)
try: try:
profile_path = vcs_repository[PROFILE_PATH_KEY] profile_path = vcs_repository[PROFILE_PATH_KEY]
except KeyError: except KeyError:
...@@ -119,15 +121,9 @@ class TestNode(object): ...@@ -119,15 +121,9 @@ class TestNode(object):
node_test_suite.reference) node_test_suite.reference)
repository_path = os.path.relpath(repository_path, from_path) repository_path = os.path.relpath(repository_path, from_path)
# XXX: Like in run(), code depending on specific test type must be
# moved to the test type classes. In particular, the use of a
# replacement pattern ('<obfuscated_url>') is ugly: buildout
# has cleaner ways to do that.
if test_type=="ScalabilityTest": if test_type=="ScalabilityTest":
# <obfuscated_url> word is modified by in runner.prepareSlapOSForTestSuite()
profile_content_list.append(""" profile_content_list.append("""
[%(buildout_section_id)s] [%(buildout_section_id)s]
repository = <obfuscated_url>/%(buildout_section_id)s/%(buildout_section_id)s.git
  • I'm not sure, but this seem to introduce test failure on test_scalability_04_constructProfile.

    ======================================================================
    FAIL: test_scalability_04_constructProfile (erp5.tests.testERP5TestNode.ERP5TestNode)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/srv/slapgrid/slappart9/srv/testnode/ij/inst/test0-0/parts/erp5-util/erp5/tests/testERP5TestNode.py", line 965, in test_scalability_04_constructProfile
        self.test_04_constructProfile(my_test_type)
      File "/srv/slapgrid/slappart9/srv/testnode/ij/inst/test0-0/parts/erp5-util/erp5/tests/testERP5TestNode.py", line 283, in test_04_constructProfile
        self.assertEquals(expected_profile, profile.read())
    AssertionError: '[buildout]\nextends = /tmp/tmpZFCX5_/testnode/foo/rep0/software.cfg\n\n[rep1]\nrepository = <obfuscated_url>/rep1/rep1.git\nrevision = azerty\nignore-ssl-certificate = true\ndevelop = false\nshared = true\n\n[rep2]\nrepository = <obfuscated_url>/rep2/rep2.git\nrevision = qwerty\nignore-ssl-certificate = true\ndevelop = false\nshared = true\n' != '[buildout]\nextends = /tmp/tmpZFCX5_/testnode/foo/rep0/software.cfg\n\n[rep1]\nrevision = azerty\nignore-ssl-certificate = true\ndevelop = false\nshared = true\n\n[rep2]\nrevision = qwerty\nignore-ssl-certificate = true\ndevelop = false\nshared = true\n'

    Can you please check if this test needs to be updated as well ?

Please register or sign in to reply
revision = %(revision)s revision = %(revision)s
ignore-ssl-certificate = true ignore-ssl-certificate = true
develop = false develop = false
...@@ -264,7 +260,7 @@ shared = true ...@@ -264,7 +260,7 @@ shared = true
begin = time.time() begin = time.time()
taskdistributor = taskdistribution.TaskDistributor( taskdistributor = taskdistribution.TaskDistributor(
portal_url, logger=logger) portal_url, logger=logger)
self.test_suite_portal = taskdistributor # XXX ScalabilityTest self.taskdistribution = taskdistributor
node_configuration = taskdistributor.subscribeNode( node_configuration = taskdistributor.subscribeNode(
node_title=config['test_node_title'], node_title=config['test_node_title'],
computer_guid=config['computer_id']) computer_guid=config['computer_id'])
......
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