-
-
Notifications
You must be signed in to change notification settings - Fork 785
[16.0][FIX] openupgrade_framework : end-migration scripts are forced … #4107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| from . import test_base_migration | ||
| from . import test_newly_installed_end_migration |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Copyright 2023 Odoo Community Association (OCA) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not testing really the feature, as this module is not installed during the upgrade.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @pedrobaeza Look at .github/workflows/test.yml, this file is copied to spreadsheet directory which is installed during the upgrade. Do you think I should create a directory containing only tests ?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I see, it seems it works for this version, but for the next ones, |
||
| # Copyright 2023 Guillaume Masson <[email protected]> | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
| import logging | ||
|
|
||
| from openupgradelib import openupgrade | ||
|
|
||
| _logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| @openupgrade.migrate(no_version=True) | ||
| def migrate(env, version): | ||
| params = env["ir.config_parameter"].sudo() | ||
| params.set_param("openupgrade.test_end_migration", "Executed") | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from odoo.tests import TransactionCase, tagged | ||
|
|
||
|
|
||
| @tagged("-at_install", "post_install") | ||
| class TestNewlyInstalledEndMigration(TransactionCase): | ||
| def test_newly_installed_end_migration(self): | ||
| """Make sure the code of the end-migration script has been executed""" | ||
| params = self.env["ir.config_parameter"].sudo() | ||
| res = params.get_param("openupgrade.test_end_migration", default="Not executed") | ||
| self.assertEqual(res, "Executed") |
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.
I think you should adapt the docstring of this method...