Commit b955dbe0 authored by Arnaud Fontaine's avatar Arnaud Fontaine

testFunctionalConfigurator: Fix failures.

* Instead of Person.reference, Person.user_id is now used to log in (fe27a9c3).
* Fields text were renamed to follow naming conventions (329c196d).
parent 65d9808c
......@@ -9,8 +9,7 @@ portal = context.getPortalObject()
reference = editor
# check this is a not a reference from acl_user
if portal.acl_users.getUserById(reference) is not None or \
portal.aq_parent.acl_users.getUserById(reference) is not None:
if portal.acl_users.searchUsers(login=reference, exact_match=True):
return 0
# first check if a Business Configuration has not already "reserved" it
......
......@@ -246,7 +246,7 @@
</tr>
<tr>
<td>verifyTextPresent</td>
<td>What is the name of your company?</td>
<td>What is the Name of your Company?</td>
<td>
<br>
</td>
......@@ -468,7 +468,7 @@
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Select the number of user accounts you want to configure</td>
<td>Select the Number of User Accounts you Want to Configure</td>
<td>
<br>
</td>
......@@ -562,7 +562,7 @@
</tr>
<tr>
<td>verifyTextPresent</td>
<td>What is the name of your company?</td>
<td>What is the Name of your Company?</td>
<td>
<br>
</td>
......@@ -728,7 +728,7 @@
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Select the number of user accounts you want to configure</td>
<td>Select the Number of User Accounts you Want to Configure</td>
<td>
<br>
</td>
......@@ -1072,7 +1072,7 @@
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Which accouting plan do you use?</td>
<td>Which Accounting Plan do you Use</td>
<td>
<br>
</td>
......@@ -1100,21 +1100,21 @@
</tr>
<tr>
<td>verifyTextPresent</td>
<td>What is the begin date of your current accounting period?</td>
<td>What is the Begin Date of your Current Accounting Period?</td>
<td>
<br>
</td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>What will be the end date of your current accounting period?</td>
<td>What will be the End Date of your Current Accounting Period?</td>
<td>
<br>
</td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>What is the name of this period?</td>
<td>What is the Name of this Period?</td>
<td>
<br>
</td>
......@@ -1146,7 +1146,7 @@
<tr>
<td>verifyValue</td>
<td>//input[@name="subfield_field_your_period_start_date_year"]</td>
<td>2012</td>
<td tal:content="python: DateTime().year()"></td>
</tr>
<tr>
<td>verifyValue</td>
......@@ -1161,7 +1161,7 @@
<tr>
<td>verifyValue</td>
<td>//input[@name="subfield_field_your_period_stop_date_year"]</td>
<td>2012</td>
<td tal:content="python: DateTime().year()"></td>
</tr>
<tr>
<td>verifyValue</td>
......@@ -1176,7 +1176,12 @@
<tr>
<td>verifyValue</td>
<td>//input[@name="field_your_period_title"]</td>
<td>2012</td>
<td tal:content="python: DateTime().year()"></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name="field_your_accounting_plan"]</td>
<td>IAS-IFRS Compliant</td>
</tr>
<tr>
<td>clickAndWait</td>
......@@ -1262,28 +1267,28 @@
</tr>
<tr>
<td>verifyTextPresent</td>
<td>What email address should be used as From email address for automatically generated emails?</td>
<td>What Sender Address should be Used for Automatically Generated Emails?</td>
<td>
<br>
</td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>What is the currency used in your company?</td>
<td>What is the Currency Used in your Company?</td>
<td>
<br>
</td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Which date format do you use?</td>
<td>Which Date Format do you Use?</td>
<td>
<br>
</td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Which translations do you want to use?</td>
<td>Which Translations do you Want to Use?</td>
<td>
<br>
</td>
......
......@@ -361,7 +361,7 @@
</tr>
<tr>
<td>verifyTextPresent</td>
<td>What is the name of your company?</td>
<td>What is the Name of your Company?</td>
<td> </td>
</tr>
<tr>
......@@ -561,7 +561,7 @@
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Select the number of user accounts you want to configure</td>
<td>Select the Number of User Accounts you Want to Configure</td>
<td> </td>
</tr>
<tr>
......@@ -641,7 +641,7 @@
</tr>
<tr>
<td>verifyTextPresent</td>
<td>What is the name of your company?</td>
<td>What is the Name of your Company?</td>
<td> </td>
</tr>
<tr>
......@@ -781,7 +781,7 @@
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Select the number of user accounts you want to configure</td>
<td>Select the Number of User Accounts you Want to Configure</td>
<td> </td>
</tr>
<tr>
......@@ -1058,7 +1058,7 @@
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Which accouting plan do you use?</td>
<td>Which Accounting Plan do you Use</td>
<td> </td>
</tr>
<tr>
......@@ -1078,17 +1078,17 @@
</tr>
<tr>
<td>verifyTextPresent</td>
<td>What is the begin date of your current accounting period?</td>
<td>What is the Begin Date of your Current Accounting Period?</td>
<td> </td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>What will be the end date of your current accounting period?</td>
<td>What will be the End Date of your Current Accounting Period?</td>
<td> </td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>What is the name of this period?</td>
<td>What is the Name of this Period?</td>
<td> </td>
</tr>
<tr>
......@@ -1114,8 +1114,7 @@
<tr>
<td>verifyValue</td>
<td>//input[@name=&quot;subfield_field_your_period_start_date_year&quot;]</td>
<td tal:content="python:
modules['DateTime'].DateTime(modules['DateTime'].DateTime().year(), 1, 1).strftime('%Y')"> </td>
<td tal:content="python: DateTime().year()"></td>
</tr>
<tr>
<td>verifyValue</td>
......@@ -1130,7 +1129,7 @@
<tr>
<td>verifyValue</td>
<td>//input[@name=&quot;subfield_field_your_period_stop_date_year&quot;]</td>
<td tal:content="python: modules['DateTime'].DateTime(modules['DateTime'].DateTime().year(), 1, 1).strftime('%Y')"> </td>
<td tal:content="python: DateTime().year()"></td>
</tr>
<tr>
<td>verifyValue</td>
......@@ -1145,7 +1144,7 @@
<tr>
<td>verifyValue</td>
<td>//input[@name=&quot;field_your_period_title&quot;]</td>
<td tal:content="python: modules['DateTime'].DateTime(modules['DateTime'].DateTime().year(), 1, 1).strftime('%Y')"> </td>
<td tal:content="python: DateTime().year()"></td>
</tr>
<tr>
<td>clickAndWait</td>
......@@ -1215,22 +1214,22 @@
</tr>
<tr>
<td>verifyTextPresent</td>
<td>What email address should be used as From email address for automatically generated emails?</td>
<td>What Sender Address should be Used for Automatically Generated Emails?</td>
<td> </td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>What is the currency used in your company?</td>
<td>What is the Currency Used in your Company?</td>
<td> </td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Which date format do you use?</td>
<td>Which Date Format do you Use?</td>
<td> </td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Which translations do you want to use?</td>
<td>Which Translations do you Want to Use?</td>
<td> </td>
</tr>
<tr>
......
......@@ -42,12 +42,15 @@ business_configuration = context.business_configuration_module.newContent(
business_configuration.setResource(workflow_path)
# (Re)Create the Person with already used login.
kw = dict(portal_type="Person",
# (Re)Create the Person and its ERP5 Login used to check that for user login
# (ERP5 Login.reference) unicity
kw = dict(portal_type="ERP5 Login",
reference=customer_user1_used_reference)
person = context.portal_catalog.getResultValue(**kw)
if person is None:
context.person_module.newContent(**kw)
erp5_login = context.portal_catalog.getResultValue(**kw)
if erp5_login is None:
erp5_login = context.person_module.newContent(portal_type='Person').newContent(**kw)
if erp5_login.getValidationState() != 'validated':
erp5_login.validate()
kw['reference'] = customer_user1_reference
person = context.portal_catalog.getResultValue(**kw)
......
......@@ -11284,7 +11284,7 @@ msgstr "Sélectionnez le document approprié dans la liste."
msgid "Select non reconciled transcations finished"
msgstr "Selection des écritures non rapprochées terminée"
msgid "Select the number of user accounts you want to configure"
msgid "Select the Number of User Accounts you Want to Configure"
msgstr "Sélectionnez le nombre de comptes utilisateur à configurer"
msgid "Sell"
......@@ -14590,19 +14590,19 @@ msgstr "Bienvenue. Vous êtes connecté."
msgid "What email address should be used as From email address for automatically generated emails?"
msgstr "Quelle adresse email souhaitez vous utilisez pour les envois automatiques d'emails depuis votre instance? (pour la GRC par exemple)"
msgid "What is the begin date of your current accounting period?"
msgid "What is the Begin Date of your Current Accounting Period?"
msgstr "A quelle date a débuté votre exercice en cours?"
msgid "What is the currency used in your company?"
msgid "What is the Currency Used in your Company?"
msgstr "Quelle devise souhaitez vous utiliser?"
msgid "What is the name of this period?"
msgid "What is the Name of this Period?"
msgstr "Quel nom souhaitez vous utiliser pour cette période?"
msgid "What is the name of your company?"
msgid "What is the Name of your Company?"
msgstr "Quel est le nom de votre entreprise?"
msgid "What will be the end date of your current accounting period?"
msgid "What will be the End Date of your Current Accounting Period?"
msgstr "Quelle est la date de fin de votre exercice en cours?"
msgid "When a user of ERP5 wants to materialize a purchase that has been done by his company, he or she should use a purchase order. Purchase orders contain some general information about the buyer and the seller, and contain purchase order lines."
......@@ -14614,13 +14614,13 @@ msgstr "salarié qui n'est pas physiquement présent sur son lieu de travail."
msgid "When the employee is present physically at work, and he is not in overtime"
msgstr "Le salarié est présent physiquement sur son lieu de travail et n'est pas en heures supplémentaires"
msgid "Which accouting plan do you use?"
msgid "Which Accounting Plan do you Use"
msgstr "Quel plan comptable souhaitez vous utiliser?"
msgid "Which date format do you use?"
msgid "Which Date Format do you Use?"
msgstr "Quel format souhaitez vous utiliser pour vos dates?"
msgid "Which translations do you want to use?"
msgid "Which Translations do you Want to Use?"
msgstr "Quelles langues souhaitez vous utiliser?"
msgid "Width"
......
......@@ -85,7 +85,6 @@ class ERP5(_ERP5):
or test_case in ('testERP5LdapCatalog', # XXX (Ivan), until LDAP server is available this test will alway fail
# tests reading selenium tables from erp5.com
# not maintained
'testFunctionalConfigurator',
'testFunctionalConfiguratorConsulting',
'testERP5eGov',
'testAccounting_l10n_fr_m9',
......
  • This introduces a new "Proxy Error" failure (maybe only on slow test machines)

    https://nexedi.erp5.net/test_result_module/20181015-54E69FE5/244?

    This is related to slapos!374 (merged)

    Apparently the tests sometimes timeout on apache. For example this test. In that case where we don't consume resource on shared frontend, I don't really see the point of having apache defaults 300 second timeout and I'm considering using a much larger Timeout, maybe still coupled with RequestReadTimeout to protect from buggy / malicious clients (if this is really enough to replace mod_antiloris . This will be for later if this appear to really be a problem.

    So this confirms that we should set a larger timeout on this apache.

  • Jérome Perrin @jerome

    mentioned in merge request slapos!377

    ·

    mentioned in merge request slapos!377

    Toggle commit list
  • In fact it's not a timeout problem, on the Standard Output field, we can see :

    ERROR ID : 1539593663.390.876482574794
    TRACEBACK :
    Traceback (innermost last):
      Module Products.CMFActivity.ActivityTool, line 357, in __call__
        result = method(*self.args, **self.kw)
      Module Products.ERP5Type.Base, line 2600, in fixConsistency
        return self.checkConsistency(fixit=True, filter=filter, **kw)
      Module Products.ERP5Type.Core.Folder, line 1356, in checkConsistency
        error_list += Base.checkConsistency(self, fixit=fixit, filter=filter, **kw)
      Module Products.ERP5Type.Base, line 2562, in checkConsistency
        error_list = UnrestrictedMethod(self._checkConsistency)(fixit=fixit)
      Module Products.ERP5Type.UnrestrictedMethod, line 70, in unrestricted_apply
        return function(*args, **kw)
      Module Products.ERP5Configurator.Document.StandardBT5ConfiguratorItem, line 84, in _checkConsistency
        activate=True)
      Module Products.ERP5.Tool.TemplateTool, line 1210, in installBusinessTemplateListFromRepository
        template_list)
      Module Products.ERP5.Tool.TemplateTool, line 1157, in resolveBusinessTemplateListDependency
        with_test_dependency_list):
      Module Products.ERP5Type.Cache, line 373, in wrapper
        cache[subkey] = result = function(*args, **kw)
      Module Products.ERP5.Tool.TemplateTool, line 837, in getDependencyList
        raise BusinessTemplateMissingDependency, 'While analysing %s the following dependency could not be satisfied: %s (%s)\nReason: Business Template could not be found in the repositories'%(bt[1], dependency, version_restriction or '')
    BusinessTemplateMissingDependency: While analysing erp5_dhtml_style the following dependency could not be satisfied: erp5_xhtml_style ()
    Reason: Business Template could not be found in the repositories
  • I think this is a problem we talked about at the office last time, namely that product/ERP5/bootstrap is not set properly in the test instance.

  • Ah yes I remember we talked a bit about this. From the traceback it also looks this can be the reason.

  • More precisely, in my instance product/ERP5/bootstrap is not in in erp5_tests_bt5_path environment variable SOFTWARE_RELEASE/bin/runUnitTest (which in turn calls product/ERP5Type/tests/runUnitTest.py setting TemplateTool.updateRepositoryBusinessTemplateList() based on this environment variable value). It seems that current stack/erp5/buildout.cfg still has this issue. What about this (completely untested):

    diff --git a/stack/erp5/buildout.cfg b/stack/erp5/buildout.cfg
    index fcfd940ba..6dae063e6 100644
    --- a/stack/erp5/buildout.cfg
    +++ b/stack/erp5/buildout.cfg
    @@ -405,12 +405,9 @@ initialization =
       os.environ['SOFTWARE_HOME'] = os.path.abspath(imp.find_module('Zope2')[1])
       os.environ['ZOPE_SCRIPTS'] = ''
       parts_directory = '''${buildout:parts-directory}'''
    -  repository_id_list = \
    -    '''${erp5_repository_list:repository_id_list}'''.split()[::-1]
       os.environ['erp5_tests_bt5_path'] = ','.join(sum((
         [bt5_path, os.path.join(bt5_path, '*')]
    -    for bt5_path in (os.path.join(parts_directory, x, 'bt5')
    -                     for x in repository_id_list)), []))
    +    for bt5_path in ${bt5-repository:list}.split()),[]))
       extra_path_list = '''${:extra-paths}'''.split()
       sys.path[:0] = sum((
         glob.glob(os.path.join(x, 'tests'))

    Not sure why we need 'BT5_REPOSITORY_PATH/*' though, will check later.

    Edited by Arnaud Fontaine
  • Thanks

    There's also erp5_tests_bootstrap_path that should default to getBootstrapDirectory(), so the updateRepositoryBusinessTemplateList done here should be OK.

    I have a runUnitTest instance and it includes ...parts/erp5/product/ERP5/bootstrap as expected.

    Why does testFunctionalConfigurator needs to call updateRepositoryBusinessTemplateList in setup ? Maybe @rafael remembers ? This might be the problem here.

    Note that there's also same pattern in testFunctionalConfiguratorConsulting, so if we fix we can fix both.

    What we can try is to remove this and see if it make the test pass.

    Also, after looking at this code, I feel the way our test framework manages business template repository does not have to be so complex.


    Not sure why we need 'BT5_REPOSITORY_PATH/*' though, will check later.

    You are right, this is probably not needed, because runUnitTest always issue warning like:

    Ignoring non existing bt5 path None
    Ignoring non existing bt5 path /srv/slapgrid/slappart8/srv/runner/software/287375f0cba269902ba1bc50242839d7/parts/erp5/bt5/*
  • @jerome I don't remember exactly but I think yes. The configuration process assume that portal_templates are well configured and updateRepositoryB...T... was called before (maybe I'm wrong but I'm nearly from sure that yes).

    test...ConfiguratorConsulting is a variation of the testFuncionalConfigurator, so they follow the same pattter to boostrap.

  • mentioned in commit 639b33d6

    Toggle commit list
  • mentioned in commit 9212f985

    Toggle commit list
  • I tried that patch again 9212f985 with a longer apache timeout and it does not finish either https://nexedi.erp5.net/test_result_module/20181024-10AFB6BC/244

    @arnau we'll try to look at this tomorrow.

  • Wow. With 9212f985 , when running test locally, in the log we can see:

    2018-10-25 10:01:20.708 INFO TemplateTool.updateBusinessTemplateFromUrl Updated erp5_mysql_innodb_catalog from http://www.erp5.org/dists/snapshot/bt5//erp5_mysql_innodb_catalog.bt5

    Apparently because of https://lab.nexedi.com/nexedi/erp5/blob/b955dbe00fee6e0afdb4187399376ba9747c0575/bt5/erp5_configurator_standard_ui_test/SkinTemplateItem/portal_skins/erp5_configurator_standard_ui_test/Zuite_setUpConfigurationTest.py#L27-30

    configurator is installing business templates from http://www.erp5.org/dists/snapshot/bt5/ , but this is not updated.

    There are a few others "www.erp5.org/dists/snapshot" in the code... One is in testBusinessTemplate and seems needed to prove that we can install bt5 over http, so it would be hard to change this.

    for others:

    [ edit: fix indentation ]

    Edited by Jérome Perrin
  • Ah and http://www.erp5.org/dists/snapshot/bt5/ is not updated the files modification dates are today, but the business templates are maybe from svn, maybe from git.erp5.org.

  • There's also erp5_tests_bootstrap_path that should default to getBootstrapDirectory(), so the updateRepositoryBusinessTemplateList done here should be OK.

    This is done only for tests in from business templates (is there a reason ?), that's why test is still failing.

    One simple fix could be 9212f985 + moving the test to business template.

  • cc @xiaowu.zhang this might be the OSOE tests you are looking for

  • Ah and http://www.erp5.org/dists/snapshot/bt5/ is not updated the files modification dates are today, but the business templates are maybe from svn, maybe from git.erp5.org.

    It seems to be from SVN considering that the are not hashes but integers. @nexedi so if we still need support for remote bt5 repositories, who has access to www.erp5.org/dists/snapshot/bt5/ and could update the script to use git.erp5.org and not SVN?

  • I don't have access to this server and I don't know who can have access ( maybe @kazuhiko ? ) If we fix this, we'll also need a valid SSL certificate.

    /cc @nexedi

  • I guess this "www.erp5.org/dists/snapshot/bt5/" can be dropped. No one uses it.

    Better setup a new location with a new URL if needed.

  • mentioned in commit 5be8733c

    Toggle commit list
  • testFunctionalConfigurator now passes with 5be8733c and jerome/slapos@7671b6ff.

  • The slapos change to increase test runner's apache timeout was applied to master as slapos@fce3c74a this test should be OK next time.

  • mentioned in commit jerome/slapos@7671b6ff

    Toggle commit list
  • So, if I understand correctly, the timeout was increased to make the test pass because one query take an "infinite" time? But, when this functionnality will be really used on a production environnment, it will not work, because the frontend will raise a timeout. What is the improvement in such case?

  • @romain: If we look at a failing test ( example https://nexedi.erp5.net/test_result_module/20181024-10AFB6BC/244 ) we can see that the failing step was on waiting for Zuite_waitForActivities, which is the script we use (only) in functional test to wait for all pending activities to be processed, as they are not executed automatically in the background. So it's just the "synchronously wait for all activities" (which only exist in tests) that takes more than the default 1 minute timeout.

    For "real users" there is no timeout, because activities happens in the background. There's even a nice progress bar displayed during this step based (if I remember coreclty) on the number of remaining activities.

  • Also about the "What is the improvement in such case?", even though it was agreed (if I understand correctly) that ERP5's default timeout of 1 minute was a bug and there should be no timeout on POST requests, this does not change anything regarding this situation. This apache configuration only applies for the "apache in front of test runner's zserver" introduced in slapos!374 (merged) in other words, only for tests.

    For reference, the patch was extracted from slapos!377 which also have some other changes to apache ( but is on hold waiting for new Zope release), does not change the "default" timeout either.

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