1. 29 May, 2024 8 commits
    • Kazuhiko Shiozaki's avatar
    • Jérome Perrin's avatar
      base: fix lxml usage in ImageUtil · e5a4c0d3
      Jérome Perrin authored
      e5a4c0d3
    • Jérome Perrin's avatar
      hal_json_style: remove useless log in Base_callDialogMethod · 0f602c87
      Jérome Perrin authored
      for same reason as the xhtml_style version, there is no problem with
      having more than one listbox, see d2dedca3 (core: remove useless log
      in Base_callDialogMethod, 2020-07-03)
      0f602c87
    • Carlos Ramos Carreño's avatar
      Fixes the error in test_onErrorCallback. · 8ef5c5a7
      Carlos Ramos Carreño authored
      The test testCMFActivity.TestCMFActivity.test_onErrorCallback was
      failing because some weak references were not dropped.
      The reason was that _DequeueMessageException was declared as global
      and it kept a traceback including the variables pointed by the weak
      references, preventing their garbage collection.
      This was fixed by using a class for the _DequeueMessageException
      instead of a singleton, and creating a new instance on every raise.
      8ef5c5a7
    • Jérome Perrin's avatar
      testCMFActivity: support pickle protocol > 0 in test_insert_max_payload · 17fb5fbf
      Jérome Perrin authored
      This test assumed that activating a method with a string of length `n+x`
      as argument would be serialized in `x` more bytes that activating the
      same method with a string of length `n` as argument, which is only true
      for protocol 0 for multiple reasons ( short strings and long strings
      are serialized differently, "frames" are used with protocol 5) and
      db.string_literal seems to introduce a difference.
      
      Change the test to mock Message.dump to produce longer dumps instead of
      relying on this assumption.
      17fb5fbf
    • Jérome Perrin's avatar
      testCMFActivity: do not rely on unittest internals (_resultForDoCleanups) · 8fed5319
      Jérome Perrin authored
      _resultForDoCleanups no longer exists on python3, getting the status
      of a test in teardown is very different accross python versions ( see
      https://stackoverflow.com/q/4414234 ) and just executing this code when
      the test failed only has the problem that a test method may count as
      two failures or errors, which is after all not a big problem.
      8fed5319
    • Jérome Perrin's avatar
      b687dc93
    • Jérome Perrin's avatar
      ERP5TypeTestCase: rework default manager password generation · ab64cabd
      Jérome Perrin authored
      The default manager user (ERP5TypeTestCase) now have a random password
      generated at the beginning of test. The password is stored as a class
      attribute of the test case instance.
      Many tests have been updated to not generate manager user and use the
      existing one instead. When tests need to create users (for example
      users in the root acl_users), we try to give them a random password and
      to delete the users afterward.
      
      For functional tests, the approach is that ERP5TypeFunctionalTestCase
      sets cookies with manager username and password before running zelenium
      tests, so that in case tests want to log in again as manager, they can
      read the username and password from cookies.
      
      Another significant changes is that we no longer have the same user in
      ERP5/acl_users and /acl_users, some tests were logging in as the root
      user in ways that never seemed intentional.
      
      This also revealed (through test_manager_actions_on_portal from
      testERP5Core) that some tests were running with a user without all the
      expected permissions and the "Manager Components" actions was not
      visible for the default manager user. Fixing this also revealed that
      two actions ("Manage Components" and "Manage Callables") had the same
      priority, so the later was modified to use a different priority.
      ab64cabd
  2. 28 May, 2024 1 commit
  3. 27 May, 2024 3 commits
  4. 22 May, 2024 4 commits
  5. 20 May, 2024 8 commits
  6. 19 May, 2024 2 commits
    • Jérome Perrin's avatar
      core: make Base_edit raise in case of wrong matrixbox keys · b4227bb9
      Jérome Perrin authored
      This should not happens, but if this happens we should not just return
      in the middle of the loop, because this returned value is not used,
      so we would just silently edit partially.
      b4227bb9
    • Jérome Perrin's avatar
      Security of tester accessors · 63dcec59
      Jérome Perrin authored
      The first commit of this merge request was introduced for zope4py3 branch but it revealed issues on py2 as well, i.e. we don't have roles in auto-generated tester methods.
      
      ```
      ======================================================================
      FAIL: test_method_protection (testSecurity.TestSecurity)
      This test will list all implicitly Public methods in any objects in ZODB.
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/(SR)/parts/erp5/Products/ERP5/tests/testSecurity.py", line 113, in test_method_protection
          self.fail(message)
      AssertionError: 
      The following 7 methods have a docstring but have no security assertions.
      	/(SR)/parts/erp5/product/ERP5Form/PreferenceTool.py:65 isPreferredVcsPushMode
      	/srv/slapgrid/slappart19/t/eiy/soft/8a7759fd7b65b20d9f87713605745d05/parts/erp5/product/ERP5Type/Accessor/AcquiredProperty.py:217 hasTelephoneValidationState
      	/(SR)/parts/erp5/product/ERP5Type/Accessor/Base.py:219 hasViewFormIdList
      	/(SR)/parts/erp5/product/ERP5Type/Accessor/Constant.py:94 isWebDocumentType
      	/(SR)/parts/erp5/product/ERP5Type/Accessor/Content.py:224 hasImage
      	/(SR)/parts/erp5/product/ERP5Type/Accessor/ContentProperty.py:283 hasImageWidthList
      	/(SR)/parts/erp5/product/ERP5Type/Accessor/Translation.py:233 hasFrTranslatedTitle
      
      ----------------------------------------------------------------------
      ```
      
      See merge request nexedi/erp5!1911
      63dcec59
  7. 17 May, 2024 6 commits
  8. 16 May, 2024 6 commits
  9. 15 May, 2024 2 commits
    • Romain Courteaud's avatar
    • Jérome Perrin's avatar
      tests: implement coverage reporting · f1e902b2
      Jérome Perrin authored
        - move the logic of uploading to WebDAV server here instead of the
       generated bin/runUnitTest wrapper
        - run a new `coverage_report` which will
          - download all coverage data from WebDAV server
          - combine the data
          - run html report, saved in log folder
          - print text output in the text output.
      
      This `coverage_report` test waits for other tests to finish uploading
      data, we could extend test node distributor to distribute this test at
      the end.
      f1e902b2