mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[FIX] runbot: fix test_all test for restore
This commit is contained in:
parent
d466887f08
commit
2ac70f5ab4
@ -409,28 +409,28 @@ class TestUpgradeFlow(RunbotCase):
|
|||||||
|
|
||||||
def docker_run_restore(cmd, *args, **kwargs):
|
def docker_run_restore(cmd, *args, **kwargs):
|
||||||
source_dest = first_build.params_id.dump_db.build_id.dest
|
source_dest = first_build.params_id.dump_db.build_id.dest
|
||||||
|
dump_url='http://host.runbot.com/runbot/static/build/%s/logs/%s-account.zip' % (source_dest, source_dest)
|
||||||
|
zip_name='%s-account.zip' % source_dest
|
||||||
|
db_name='%s-master-account' % str(first_build.id).zfill(5)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
str(cmd),
|
str(cmd).split(' && '),
|
||||||
' && '.join([
|
[
|
||||||
'mkdir /data/build/restore',
|
'mkdir /data/build/restore',
|
||||||
'cd /data/build/restore',
|
'cd /data/build/restore',
|
||||||
'wget {dump_url}',
|
f'wget {dump_url}',
|
||||||
'unzip -q {zip_name}',
|
f'unzip -q {zip_name}',
|
||||||
'echo "### restoring filestore"',
|
'echo "### restoring filestore"',
|
||||||
'mkdir -p /data/build/datadir/filestore/{db_name}',
|
f'mkdir -p /data/build/datadir/filestore/{db_name}',
|
||||||
'mv filestore/* /data/build/datadir/filestore/{db_name}',
|
f'mv filestore/* /data/build/datadir/filestore/{db_name}',
|
||||||
'echo "###restoring db"',
|
'echo "### restoring db"',
|
||||||
'psql -q {db_name} < dump.sql',
|
f'psql -q {db_name} < dump.sql',
|
||||||
'cd /data/build',
|
'cd /data/build',
|
||||||
'echo "### cleaning"',
|
'echo "### cleaning"',
|
||||||
'rm -r restore',
|
'rm -r restore',
|
||||||
'echo "### listing modules"',
|
'echo "### listing modules"',
|
||||||
'psql {db_name} -c "select name from ir_module_module where state = \'installed\'" -t -A > /data/build/logs/restore_modules_installed.txt'
|
f'psql {db_name} -c "select name from ir_module_module where state = \'installed\'" -t -A > /data/build/logs/restore_modules_installed.txt',
|
||||||
]).format(
|
'echo "### restore" "successful"'
|
||||||
dump_url='http://host.runbot.com/runbot/static/build/%s/logs/%s-account.zip' % (source_dest, source_dest),
|
]
|
||||||
zip_name='%s-account.zip' % source_dest,
|
|
||||||
db_name='%s-master-account' % str(first_build.id).zfill(5),
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
self.patchers['docker_run'].side_effect = docker_run_restore
|
self.patchers['docker_run'].side_effect = docker_run_restore
|
||||||
first_build.host = host.name
|
first_build.host = host.name
|
||||||
|
Loading…
Reference in New Issue
Block a user