-
Notifications
You must be signed in to change notification settings - Fork 9
[IMP] travis_install_nightly: Patch odoo to create unlogged DB tables #283
Conversation
9579f66
to
0577c67
Compare
travis/test_server.py
Outdated
@@ -355,6 +355,33 @@ def run_from_env_var(env_name_startswith, environ): | |||
raise RuntimeWarning("Return different to zero") | |||
|
|||
|
|||
def patch_odoo_unlogged_tables(server_path): | |||
""" Patch Odoo to make it to create all DB tables as unlogged """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strip spaces
travis/test_server.py
Outdated
if os.path.isdir(os.path.join(server_path, "odoo")): | ||
odoo_subdir = "odoo" | ||
else: | ||
odoo_subdir = "openerp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont use “else”
travis/test_server.py
Outdated
with open(filename) as f_to_patch: | ||
if not re.search("create table", f_to_patch.read(), re.IGNORECASE): | ||
continue | ||
print("\tPatchin file %s" % filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo patching
travis/test_server.py
Outdated
@@ -405,6 +432,8 @@ def main(argv=None): | |||
odoo_full = os.environ.get("ODOO_REPO", "odoo/odoo") | |||
server_path = get_server_path( | |||
odoo_full, odoo_branch or odoo_version, travis_home) | |||
if is_runbot: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it is runbot and it is gitlab
travis/travis_after_tests_success
Outdated
# Stop PostgreSQL service. Even though the container is stopped once | ||
# this script finishes, if changes are not saved before that, it | ||
# could lead to inconsistencies on unlogged tables | ||
subprocess.call(["/etc/init.d/postgresql", "stop"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove it
it is not needed anymore
Create a dummy please |
Get last changes runbot-addons from oca to vx |
db4dbd3
to
e47535e
Compare
|
This commit causes Odoo to be patched so all database tables are created as unlogged. This is applied only for testing instances because, if a docker container is stopped without firstly saving the changes, all records will be deleted; so it's not suitable for working under other environments, e.g. locally. This is compatible with the versions 7.0 to master (12.0). Closes Vauxoo#282 Co-authored-by: Moisés López <[email protected]>
e47535e
to
0f2ec01
Compare
Forget it, I have created the following PR: OCA#573 |
For the record, We missed travis-ci (It is patching just for runbot, gitlab-ci but not for travis-ci) |
This commit causes Odoo to be patched so all database tables are created as unlogged. This is applied only for testing instances because, if a docker container is stopped without firstly saving the changes, all records will be deleted; so it's not suitable for working under other environments, e.g. locally. This is compatible with the versions 7.0 to master (12.0). Co-authored-by: Moisés López <[email protected]>
This commit causes Odoo to be patched so all database tables are created
as unlogged, just after it's clonned.
It is applied just for runbot instance since that the records are
deleted after a docker stop if the postgreql service is started
This is compatible with the versions 7.0 to master (12.0).
Closes #279