Commit b8e0957c authored by Arnaud Fontaine's avatar Arnaud Fontaine Committed by Julien Muchembled
Browse files

TemplateTool: Do not change the resolved depends list when installing bt5s with depends.

Considering erp5_configurator_ung depending on erp5_configurator which in turn
depends on erp5_workflow, if erp5_workflow and erp5_configurator_ung are
specifically added to the list of bt5 installed with depends, then erp5_workflow
ended up being installed *after* erp5_configurator.

(cherry picked from commit 0101c3a0)
parent 12a26ac7
master allow_login_change allow_login_change_differentiate_id_and_login allow_login_change_wip arnau arnau-TM-components-products-migration arnau-TM-jabber-client-desktop-notifications arnau-kns arnau-kns-without-property-mapping arnau-real-time-inventory-accounting auto_extend_select_list autoflake average_lowest_value_test backup_erp5_workflow bk_erp5ish_actions_tool bk_sqlcatalog bt5_config buce buce-2021 callable-jupyter-storage catalog_filter catalog_fulltext catalog_fulltext_old cedriclen-eos cherry-pick-243c2f03 cherry-pick-4a8e045d clean_up_upgrader cleanup_acquisition_base_category cmfactivity-getcurrentnode-getserveraddress compact_title_no_reference datetimefield delivery_item_barcode douglas_forum dream_distributor dsn-phase3 eos-dev erp5-component erp5-data-notebook erp5-forum erp5-preference erp5-release erp5-slapos-upgrade erp5-vifib erp5-vifib-cleanup erp5_catalog erp5_catalog_final erp5_free_subscription erp5_workflow erp5testnode_max_timeout eteri_master_latest eteri_master_latest_dev experiment/coding_style_test_suite feat/accounting_stop_using_getObject feat/accounting_translate_gap feat/olapy feat/pdm_content_translation feat/test_inventory_api_domain_selection feat/trade_shipment_report feat/wendelin-py-data feature/accounting-reports-stats feature/hal-actions-support feature/hal-support-update feature/jio-accounting-reports feature/jio-action-accounting feature/jio-selection-actions feature/jio-selection-actions-with-history feature/json-allows-all-jio-actions feature/renderjs-matrixbox feature/renderjs-ui-no-header feature/rjs-listbox-stats feature/rjs-mass-transition feature/rjs-print-action fix/consistency_check_alarm fix/full_text_script_conflict fix/login_validate_check_consistency fix/multiple_small_fixes_to_zodb_history_tab for_testrunner_1 for_testrunner_2 for_testrunner_3 gabriel-fix-rounding-in-accounting-generation gabriel-fix-rounding-in-accounting-generation2 gadget-json-value heads/fix/notification_tool_unauthorized hotfix/accounting-test-timeout hotfix/callable_tool hotfix/field-keeps-request hotfix/jio-mass-transition hotfix/jio_view hotfix/pdm-test hotfix/rjs-accounting-tests hotfix/rjs-editability hotfix/rjs-form-less-invasive hotfix/rjs-formfields-padding hotfix/rjs-listbox-mutex hotfix/rjs-replace-query-with-uids hotfix/tests-cleanup improve_default_caching_policy_manager initsite intentionaly_broken_cloudooo isDeletable item_tracking_graph_editor jerome/buce-report-alarms jerome_graph_editor_renderjs jerome_user_preference_time_zone jm/form-action-guard joblib-activity js-ui kns kns-kr listbox_url macros_fix maste_copy master_calendar_wip_patches master_calendar_wip_patches_extend_security master_no_guard_on_workflow_transition master_no_guard_on_workflow_transition_plus_calendar_wip_patchs master_w mic_construction mic_wind mic_wind_rebase monitoring monitoring-graph nexedi-erp5-jp no_longer_simulated_state officejs officejs_clean officejs_zip ojs_wip portal_callables portal_solver_process_security_configuration refactor/base_edit refactor/renderjs reindex_calendar_after_change_calendar_exception reverse_logistics revert-38554dbe revert-6c89fe9b rewrite_test_21_AcquiredPortalType rjs_item romain-fulltext scalability-master scalability-roque scalability-roque-2 scalability-run-command shop-box sms_more_than_140_characters solve_divergence_dialog_renderjs_ui strict_catalog sws_fix taskdistribution-xmlrpc-binary testnode_software_link timezones tmp/getInstalledBusinessTemplate_never_installed_bt tristan tristan-merge view-aggregated-amounts vivekpab_erp5webrenderjs_layoutconfig vivekpab_jabberclient vivekpab_renderjs_interfaces wenjie wenjie_branch wip workflowtool test-ui test-rjsacc test-rjs renderjs-test erp5.util-0.4.49 erp5.util-0.4.46 erp5.util-0.4.44 erp5.util-0.4.43
No related merge requests found
Showing with 26 additions and 8 deletions
+26 -8
......@@ -1213,9 +1213,7 @@ class TemplateTool (BaseTool):
activate_kw = dict(activity="SQLQueue", tag="start_%s" % (time.time()))
missing_dependency_list.extend([x for x in resolved_template_list if
x[1] in template_list])
for repository, bt_id in missing_dependency_list:
for repository, bt_id in resolved_template_list:
bt_url = '%s/%s' % (repository, bt_id)
param_dict = dict(download_url=bt_url, only_newer=only_newer)
if update_catalog is not _MARKER:
......
......@@ -31,6 +31,7 @@ import os
import shutil
import unittest
import random
import transaction
from App.config import getConfiguration
from Products.ERP5VCS.WorkingCopy import getVcsTool
......@@ -563,8 +564,10 @@ class TestTemplateTool(ERP5TypeTestCase):
self.assertEquals(bt.getTitle(), bt5_name)
def test_installBusinessTemplatesFromRepository_install_dependency(self):
""" Test if update catalog is trigger when needed.
"""Test if dependencies are automatically installed properly
"""
# erp5_configurator_{ung,standard} depends on erp5_configurator which in
# turn depends on erp5_workflow
bt5_name_list = ['erp5_configurator_ung', 'erp5_configurator_standard']
template_tool = self.portal.portal_templates
for repos in template_tool.getRepositoryList():
......@@ -596,17 +599,34 @@ class TestTemplateTool(ERP5TypeTestCase):
(repository, bt5_name))
self.assertNotEquals(dependency_list, [])
self.tic()
template_tool.installBusinessTemplateListFromRepository(
bt5_name_list, install_dependency=True)
for bt5_name in bt5_name_list:
bt = template_tool.getInstalledBusinessTemplate(bt5_name)
self.assertNotEquals(bt, None)
bt = template_tool.getInstalledBusinessTemplate("erp5_configurator")
self.assertNotEquals(bt, None)
bt = template_tool.getInstalledBusinessTemplate("erp5_workflow")
bt = template_tool.getInstalledBusinessTemplate("erp5_configurator")
self.assertNotEquals(bt, None)
bt = template_tool.getInstalledBusinessTemplate("erp5_workflow")
self.assertNotEquals(bt, None)
transaction.abort()
# Same as above but also check that dependencies are properly resolved if
# one of the dependency is explicitly added to the list of bt5 to be
# installed
template_tool.installBusinessTemplateListFromRepository(
bt5_name_list + ['erp5_workflow'],
install_dependency=True)
for bt5_name in bt5_name_list:
bt = template_tool.getInstalledBusinessTemplate(bt5_name)
self.assertNotEquals(bt, None)
bt = template_tool.getInstalledBusinessTemplate("erp5_configurator")
self.assertNotEquals(bt, None)
bt = template_tool.getInstalledBusinessTemplate("erp5_workflow")
self.assertNotEquals(bt, None)
transaction.abort()
def test_sortBusinessTemplateList(self):
"""Check sorting of a list of business template by their dependencies
"""
......
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