1. 08 Oct, 2019 4 commits
    • Jérome Perrin's avatar
      testnode: pass shared_part_list to runTestSuite who understand it · 8236b6f0
      Jérome Perrin authored
      Some test suites who install software during the test, such as SLAPOS-SR
      tests, could benefit from reusing already installed shared parts.
      
      The convention is that --shared_part_list is a os.pathsep (:) separated
      list of paths of read-only shared parts in which the test is not allowed
      to write.
      8236b6f0
    • Jérome Perrin's avatar
      testnode: SlapOS shared parts support · 82e3cb34
      Jérome Perrin authored
      Shared parts speed up compilation time and is becoming the standard in
      SlapOS software installations, so it makes sense to use it in our test
      nodes, as it also gives one more opportunity to test this feature.
      
      erp5testnode configuration file supports a new shared_part_list option,
      that can be set to a \n separated list of paths to use for shared parts,
      following the same rules as slapos.core and slapos.recipe.cmmi (ie. the
      first ones are read-only and the last one is read-write).
      
      This shared_part_list option will be set in slapos.cfg used to compile
      both the "software for testnode" (ie. selenium-runner) and later the
      softwares under tests.
      The software under tests will also use a local directory for each test
      suite to install shared suite.
      
      The directory structure is now:
      
        srv/
          shared/
            (shared parts to install selenium runner)
          slapos/
            soft/
              (selenium-runner software)
          testnode/
            foo/ # test suite with reference foo
              inst/
                (partitions of tested software)
              shared/
                (shared parts to install tested software)
              soft/
                (tested software)
      
      and in the configuration srv/shared will be set as initial
      shared_part_list.
      
      When installing selenium-runner, srv/shared/ is used to write shared
      parts. These shared parts are never removed.
      
      When installing software under test, srv/shared/ and
      srv/testnode/foo/shared/ are used. If parts are found in srv/shared they
      are used, if they are not found, they are installed in
      srv/testnode/foo/shared/.
      
      In practice, this should mean that the shared parts installed by
      selenium-runner will be reused for all tested softwares and this should
      speed up initial installation of these softwares.
      
      Currently, nothing is implemented regarding removal of unused shared
      parts, but in our case:
       - srv/testnode/foo/shared/ will be removed when "foo" is removed.
       - srv/shared/ should be used only when installing selenium-runner.
      
      If this starts to use too much disk space, one quick and dirty
      workaround could be to destroy the test node instance and re-create it.
      82e3cb34
    • Jérome Perrin's avatar
      testnode: python3 support · b53ef5e5
      Jérome Perrin authored
      pkg_resources.resource_string reads the file as binary, if we want to
      substitute in this string we need to decode it.
      b53ef5e5
    • Jérome Perrin's avatar
  2. 07 Oct, 2019 7 commits
  3. 05 Oct, 2019 3 commits
  4. 04 Oct, 2019 5 commits
    • Julien Muchembled's avatar
      Optimize WorkflowHistoryList · 1ca655a3
      Julien Muchembled authored
      This is done by inheriting most of the code of ConflictFreeLog,
      i.e. using a doubly-linked list:
      - for fast iteration of the first elements, and in particular
        immediate access to the first element (used for creation date);
      - that keeps track of the history length;
      - that implement fast reverse iteration (although it could
        have been done without changing the data structure).
      
      The size of buckets is not fixed anymore to 16 items:
      like ConflictFreeLog, WorkflowHistoryList is also a good candidate
      to look at the estimated serialized size of the bucket in order to
      decide if elements should be added to a new one or not.
      Then developers won't have to care about using Pdata or not.
      
      The size is bigger than the ConflictFreeLog default,
      because workflow items look a lot alike and adding
      a few more is cheap when the ZODB compresses.
      
      No more optimized __getstate__ (except for workflow histories that
      have not been migrated) so BT export will be a bit more verbose.
      
      The BBB code is because of
        nexedi/erp5!934
      
      /reviewed-on nexedi/erp5!941
      1ca655a3
    • Arnaud Fontaine's avatar
      ZODB Components: Before migrating Interfaces from FS, there must be one... · 694c9fee
      Arnaud Fontaine authored
      ZODB Components: Before migrating Interfaces from FS, there must be one Interface class per source file matching its name.
      
      Same as Document class: this avoids registering Interfaces at startup and just do it
      when using the Interface. In assuming that portal_components/XXX has a class
      name equals to XXX.getRference(), it is easier to:
       * List all existing Interfaces (for example in Portal Type Class view): getReference()
         on all validated 'Interface Component' in portal_components.
       * Lookup for an 'Interface Component': 'from erp5.component.interfaces.XXX import XXX'.
      694c9fee
    • Arnaud Fontaine's avatar
      ZODB Components: Properly handle addition of template_* properties in... · d9627917
      Arnaud Fontaine authored
      ZODB Components: Properly handle addition of template_* properties in BusinessTemplate PropertySheet.
      
      On the plus side, this avoids an ugly 'except AttributeError: pass' which does
      not work anyway with the scenario below.
      
      Assuming the following:
        * template_XXX Property (accessor: getTemplateXXX) recently added to BusinessTemplate PropertySheet.
        * erp5_YYY sets template_A Property (erp5_YYY/bt/template_XXX.xml).
        This commit handles the following:
          1. Stop instance with old ERP5 without template_XXX.
          2. Update erp5.git.
          3. Start instance.
          4. Upgrade erp5_property_sheets and erp5_YYY bt5s in *one* transaction from portal_templates UI.
          => When upgrading erp5_YYY, BusinessTemplate.importFile() imports erp5_YYY/bt/*.xml where the
             list of files is based on BusinessTemplate class propertyMap(), but at this point accessors
             have not been re-generated yet, thus template_XXX is not returned by propertyMap() and
             erp5_YYY/bt/template_XXX.xml is not imported.
             => portal_templates/erp5_YYY new BT does not have template_XXX property set at all.
      d9627917
    • Ivan Tyagov's avatar
      Default ERP5 instanciation uses following schema for naming all zope nodes: · 0a66e514
      Ivan Tyagov authored
        <family_name>-0..9 when number of nodes <= 10
        <family_name>-01..09 (or n) when number of nodes > 10
      
      In scalability tests instance keeps track of old used nodes and when nodes > 10
      will pick by default sort "activity-0" which is NO longer an existing zope process.
      This is an ugly fix and real woraround is to have something like activities-000x schema by default
      0a66e514
    • Arnaud Fontaine's avatar
      runUnitTest: 6f1c45c6 wrongly assumed that '--erp5_sql_connection_string' is always passed. · a3c40d0b
      Arnaud Fontaine authored
      This is the case with runUnitTest wrapper created by SlapOS but is not actually required
      as manage_addERP5Site has 'test test' as default value.
      
      This fixes:
        File "custom_zodb.py", line 70, in <module>
          sql_db = Products.ZMySQLDA.db.DB(os.environ['erp5_sql_connection_string'])
        File "UserDict.py", line 40, in __getitem__
          raise KeyError(key)
      KeyError: 'erp5_sql_connection_string'
      a3c40d0b
  5. 03 Oct, 2019 3 commits
  6. 02 Oct, 2019 18 commits