Commit 1d7546cb authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components'...

ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' (a771dca4) to fix tests bootstrap.

The new syntax to load ZODB Tests Components is:
runUnitTest BT_TITLE:TEST_NAME

That commit was too adhoc as it was relying upon filesystem to load Tests
Components and was not behaving like any other Components (versions was not
available and other Components were not importable).

At the end, it would have meant that a Test Component ran through runUnitTest
and Live Tests (in ERP5 itself) would have behaved differently, thus instead:

1/ Install BT_TITLE dependencies and its test dependencies (new bt property to
   specify bt to be installed only for tests on a fresh instance).
2/ The site is loaded.
3/ Load the test by importing it like any other Components.
parent 55fabe2c
...@@ -10,9 +10,6 @@ class TestERP5BearerToken(ERP5TypeTestCase): ...@@ -10,9 +10,6 @@ class TestERP5BearerToken(ERP5TypeTestCase):
test_token_extraction_id = 'bearer_test_extraction' test_token_extraction_id = 'bearer_test_extraction'
def getBusinessTemplateList(self):
return ('erp5_base', 'erp5_bearer_token')
def generateNewId(self): def generateNewId(self):
return str(self.portal.portal_ids.generateNewId( return str(self.portal.portal_ids.generateNewId(
id_group=('bearer_token_test_id'))) id_group=('bearer_token_test_id')))
......
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
13 14
\ No newline at end of file \ No newline at end of file
erp5_full_text_myisam_catalog
\ No newline at end of file
...@@ -66,14 +66,6 @@ class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin): ...@@ -66,14 +66,6 @@ class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
'erp5_l10n_pt-BR', 'erp5_l10n_pt-BR',
'erp5_demo_maxma_rule') 'erp5_demo_maxma_rule')
def getBusinessTemplateList(self):
return ('erp5_core_proxy_field_legacy',
'erp5_full_text_myisam_catalog',
'erp5_base',
'erp5_workflow',
'erp5_configurator',
'erp5_configurator_maxma_demo',)
def stepCreateBusinessConfiguration(self, sequence=None,\ def stepCreateBusinessConfiguration(self, sequence=None,\
sequence_list=None, **kw): sequence_list=None, **kw):
""" Create one Business Configuration """ """ Create one Business Configuration """
......
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
29 30
\ No newline at end of file \ No newline at end of file
erp5_core_proxy_field_legacy
erp5_full_text_myisam_catalog
erp5_base
erp5_workflow
\ No newline at end of file
...@@ -84,14 +84,6 @@ class TestRunMyDocsConfiguratorWorkflowMixin(TestLiveConfiguratorWorkflowMixin): ...@@ -84,14 +84,6 @@ class TestRunMyDocsConfiguratorWorkflowMixin(TestLiveConfiguratorWorkflowMixin):
stepCheckKnowledgePadRole stepCheckKnowledgePadRole
""" """
def getBusinessTemplateList(self):
return ('erp5_core_proxy_field_legacy',
'erp5_full_text_myisam_catalog',
'erp5_base',
'erp5_workflow',
'erp5_configurator',
'erp5_configurator_run_my_doc',)
def stepCreateBusinessConfiguration(self, sequence=None, sequence_list=None, **kw): def stepCreateBusinessConfiguration(self, sequence=None, sequence_list=None, **kw):
""" Create one Business Configuration """ """ Create one Business Configuration """
module = self.portal.business_configuration_module module = self.portal.business_configuration_module
......
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
11 12
\ No newline at end of file \ No newline at end of file
erp5_core_proxy_field_legacy
erp5_full_text_myisam_catalog
erp5_base
erp5_workflow
\ No newline at end of file
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
667 668
\ No newline at end of file \ No newline at end of file
erp5_full_text_myisam_catalog
\ No newline at end of file
...@@ -104,14 +104,6 @@ class TestUNGConfiguratorWorkflowMixin(TestLiveConfiguratorWorkflowMixin): ...@@ -104,14 +104,6 @@ class TestUNGConfiguratorWorkflowMixin(TestLiveConfiguratorWorkflowMixin):
stepCheckCreateNewEvent stepCheckCreateNewEvent
""" """
def getBusinessTemplateList(self):
return ('erp5_core_proxy_field_legacy',
'erp5_full_text_myisam_catalog',
'erp5_base',
'erp5_workflow',
'erp5_configurator',
'erp5_configurator_ung',)
def stepCreateBusinessConfiguration(self, sequence=None, sequence_list=None, **kw): def stepCreateBusinessConfiguration(self, sequence=None, sequence_list=None, **kw):
""" Create one Business Configuration """ """ Create one Business Configuration """
module = self.portal.business_configuration_module module = self.portal.business_configuration_module
......
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
61 62
\ No newline at end of file \ No newline at end of file
erp5_core_proxy_field_legacy
erp5_full_text_myisam_catalog
erp5_base
erp5_workflow
\ No newline at end of file
...@@ -110,10 +110,6 @@ class TestEGovMixin(SecurityTestCase): ...@@ -110,10 +110,6 @@ class TestEGovMixin(SecurityTestCase):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self, quiet=quiet) sequence_list.play(self, quiet=quiet)
def getBusinessTemplateList(self):
"""return list of business templates to be installed. """
return ( 'erp5_base',)
def afterSetUp(self): def afterSetUp(self):
""" """
Method called before the launch of the test to initialize some data Method called before the launch of the test to initialize some data
......
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
764 765
\ No newline at end of file \ No newline at end of file
...@@ -9,19 +9,6 @@ class TestDiscussionThread(SecurityTestCase): ...@@ -9,19 +9,6 @@ class TestDiscussionThread(SecurityTestCase):
def getTitle(self): def getTitle(self):
return "TestDiscussionThread" return "TestDiscussionThread"
def getBusinessTemplateList(self):
"""
A tuple of Business Templates names to specify the dependencies we need to
install.
"""
return (
'erp5_base',
'erp5_web',
'erp5_ingestion_mysql_innodb_catalog',
'erp5_ingestion',
'erp5_dms',
'erp5_forum_tutorial')
def setUpOnce(self): def setUpOnce(self):
""" """
Create users to interact with the discussion forums Create users to interact with the discussion forums
......
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
7 8
\ No newline at end of file \ No newline at end of file
erp5_full_text_myisam_catalog
erp5_base
erp5_web
erp5_ingestion_mysql_innodb_catalog
erp5_ingestion
\ No newline at end of file
...@@ -54,17 +54,6 @@ class TestIngestion(ERP5TypeLiveTestCase): ...@@ -54,17 +54,6 @@ class TestIngestion(ERP5TypeLiveTestCase):
""" """
return "ERP5 Live DMS - URL Ingestion" return "ERP5 Live DMS - URL Ingestion"
def getBusinessTemplateList(self):
"""
Return the list of required business templates.
"""
return ('erp5_base',
'erp5_ingestion',
'erp5_ingestion_mysql_innodb_catalog',
'erp5_web',
'erp5_crm',
'erp5_dms')
def afterSetUp(self): def afterSetUp(self):
""" """
Initialize the ERP5 site. Initialize the ERP5 site.
......
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
148 149
\ No newline at end of file \ No newline at end of file
erp5_full_text_myisam_catalog
erp5_ingestion_mysql_innodb_catalog
erp5_web
erp5_crm
erp5_dms
\ No newline at end of file
...@@ -33,10 +33,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase ...@@ -33,10 +33,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5.ERP5Site import addERP5Tool from Products.ERP5.ERP5Site import addERP5Tool
class TestInotifyTool(ERP5TypeTestCase): class TestInotifyTool(ERP5TypeTestCase):
def getBusinessTemplateList(self):
return "erp5_core_proxy_field_legacy", "erp5_inotify"
def test_inotify(self): def test_inotify(self):
from Products.ERP5.Tool.InotifyTool import IN_CREATE, IN_MODIFY, IN_DELETE from Products.ERP5.Tool.InotifyTool import IN_CREATE, IN_MODIFY, IN_DELETE
addERP5Tool(self.portal, 'portal_inotify', 'Inotify Tool') addERP5Tool(self.portal, 'portal_inotify', 'Inotify Tool')
......
5 6
\ No newline at end of file \ No newline at end of file
erp5_core_proxy_field_legacy
\ No newline at end of file
...@@ -55,10 +55,6 @@ SOAPBinding.registerServiceClass(HelloWorldService) ...@@ -55,10 +55,6 @@ SOAPBinding.registerServiceClass(HelloWorldService)
class TestSoapBinding(ERP5TypeTestCase): class TestSoapBinding(ERP5TypeTestCase):
def getBusinessTemplateList(self):
return 'erp5_interfaces',
def createBinding(self, target_namespace, service_class): def createBinding(self, target_namespace, service_class):
return self.portal.portal_interfaces.newContent( return self.portal.portal_interfaces.newContent(
self._testMethodName, 'SOAP Binding', self._testMethodName, 'SOAP Binding',
......
4 5
\ No newline at end of file \ No newline at end of file
...@@ -35,12 +35,7 @@ import unittest ...@@ -35,12 +35,7 @@ import unittest
from Products.ERP5Type.tests.prepareFunctionalTest import TestZelenium from Products.ERP5Type.tests.prepareFunctionalTest import TestZelenium
class MobileTestZelenium(TestZelenium): class MobileTestZelenium(TestZelenium):
def getBusinessTemplateList(self): pass
"""
Return the list of business templates.
"""
return ('erp5_base', 'erp5_ui_test_core', 'erp5_ui_test',
'erp5_mobile', 'erp5_mobile_ui_test',)
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
......
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
erp5_ui_test erp5_ui_test
\ No newline at end of file erp5_mobile
\ No newline at end of file
12 13
\ No newline at end of file \ No newline at end of file
...@@ -40,14 +40,6 @@ class TestERP5PaypalSecurePaymentMixin(ERP5TypeTestCase): ...@@ -40,14 +40,6 @@ class TestERP5PaypalSecurePaymentMixin(ERP5TypeTestCase):
def getTitle(self): def getTitle(self):
return "ERP5 Paypal Secure Payment" return "ERP5 Paypal Secure Payment"
def getBusinessTemplateList(self):
"""
Tuple of Business Templates we need to install
"""
return ('erp5_base',
'erp5_secure_payment',
'erp5_paypal_secure_payment')
def afterSetUp(self): def afterSetUp(self):
self.portal = self.getPortalObject() self.portal = self.getPortalObject()
if not self.portal.hasObject('portal_secure_payments'): if not self.portal.hasObject('portal_secure_payments'):
......
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
9 10
\ No newline at end of file \ No newline at end of file
erp5_full_text_myisam_catalog
\ No newline at end of file
...@@ -41,14 +41,6 @@ class TestERP5PayzenSecurePaymentMixin(ERP5TypeTestCase): ...@@ -41,14 +41,6 @@ class TestERP5PayzenSecurePaymentMixin(ERP5TypeTestCase):
def getTitle(self): def getTitle(self):
return "ERP5 Payzen Secure Payment" return "ERP5 Payzen Secure Payment"
def getBusinessTemplateList(self):
"""
Tuple of Business Templates we need to install
"""
return ('erp5_base'
, 'erp5_secure_payment'
, 'erp5_payzen_secure_payment')
def afterSetUp(self): def afterSetUp(self):
self.portal = self.getPortalObject() self.portal = self.getPortalObject()
if not self.portal.hasObject('portal_secure_payments'): if not self.portal.hasObject('portal_secure_payments'):
......
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
52 53
\ No newline at end of file \ No newline at end of file
erp5_full_text_myisam_catalog
\ No newline at end of file
erp5_full_text_myisam_catalog
erp5_base
erp5_web
erp5_ingestion
erp5_dms
\ No newline at end of file
...@@ -28,16 +28,6 @@ def makeFileUpload(name, as_name=None): ...@@ -28,16 +28,6 @@ def makeFileUpload(name, as_name=None):
return FileUpload(path, as_name) return FileUpload(path, as_name)
class TestSafeImage(ERP5TypeTestCase): class TestSafeImage(ERP5TypeTestCase):
def getBusinessTemplateList(self):
return ('erp5_base',
'erp5_web',
'erp5_ingestion_mysql_innodb_catalog',
'erp5_ingestion',
'erp5_dms',
'erp5_safeimage'
)
def afterSetUp(self): def afterSetUp(self):
portal = self.getPortalObject() portal = self.getPortalObject()
self.image_module = self.portal.getDefaultModule(portal_type = 'Image Module') self.image_module = self.portal.getDefaultModule(portal_type = 'Image Module')
......
erp5_base
erp5_web
erp5_dms
\ No newline at end of file
14 15
\ No newline at end of file \ No newline at end of file
erp5_full_text_myisam_catalog
erp5_ingestion_mysql_innodb_catalog
erp5_ingestion
\ No newline at end of file
...@@ -34,9 +34,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase ...@@ -34,9 +34,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
class TestERP5SocialContracts(ERP5TypeTestCase): class TestERP5SocialContracts(ERP5TypeTestCase):
"""Test for erp5_social_contracts business template. """Test for erp5_social_contracts business template.
""" """
def getBusinessTemplateList(self):
return ('erp5_base', 'erp5_social_contracts', )
def afterSetUp(self): def afterSetUp(self):
self.person_1 = self.portal.person_module.newContent( self.person_1 = self.portal.person_module.newContent(
portal_type='Person', portal_type='Person',
......
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
28 29
\ No newline at end of file \ No newline at end of file
erp5_full_text_myisam_catalog
\ No newline at end of file
...@@ -37,12 +37,6 @@ class testSyncMLAsynchronousEngine(TestERP5SyncMLMixin): ...@@ -37,12 +37,6 @@ class testSyncMLAsynchronousEngine(TestERP5SyncMLMixin):
def getTitle(self): def getTitle(self):
return "Test SyncML with asynchronous engine" return "Test SyncML with asynchronous engine"
def getBusinessTemplateList(self):
"""
Tuple of Business Templates we need to install
"""
return ('erp5_base', 'erp5_syncml', 'erp5_syncml_test_data') # bt5 for test data
def afterSetUp(self): def afterSetUp(self):
""" """
This is ran before anything, used to set the environment This is ran before anything, used to set the environment
......
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
erp5_syncml erp5_syncml
\ No newline at end of file erp5_base
\ No newline at end of file
5 6
\ No newline at end of file \ No newline at end of file
erp5_full_text_myisam_catalog
\ No newline at end of file
erp5_full_text_myisam_catalog
erp5_base
\ No newline at end of file
...@@ -36,21 +36,6 @@ class ShaCacheMixin(object): ...@@ -36,21 +36,6 @@ class ShaCacheMixin(object):
""" """
ShaCache - Mixin Class ShaCache - Mixin Class
""" """
def getBusinessTemplateList(self):
"""
Return the list of required business templates.
"""
return ('erp5_full_text_myisam_catalog',
'erp5_base',
'erp5_jquery',
'erp5_ingestion_mysql_innodb_catalog',
'erp5_ingestion',
'erp5_web',
'erp5_dms',
'erp5_web_download_theme',
'erp5_web_shacache',)
def afterSetUp(self): def afterSetUp(self):
""" """
Initialize the ERP5 site. Initialize the ERP5 site.
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
import httplib import httplib
import urlparse import urlparse
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from ShaCacheMixin import ShaCacheMixin from erp5.component.test.ShaCacheMixin import ShaCacheMixin
from Products.ERP5Type.tests.backportUnittest import expectedFailure from Products.ERP5Type.tests.backportUnittest import expectedFailure
class TestShaCache(ShaCacheMixin, ERP5TypeTestCase): class TestShaCache(ShaCacheMixin, ERP5TypeTestCase):
......
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
68 69
\ No newline at end of file \ No newline at end of file
erp5_full_text_myisam_catalog
\ No newline at end of file
...@@ -39,25 +39,6 @@ class ShaDirMixin(object): ...@@ -39,25 +39,6 @@ class ShaDirMixin(object):
""" """
ShaDir - Mixin Class ShaDir - Mixin Class
""" """
def getBusinessTemplateList(self):
"""
Return the list of required business templates.
"""
return ('erp5_full_text_myisam_catalog',
'erp5_base',
'erp5_jquery',
'erp5_ingestion_mysql_innodb_catalog',
'erp5_ingestion',
'erp5_web',
'erp5_dms',
'erp5_pdm',
'erp5_data_set',
'erp5_web_download_theme',
'erp5_web_shacache',
'erp5_web_shadir',)
def afterSetUp(self): def afterSetUp(self):
""" """
Initialize the ERP5 site. Initialize the ERP5 site.
......
...@@ -33,7 +33,7 @@ import urlparse ...@@ -33,7 +33,7 @@ import urlparse
import json import json
import random import random
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from ShaDirMixin import ShaDirMixin from erp5.component.test.ShaDirMixin import ShaDirMixin
from Products.ERP5Type.tests.backportUnittest import expectedFailure from Products.ERP5Type.tests.backportUnittest import expectedFailure
class TestShaDir(ShaDirMixin, ERP5TypeTestCase): class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
......
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
75 76
\ No newline at end of file \ No newline at end of file
erp5_full_text_myisam_catalog
erp5_base
erp5_jquery
erp5_ingestion_mysql_innodb_catalog
erp5_ingestion
erp5_web
erp5_dms
erp5_pdm
\ No newline at end of file
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2011-08-04 gabriel.oliveira 2011-08-04 gabriel.oliveira
* Export knowledge pad and gadget preserving its state * Export knowledge pad and gadget preserving its state
...@@ -31,4 +34,4 @@ ...@@ -31,4 +34,4 @@
* Remove erp5_jquery folder and added erp5_jquery bt5 as dependency. * Remove erp5_jquery folder and added erp5_jquery bt5 as dependency.
2010-10-13 gabriel 2010-10-13 gabriel
* The initial version. * The initial version.
\ No newline at end of file
53 54
\ No newline at end of file \ No newline at end of file
erp5_full_text_myisam_catalog
\ No newline at end of file
...@@ -38,37 +38,6 @@ class TestUNGSecurity(ERP5TypeTestCase): ...@@ -38,37 +38,6 @@ class TestUNGSecurity(ERP5TypeTestCase):
def getTitle(self): def getTitle(self):
return "Test UNG Security" return "Test UNG Security"
def getBusinessTemplateList(self):
"""Tuple of Business Templates we need to install"""
return ('erp5_base',
'erp5_web',
'erp5_ingestion_mysql_innodb_catalog',
'erp5_core_proxy_field_legacy',
'erp5_jquery',
'erp5_jquery_ui',
'erp5_ingestion',
'erp5_dms',
'erp5_crm',
'erp5_knowledge_pad',
'erp5_jquery_plugin_spinbtn',
'erp5_jquery_plugin_jgraduate',
'erp5_jquery_plugin_svgicon',
'erp5_jquery_plugin_hotkey',
'erp5_jquery_plugin_jquerybbq',
'erp5_jquery_plugin_svg_editor',
'erp5_jquery_plugin_sheet',
'erp5_jquery_plugin_mbmenu',
'erp5_jquery_plugin_jqchart',
'erp5_jquery_plugin_colorpicker',
'erp5_jquery_plugin_elastic',
'erp5_jquery_plugin_wdcalendar',
'erp5_jquery_sheet_editor',
'erp5_xinha_editor',
'erp5_svg_editor',
'erp5_web_ung_core',
'erp5_web_ung_theme',
'erp5_web_ung_role')
def beforeTearDown(self): def beforeTearDown(self):
person_module = self.getPersonModule() person_module = self.getPersonModule()
person_module.manage_delObjects(list(person_module.objectIds())) person_module.manage_delObjects(list(person_module.objectIds()))
......
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
36 37
\ No newline at end of file \ No newline at end of file
erp5_full_text_myisam_catalog
erp5_base
erp5_web
erp5_ingestion_mysql_innodb_catalog
erp5_core_proxy_field_legacy
erp5_jquery
erp5_jquery_ui
erp5_ingestion
erp5_dms
erp5_crm
erp5_knowledge_pad
erp5_jquery_plugin_spinbtn
erp5_jquery_plugin_jgraduate
erp5_jquery_plugin_svgicon
erp5_jquery_plugin_hotkey
erp5_jquery_plugin_jquerybbq
erp5_jquery_plugin_svg_editor
erp5_jquery_plugin_sheet
erp5_jquery_plugin_mbmenu
erp5_jquery_plugin_jqchart
erp5_jquery_plugin_colorpicker
erp5_jquery_plugin_elastic
erp5_jquery_plugin_wdcalendar
erp5_jquery_sheet_editor
erp5_xinha_editor
erp5_svg_editor
erp5_web_ung_core
\ No newline at end of file
...@@ -44,36 +44,6 @@ class TestUNG(ERP5TypeTestCase): ...@@ -44,36 +44,6 @@ class TestUNG(ERP5TypeTestCase):
def getTitle(self): def getTitle(self):
return "UNG Tests" return "UNG Tests"
def getBusinessTemplateList(self):
return ('erp5_ingestion_mysql_innodb_catalog',
'erp5_full_text_myisam_catalog',
'erp5_base',
'erp5_jquery',
'erp5_web',
'erp5_core_proxy_field_legacy',
'erp5_ingestion',
'erp5_jquery_ui',
'erp5_dms',
'erp5_crm',
'erp5_knowledge_pad',
'erp5_jquery_plugin_spinbtn',
'erp5_jquery_plugin_jgraduate',
'erp5_jquery_plugin_svgicon',
'erp5_jquery_plugin_hotkey',
'erp5_jquery_plugin_jquerybbq',
'erp5_jquery_plugin_svg_editor',
'erp5_jquery_plugin_sheet',
'erp5_jquery_plugin_mbmenu',
'erp5_jquery_plugin_jqchart',
'erp5_jquery_plugin_colorpicker',
'erp5_jquery_plugin_elastic',
'erp5_jquery_plugin_wdcalendar',
'erp5_jquery_sheet_editor',
'erp5_xinha_editor',
'erp5_svg_editor',
'erp5_web_ung_core',
'erp5_web_ung_theme',)
def afterSetUp(self): def afterSetUp(self):
"""Clean up form""" """Clean up form"""
self.portal.REQUEST.form.clear() self.portal.REQUEST.form.clear()
......
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
415 416
\ No newline at end of file \ No newline at end of file
erp5_ingestion_mysql_innodb_catalog
erp5_full_text_myisam_catalog
erp5_base
erp5_jquery
erp5_web
erp5_core_proxy_field_legacy
erp5_ingestion
erp5_jquery_ui
erp5_dms
erp5_crm
erp5_knowledge_pad
erp5_jquery_plugin_spinbtn
erp5_jquery_plugin_jgraduate
erp5_jquery_plugin_svgicon
erp5_jquery_plugin_hotkey
erp5_jquery_plugin_jquerybbq
erp5_jquery_plugin_svg_editor
erp5_jquery_plugin_sheet
erp5_jquery_plugin_mbmenu
erp5_jquery_plugin_jqchart
erp5_jquery_plugin_colorpicker
erp5_jquery_plugin_elastic
erp5_jquery_plugin_wdcalendar
erp5_jquery_sheet_editor
erp5_xinha_editor
erp5_svg_editor
erp5_web_ung_theme
\ No newline at end of file
...@@ -32,8 +32,8 @@ import base64 ...@@ -32,8 +32,8 @@ import base64
import httplib import httplib
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from ShaCacheMixin import ShaCacheMixin from erp5.component.test.ShaCacheMixin import ShaCacheMixin
from ShaSecurityMixin import ShaSecurityMixin from erp5.component.test.ShaSecurityMixin import ShaSecurityMixin
from Products.ERP5Type.tests.backportUnittest import expectedFailure from Products.ERP5Type.tests.backportUnittest import expectedFailure
class TestShaCacheExternal(ShaCacheMixin, ShaSecurityMixin, ERP5TypeTestCase): class TestShaCacheExternal(ShaCacheMixin, ShaSecurityMixin, ERP5TypeTestCase):
...@@ -48,14 +48,6 @@ class TestShaCacheExternal(ShaCacheMixin, ShaSecurityMixin, ERP5TypeTestCase): ...@@ -48,14 +48,6 @@ class TestShaCacheExternal(ShaCacheMixin, ShaSecurityMixin, ERP5TypeTestCase):
""" """
return "SHACACHE External - Real Usage Of ShaCache" return "SHACACHE External - Real Usage Of ShaCache"
def getBusinessTemplateList(self):
"""
Return the list of required business templates.
"""
return ShaCacheMixin().getBusinessTemplateList() + \
('erp5_data_set',
'networkcache_erp5',)
def afterSetUp(self): def afterSetUp(self):
""" """
Initialize the ERP5 site. Initialize the ERP5 site.
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
from AccessControl import Unauthorized from AccessControl import Unauthorized
from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase
from ShaCacheMixin import ShaCacheMixin from erp5.component.test.ShaCacheMixin import ShaCacheMixin
from ShaSecurityMixin import ShaSecurityMixin from erp5.component.test.ShaSecurityMixin import ShaSecurityMixin
class TestShaCacheSecurity(ShaCacheMixin, ShaSecurityMixin, SecurityTestCase): class TestShaCacheSecurity(ShaCacheMixin, ShaSecurityMixin, SecurityTestCase):
...@@ -45,16 +45,6 @@ class TestShaCacheSecurity(ShaCacheMixin, ShaSecurityMixin, SecurityTestCase): ...@@ -45,16 +45,6 @@ class TestShaCacheSecurity(ShaCacheMixin, ShaSecurityMixin, SecurityTestCase):
""" """
return "SHADIR Security Test Case" return "SHADIR Security Test Case"
def getBusinessTemplateList(self):
"""
Return the list of required business templates.
"""
return ShaCacheMixin().getBusinessTemplateList() + \
('erp5_pdm',
'erp5_data_set',
'erp5_web_shadir',
'networkcache_erp5',)
def afterSetUp(self): def afterSetUp(self):
""" """
Initialize the ERP5 site. Initialize the ERP5 site.
......
...@@ -34,8 +34,8 @@ import os ...@@ -34,8 +34,8 @@ import os
import httplib import httplib
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Type.tests.ERP5TypeLiveTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeLiveTestCase import ERP5TypeTestCase
from ShaDirMixin import ShaDirMixin from erp5.component.test.ShaDirMixin import ShaDirMixin
from ShaSecurityMixin import ShaSecurityMixin from erp5.component.test.ShaSecurityMixin import ShaSecurityMixin
class TestShaDirExternal(ShaDirMixin, ShaSecurityMixin, ERP5TypeTestCase): class TestShaDirExternal(ShaDirMixin, ShaSecurityMixin, ERP5TypeTestCase):
...@@ -50,13 +50,6 @@ class TestShaDirExternal(ShaDirMixin, ShaSecurityMixin, ERP5TypeTestCase): ...@@ -50,13 +50,6 @@ class TestShaDirExternal(ShaDirMixin, ShaSecurityMixin, ERP5TypeTestCase):
""" """
return "SHADIR External - Real Usage Of ShaDir" return "SHADIR External - Real Usage Of ShaDir"
def getBusinessTemplateList(self):
"""
Return the list of required business templates.
"""
return ShaDirMixin().getBusinessTemplateList() + \
('networkcache_erp5',)
def afterSetUp(self): def afterSetUp(self):
""" """
Initialize the ERP5 site. Initialize the ERP5 site.
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
from AccessControl import Unauthorized from AccessControl import Unauthorized
from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase
from ShaDirMixin import ShaDirMixin from erp5.component.test.ShaDirMixin import ShaDirMixin
from ShaSecurityMixin import ShaSecurityMixin from erp5.component.test.ShaSecurityMixin import ShaSecurityMixin
class TestShaDirSecurity(ShaDirMixin, ShaSecurityMixin, SecurityTestCase): class TestShaDirSecurity(ShaDirMixin, ShaSecurityMixin, SecurityTestCase):
...@@ -45,13 +45,6 @@ class TestShaDirSecurity(ShaDirMixin, ShaSecurityMixin, SecurityTestCase): ...@@ -45,13 +45,6 @@ class TestShaDirSecurity(ShaDirMixin, ShaSecurityMixin, SecurityTestCase):
""" """
return "SHADIR Security Test Case" return "SHADIR Security Test Case"
def getBusinessTemplateList(self):
"""
Return the list of required business templates.
"""
return ShaDirMixin().getBusinessTemplateList() + \
('networkcache_erp5',)
def afterSetUp(self): def afterSetUp(self):
""" """
Initialize the ERP5 site. Initialize the ERP5 site.
......
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
31 32
\ No newline at end of file \ No newline at end of file
erp5_full_text_myisam_catalog
erp5_pdm
erp5_data_set
\ No newline at end of file
...@@ -87,9 +87,6 @@ class TestERP5(ERP5TypeTestCase): ...@@ -87,9 +87,6 @@ class TestERP5(ERP5TypeTestCase):
def getTitle(self): def getTitle(self):
return "Conflict Resolution: ERP5" return "Conflict Resolution: ERP5"
def getBusinessTemplateList(self):
return 'erp5_base', 'test_conflict_resolution'
def afterSetUp(self): def afterSetUp(self):
other_node = self.getOtherZopeNode() other_node = self.getOtherZopeNode()
self.other_node = self.portal.portal_web_services.connect( self.other_node = self.portal.portal_web_services.connect(
......
6 7
\ No newline at end of file \ No newline at end of file
erp5_full_text_myisam_catalog
\ No newline at end of file
...@@ -699,7 +699,7 @@ class TemplateTool (BaseTool): ...@@ -699,7 +699,7 @@ class TemplateTool (BaseTool):
""" """
self.repository_dict = PersistentMapping() self.repository_dict = PersistentMapping()
property_list = ('title', 'version', 'revision', 'description', 'license', property_list = ('title', 'version', 'revision', 'description', 'license',
'dependency', 'provision', 'copyright') 'dependency', 'test_dependency', 'provision', 'copyright')
#LOG('updateRepositoryBusiessTemplateList', 0, #LOG('updateRepositoryBusiessTemplateList', 0,
# 'repository_list = %r' % (repository_list,)) # 'repository_list = %r' % (repository_list,))
for repository in repository_list: for repository in repository_list:
...@@ -749,6 +749,8 @@ class TemplateTool (BaseTool): ...@@ -749,6 +749,8 @@ class TemplateTool (BaseTool):
temp_property_dict.get('license', [''])[0] temp_property_dict.get('license', [''])[0]
property_dict['dependency_list'] = \ property_dict['dependency_list'] = \
temp_property_dict.get('dependency', ()) temp_property_dict.get('dependency', ())
property_dict['test_dependency_list'] = \
temp_property_dict.get('test_dependency', ())
property_dict['provision_list'] = \ property_dict['provision_list'] = \
temp_property_dict.get('provision', ()) temp_property_dict.get('provision', ())
property_dict['copyright_list'] = \ property_dict['copyright_list'] = \
...@@ -878,7 +880,7 @@ class TemplateTool (BaseTool): ...@@ -878,7 +880,7 @@ class TemplateTool (BaseTool):
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getDependencyList') 'getDependencyList')
def getDependencyList(self, bt): def getDependencyList(self, bt, with_test_dependency_list=False):
""" """
Return the list of missing dependencies for a business Return the list of missing dependencies for a business
template, given a tuple : (repository, id) template, given a tuple : (repository, id)
...@@ -896,7 +898,11 @@ class TemplateTool (BaseTool): ...@@ -896,7 +898,11 @@ class TemplateTool (BaseTool):
if repository == bt[0]: if repository == bt[0]:
for property_dict in property_dict_list: for property_dict in property_dict_list:
if property_dict['id'] == bt[1]: if property_dict['id'] == bt[1]:
dependency_list = [q for q in property_dict['dependency_list'] if q] dependency_list = [q.strip() for q in
property_dict['dependency_list'] if q]
if with_test_dependency_list:
dependency_list.extend([q.strip() for q in
property_dict['test_dependency_list'] if q])
for dependency_couple in dependency_list: for dependency_couple in dependency_list:
# dependency_couple is like "erp5_xhtml_style (>= 0.2)" # dependency_couple is like "erp5_xhtml_style (>= 0.2)"
dependency_couple_list = dependency_couple.split(' ', 1) dependency_couple_list = dependency_couple.split(' ', 1)
...@@ -1236,7 +1242,9 @@ class TemplateTool (BaseTool): ...@@ -1236,7 +1242,9 @@ class TemplateTool (BaseTool):
security.declareProtected(Permissions.ManagePortal, security.declareProtected(Permissions.ManagePortal,
'resolveBusinessTemplateListDependency') 'resolveBusinessTemplateListDependency')
def resolveBusinessTemplateListDependency(self, template_title_list): def resolveBusinessTemplateListDependency(self,
template_title_list,
with_test_dependency_list=False):
available_bt5_list = self.getRepositoryBusinessTemplateList() available_bt5_list = self.getRepositoryBusinessTemplateList()
template_title_list = set(template_title_list) template_title_list = set(template_title_list)
...@@ -1249,7 +1257,9 @@ class TemplateTool (BaseTool): ...@@ -1249,7 +1257,9 @@ class TemplateTool (BaseTool):
bt5 = self.decodeRepositoryBusinessTemplateUid(available_bt5.uid) bt5 = self.decodeRepositoryBusinessTemplateUid(available_bt5.uid)
bt5_set.add(bt5) bt5_set.add(bt5)
meta_dependency_set = set() meta_dependency_set = set()
for dep_repository, dep_id in self.getDependencyList(bt5): for dep_repository, dep_id in self.getDependencyList(
bt5,
with_test_dependency_list):
if dep_repository != 'meta': if dep_repository != 'meta':
bt5_set.add((dep_repository, dep_id)) bt5_set.add((dep_repository, dep_id))
else: else:
......
...@@ -45,6 +45,7 @@ revision ...@@ -45,6 +45,7 @@ revision
description description
license license
dependency_list dependency_list
test_dependency_list
provision_list provision_list
copyright_list copyright_list
'''.strip().splitlines() '''.strip().splitlines()
......
...@@ -124,6 +124,7 @@ ...@@ -124,6 +124,7 @@
<list> <list>
<string>my_change_log</string> <string>my_change_log</string>
<string>my_dependency_list</string> <string>my_dependency_list</string>
<string>my_test_dependency_list</string>
<string>my_provision_list</string> <string>my_provision_list</string>
<string>my_copyright_list</string> <string>my_copyright_list</string>
<string>my_license</string> <string>my_license</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="LinesField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_test_dependency_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</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>view_separator</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>view_separator</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>
<list/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></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> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>3</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> <string></string> </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>Tests Dependencies</string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>view_separator</string> </key>
<value> <string encoding="cdata"><![CDATA[
<br />
]]></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>40</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -35,12 +35,6 @@ class Test(ERP5TypeTestCase): ...@@ -35,12 +35,6 @@ class Test(ERP5TypeTestCase):
def getTitle(self): def getTitle(self):
return "TestActivityTool" return "TestActivityTool"
def getBusinessTemplateList(self):
"""
Tuple of Business Templates we need to install
"""
return ('erp5_base',)
def afterSetUp(self): def afterSetUp(self):
""" """
This is ran before anything, used to set the environment This is ran before anything, used to set the environment
......
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-09-03 arnaud.fontaine 2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers. * ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......
41124 41125
\ No newline at end of file \ No newline at end of file
erp5_full_text_myisam_catalog
erp5_base
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/lines</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>a list of template names required by this template to run unit tests from an instance created only for unit tests</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test_dependency_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>property_default</string> </key>
<value> <string>python: ()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2013-09-08 arnaud.fontaine
* ZODB Components: Revert 'Allow to execute runUnitTest for bt5 Test Components' to fix tests bootstrap.
2013-08-20 arnaud.fontaine 2013-08-20 arnaud.fontaine
* ZODB Components: Add BusinessTemplate property to specify the object paths whose only last workflow history must be kept on export. * ZODB Components: Add BusinessTemplate property to specify the object paths whose only last workflow history must be kept on export.
......
63 64
\ No newline at end of file \ No newline at end of file
...@@ -277,7 +277,6 @@ else: ...@@ -277,7 +277,6 @@ else:
real_instance_home = os.path.sep.join( real_instance_home = os.path.sep.join(
tests_framework_home.split(os.path.sep)[:-3]) tests_framework_home.split(os.path.sep)[:-3])
class ERP5TypeTestLoader(unittest.TestLoader): class ERP5TypeTestLoader(unittest.TestLoader):
"""Load test cases from the name passed on the command line. """Load test cases from the name passed on the command line.
""" """
...@@ -289,40 +288,32 @@ class ERP5TypeTestLoader(unittest.TestLoader): ...@@ -289,40 +288,32 @@ class ERP5TypeTestLoader(unittest.TestLoader):
lambda self, value: None) lambda self, value: None)
def loadTestsFromName(self, name, module=None): def loadTestsFromName(self, name, module=None):
"""This method is here for compatibility with old style arguments. """
This method is here for compatibility with old style arguments:
- It is possible to have the .py prefix for the test file - It is possible to have the .py prefix for the test file
- It is possible to separate test classes with : instead of .
And, also to load ZODB Test Component before passing it to unittest
TestLoader().
""" """
# backward compatibility # backward compatibility
if name.endswith('.py'): if name.endswith('.py'):
name = name[:-3] name = name[:-3]
name = name.replace(':', '.')
# TODO-arnau: Dirty hack to allow './runUnitTest test.erp5.testFoo'. This if ':' in name:
# must be implemented properly by specifiying the bt5 *and* test name from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
if name.startswith('test.'): from Products.ERP5Type.tests.ERP5TypeLiveTestCase import ERP5TypeLiveTestCase
for path in sys.path:
if not path.endswith('/portal_components'):
continue
component_module_name = name.split('.')[2] # TestLoader() does not perform any import so import the Module manually
component_filename = '.'.join(name.split('.', 3)[:3]) + '.py' module = __import__('erp5.component.test',
component_path = os.path.join(path, component_filename) fromlist=['erp5.component.test'],
if not os.path.isfile(component_path): level=0)
continue
with open(component_path) as component_file: # TODO-arnau: What about loading a test for a specific Component Version?
import imp name = name.split(':')[1]
module = imp.new_module(component_module_name)
setattr(module,
component_module_name,
imp.load_module(component_module_name,
component_file,
component_filename,
('.py', 'rb', imp.PY_SOURCE)))
name = '.'.join(name.split('.', 3)[2:]) __import__('erp5.component.test.%s' % name.split('.')[0],
break ['erp5.component.test'],
level=0)
return super(ERP5TypeTestLoader, self).loadTestsFromName(name, module) return super(ERP5TypeTestLoader, self).loadTestsFromName(name, module)
...@@ -333,6 +324,108 @@ class ERP5TypeTestLoader(unittest.TestLoader): ...@@ -333,6 +324,108 @@ class ERP5TypeTestLoader(unittest.TestLoader):
return self.suiteClass(module.test_suite()) return self.suiteClass(module.test_suite())
return super(ERP5TypeTestLoader, self).loadTestsFromModule(module) return super(ERP5TypeTestLoader, self).loadTestsFromModule(module)
def loadTestsFromNames(self, test_list):
# ZODB Test Components requires bootstrap to install BTs before running the
# actual test
test_list_len = len(test_list)
if test_list_len > 0 and ':' in test_list[0]:
# TODO-arnau: Does anyone specifies multiple test file on command line, at
# least test bot does not...
if test_list_len > 1:
raise NotImplementedError("Cannot specify multiple Unit Tests to run "
"with ZODB Test Components")
# Cannot be imported at top-level as importing ERP5TypeTestCase has side
# effects and a lot of magic has to be done before. Otherwise,
# getLogger('CMFActivity') was failing because no handlers were set up.
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeCommandLineTestCase
class _ZodbTestComponentBootstrapOnly(ERP5TypeCommandLineTestCase):
"""
Bootstrap class for ZODB Test Components which reuses as much as possible
code with "normal" tests as the only difference is how Business Templates are
installed.
With legacy tests, a test is directly loaded from the filesystem by adding BTs
TestTemplateItem directories to sys.path and the list of Business Templates is
given by its getBusinessTemplateList() method.
However, with ZODB Components, importing erp5.component.* modules and using
Component Versions require ERP5 site to be loaded and dependencies BTs to be
installed beforehand (and the entry point is thus the BT title and the test to
be loaded as specified on the command line (BT:TEST_NAME instead of
TEST_NAME)). Any other way would be adhoc and would meant having a different
behavior between running an Unit Test and a Live Test.
"""
def __init__(self, test_list):
self._test_list = test_list
self._bt_already_installed_list = []
def getBusinessTemplateList(self):
"""
Only return the Business Template specifies on the command line, its
dependencies will be resolved through bt5list and Template Tool
(dependency_list and test_dependency_list BT properties)
"""
return [ test.split(':')[0] for test in self._test_list ]
@staticmethod
def _getBTPathAndIdList(bt_list):
"""
Overriden as the original method manually checks BT URLs, handled through
Template Tool resolveBusinessTemplateList() methods for ZODB Components
"""
return bt_list
def _installBusinessTemplateList(self,
bt_list,
update_repository_bt_list=True,
*args,
**kwargs):
"""
Before installing BTs by calling the original method:
1/ Get filesystem BT repositories and set them to Template Tool
2/ Update BT repositories
3/ Resolve dependencies:
* dependency_list: recursive.
* test_dependency_list: non-recursive.
4/ Install BTs as before
"""
template_tool = self.portal.portal_templates
from Products.ERP5.ERP5Site import getBootstrapDirectory
bt5_path_list = [os.environ.get('erp5_tests_bootstrap_path') or
getBootstrapDirectory()]
bt5_path = os.environ.get('erp5_tests_bt5_path')
if bt5_path:
bt5_path_list.extend([ bt5_path.replace('*', '')
for bt5_path in bt5_path.split(',') ])
else:
from App.config import getConfiguration
instancehome = getConfiguration().instancehome
bt5_path_list.append(os.path.join(instancehome, 'bt5'))
bt5_path_list = [bt5_path for bt5_path in bt5_path_list
if os.path.exists(bt5_path)]
template_tool.updateRepositoryBusinessTemplateList(bt5_path_list)
url_bt_tuple_list = [
('%s/%s' % (repository, bt_title), bt_title) for repository, bt_title in
template_tool.resolveBusinessTemplateListDependency(
bt_list,
with_test_dependency_list=True)]
return super(_ZodbTestComponentBootstrapOnly,
self)._installBusinessTemplateList(url_bt_tuple_list,
*args, **kwargs)
_ZodbTestComponentBootstrapOnly(test_list).setUp()
return super(ERP5TypeTestLoader, self).loadTestsFromNames(test_list)
def getTestCaseNames(self, testCaseClass): def getTestCaseNames(self, testCaseClass):
"""Return a sorted sequence of method names found within testCaseClass """Return a sorted sequence of method names found within testCaseClass
......
import glob, os, subprocess, re from glob import glob
import os, subprocess, re
# test_suite is provided by 'run_test_suite' # test_suite is provided by 'run_test_suite'
from test_suite import ERP5TypeTestSuite from test_suite import ERP5TypeTestSuite
import sys import sys
...@@ -28,11 +29,19 @@ class _ERP5(ERP5TypeTestSuite): ...@@ -28,11 +29,19 @@ class _ERP5(ERP5TypeTestSuite):
def _getAllTestList(self): def _getAllTestList(self):
test_list = [] test_list = []
path = sys.path[0]
component_re = re.compile(".*/([^/]+)/TestTemplateItem/portal_components"
"/test\.[^.]+\.([^.]+).py$")
for test_path in ( for test_path in (
glob.glob('%s/product/*/tests/test*.py' % sys.path[0]) + glob('%s/product/*/tests/test*.py' % path) +
glob.glob('%s/bt5/*/TestTemplateItem/test*.py' % sys.path[0]) + glob('%s/bt5/*/TestTemplateItem/test*.py' % path) +
glob.glob('%s/bt5/*/TestTemplateItem/portal_components/test.*.test*.py' % sys.path[0])): glob('%s/bt5/*/TestTemplateItem/portal_components/test.*.test*.py' % path)):
test_case = test_path.split(os.sep)[-1][:-3] # remove .py component_re_match = component_re.match(test_path)
if component_re_match is not None:
test_case = "%s:%s" % (component_re_match.group(1),
component_re_match.group(2))
else:
test_case = test_path.split(os.sep)[-1][:-3] # remove .py
product = test_path.split(os.sep)[-3] product = test_path.split(os.sep)[-3]
# don't test 3rd party products # don't test 3rd party products
if product in ('PortalTransforms', 'MailTemplates', 'Zelenium'): if product in ('PortalTransforms', 'MailTemplates', 'Zelenium'):
...@@ -64,35 +73,36 @@ class ERP5(_ERP5): ...@@ -64,35 +73,36 @@ class ERP5(_ERP5):
def getTestList(self): def getTestList(self):
test_list = [] test_list = []
for test_case in self._getAllTestList(): for full_test_case in self._getAllTestList():
test_case = (':' in full_test_case and full_test_case.split(':')[1]
or full_test_case)
# skip some tests # skip some tests
if ('testLive' in test_case or if test_case.startswith('testLive') or test_case.startswith('testVifib') \
'testVifib' in test_case or or test_case.find('Performance') > 0 \
test_case.find('Performance') > 0 or or test_case in ('testERP5LdapCatalog', # XXX (Ivan), until LDAP server is available this test will alway fail
# XXX (Ivan), until LDAP server is available this test will alway fail # tests reading selenium tables from erp5.com
test_case.endswith('testERP5LdapCatalog') or 'testFunctionalStandaloneUserTutorial',
# tests reading selenium tables from erp5.com 'testFunctionalRunMyDocSample',
test_case.endswith('testFunctionalStandaloneUserTutorial') or 'testFunctionalConfigurator',
test_case.endswith('testFunctionalRunMyDocSample') or 'testFunctionalConfiguratorConsulting',
test_case.endswith('testFunctionalConfigurator') or # not maintained
test_case.endswith('testFunctionalConfiguratorConsulting') or 'testERP5eGov',
# not maintained 'testAccounting_l10n_fr_m9'):
test_case.endswith('testERP5eGov') or
test_case.endswith('testAccounting_l10n_fr_m9')):
continue continue
test_list.append(test_case) test_list.append(full_test_case)
return test_list return test_list
def run(self, test): def run(self, full_test):
if (test.endswith('testConflictResolution') or test = ':' in full_test and full_test.split(':')[1] or full_test
test.endswith('testInvalidationBug')): if test in ('testConflictResolution', 'testInvalidationBug'):
status_dict = self.runUnitTest('--save', test) status_dict = self.runUnitTest('--save', full_test)
if not status_dict['status_code']: if not status_dict['status_code']:
status_dict = self.runUnitTest('--load', '--activity_node=2', test) status_dict = self.runUnitTest('--load', '--activity_node=2', full_test)
return status_dict return status_dict
if test.startswith('testFunctional'): if test.startswith('testFunctional'):
return self._updateFunctionalTestResponse(self.runUnitTest(test)) return self._updateFunctionalTestResponse(self.runUnitTest(full_test))
return super(ERP5, self).run(test) return super(ERP5, self).run(full_test)
def _updateFunctionalTestResponse(self, status_dict): def _updateFunctionalTestResponse(self, status_dict):
""" Convert the Unit Test output into more accurate information """ Convert the Unit Test output into more accurate information
......
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