Commit 2c07e3f6 authored by Jérome Perrin's avatar Jérome Perrin

test_upgrader: update test now that we can run any step even if previous step sense error

parent 83c572f5
...@@ -301,6 +301,16 @@ class TestUpgrader(ERP5TypeTestCase): ...@@ -301,6 +301,16 @@ class TestUpgrader(ERP5TypeTestCase):
alarm_id="upgrader_check_post_upgrade") alarm_id="upgrader_check_post_upgrade")
self.assertFalse(sense, detail_list) self.assertFalse(sense, detail_list)
def stepCheckPreUpgradeRequired(self, sequence=None):
sense, detail_list = self._checkAlarmSense(
alarm_id="upgrader_check_pre_upgrade")
self.assertTrue(sense, detail_list)
def stepCheckPreUpgradeNotRequired(self, sequence=None):
sense, detail_list = self._checkAlarmSense(
alarm_id="upgrader_check_pre_upgrade")
self.assertFalse(sense, detail_list)
def stepUninstallERP5Web(self, sequence=None): def stepUninstallERP5Web(self, sequence=None):
bt5 = self.portal.portal_templates.getInstalledBusinessTemplate('erp5_web') bt5 = self.portal.portal_templates.getInstalledBusinessTemplate('erp5_web')
if bt5 is not None: if bt5 is not None:
...@@ -357,12 +367,6 @@ class TestUpgrader(ERP5TypeTestCase): ...@@ -357,12 +367,6 @@ class TestUpgrader(ERP5TypeTestCase):
return portal.portal_catalog(select_list=['indexation_timestamp'], return portal.portal_catalog(select_list=['indexation_timestamp'],
uid=portal.portal_templates.getUid())[0].indexation_timestamp uid=portal.portal_templates.getUid())[0].indexation_timestamp
def stepCheckSummaryForPreUpgradeRequired(self, sequence=None):
alarm = self.portal.portal_alarms.upgrader_check_upgrader
active_process = alarm.getLastActiveProcess()
detail_list = active_process.getResultList()[0].detail
self.assertTrue("Is required solve Pre Upgrade first. You need run active sense once at least on this alarm" in detail_list)
def stepCheckPersonNotInConstraintTypeListPerPortalType(self, sequence=None): def stepCheckPersonNotInConstraintTypeListPerPortalType(self, sequence=None):
constraint_type_per_type, _ = \ constraint_type_per_type, _ = \
self.portal.Base_getConstraintTypeListPerPortalType() self.portal.Base_getConstraintTypeListPerPortalType()
...@@ -500,9 +504,9 @@ class TestUpgrader(ERP5TypeTestCase): ...@@ -500,9 +504,9 @@ class TestUpgrader(ERP5TypeTestCase):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
def test_can_not_run_post_upgrade_without_solve_upgrade(self): def test_can_run_post_upgrade_without_solve_upgrade(self):
"""Check that if there is something to solve in pre_upgrade and upgrade is """Check that if there is something to solve in upgrade, it is still possible
not possible run the post upgrade""" to run the post upgrade step directly."""
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = """ sequence_string = """
stepUninstallERP5Web stepUninstallERP5Web
...@@ -517,14 +521,14 @@ class TestUpgrader(ERP5TypeTestCase): ...@@ -517,14 +521,14 @@ class TestUpgrader(ERP5TypeTestCase):
stepRunPostUpgrade stepRunPostUpgrade
stepTic stepTic
stepCheckUpgradeRequired stepCheckUpgradeRequired
stepCheckPostUpgradeRequired stepCheckPostUpgradeNotRequired
""" """
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
def test_can_not_run_upgrade_without_solve_pre_upgrade(self): def test_can_run_upgrade_without_solve_pre_upgrade(self):
"""Check that if there is something to solve in pre_upgrade is not possible """Check that if there is something to solve in pre_upgrade is still possible
run the upgrade""" run only the upgrade step directly (eventhough this does not really make sense)"""
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = """ sequence_string = """
stepCreatePerson stepCreatePerson
...@@ -537,7 +541,7 @@ class TestUpgrader(ERP5TypeTestCase): ...@@ -537,7 +541,7 @@ class TestUpgrader(ERP5TypeTestCase):
stepTic stepTic
stepRunUpgrader stepRunUpgrader
stepTic stepTic
stepCheckSummaryForPreUpgradeRequired stepCheckPreUpgradeRequired
""" """
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
......
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