-
-
Notifications
You must be signed in to change notification settings - Fork 442
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
[17.0][MIG] test_component: Migration to 17.0 #477
Closed
nguyenminhchien
wants to merge
42
commits into
OCA:17.0
from
nguyenminhchien:17.0-mig-test_component
Closed
[17.0][MIG] test_component: Migration to 17.0 #477
nguyenminhchien
wants to merge
42
commits into
OCA:17.0
from
nguyenminhchien:17.0-mig-test_component
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The favorite lookup should be by 'usage' (kinda interface) and by model name ('components()' method). The lookup by component name should normally not be used as it reduces the flexibility. Using a different method for this lookup discourage its usage. Also, the lookup by component name completely ignores the current collection, which is bad or not bad depending of what you want to achieve.
That thinks the file contains tests.
Because they need the registry to be initialized, otherwise no component exist
the 'components' method had 2 different return types depending of the 'multi' argument. Now we have 'component' or 'many_components' that return a Component instance or a list of Component instances.
Because they can have different addons
It allows to open/close objects on start/end of a synchro / work session. The base method does none of that, but this is a really common use case. Example: at the beginning of the work session, I open a webservice client that is available in our WorkContext for the duration of our work. At the end, I close the client to end the connection.
When we want to test the implementation of a connector, it must be simple. Add 2 new test cases for TransactionCase and SavepointCase which load all the components of the dependencies addons on the tested addons. Only the components of the addons in state 'installed' are loaded, so we don't load components of addons that depend on the tested addon. The tests must call _init_global_registry and build_registry instead of _register_hook, so the registry is not set to ready. If the global registry is set to ready during tests, the event will trigger during the installation of addons which is not what we want. The existing test case is meant only to be used when one has to manipulate components in a custom registry. See discussion on guewen@447b22f#commitcomment-22851711
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: connector-16.0/connector-16.0-test_component Translate-URL: https://translation.odoo-community.org/projects/connector-16-0/connector-16-0-test_component/
Currently translated at 77.7% (7 of 9 strings) Translation: connector-16.0/connector-16.0-test_component Translate-URL: https://translation.odoo-community.org/projects/connector-16-0/connector-16-0-test_component/it/
Currently translated at 88.8% (8 of 9 strings) Translation: connector-16.0/connector-16.0-test_component Translate-URL: https://translation.odoo-community.org/projects/connector-16-0/connector-16-0-test_component/it/
Currently translated at 100.0% (9 of 9 strings) Translation: connector-16.0/connector-16.0-test_component Translate-URL: https://translation.odoo-community.org/projects/connector-16-0/connector-16-0-test_component/es/
Currently translated at 100.0% (9 of 9 strings) Translation: connector-16.0/connector-16.0-test_component Translate-URL: https://translation.odoo-community.org/projects/connector-16-0/connector-16-0-test_component/it/
6 tasks
/ocabot migration test_component |
Merged the migration of |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depend on: