-
Notifications
You must be signed in to change notification settings - Fork 23.1k
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
[IMP] tests: make post_install the default #143757
base: master
Are you sure you want to change the base?
Conversation
check-style is red because of a pylint killed by the OOM killer. Too much memory needed to check 700 files. |
7651341
to
408edd7
Compare
Yes we may also enable detailed stats to spot the most increasing classes to get a elephant the the room and maybe profile this class. We may find interesting stuff and maybe improve overall post install performances which would be great :) Anyway this task is a must have, we wanted to do that for a while in all cases so thanks for your work! |
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 disagree with this proposal.
- Post-install tests are not unit tests: they test the features of a module with plenty of other modules being installed, where some of those modules possibly modify the said features. They are integration tests, not unit tests. The default should be unit testing, not integration testing.
- Pretending that they are easier to maintain is not correct. It's only true if you depend on nothing, and nothing else depends on you. In Odoo we rarely make isolated modules.
- The main argument is the runtime on runbot. IMHO the solution is not changing the test framework design, but improving the CI tool. We can parallelize "at install" tests by installing databases where we only test a subset of the modules. What's hard is to divide the modules in subsets such that each can be run in a small amount of time.
For the record, below is my point of view about your concerns. I feel like there is a strong difference between the needs of framework and the needs of business. I would suggest to plan a meeting with key people on the subject to decide what we want to do.
I hope this is good food for thought, and I'm not attached to a particular solution, so if you think we can do better I'm all for it! I just want to have tests that are easy to run locally, a CI that takes as little time as possible, and tests that are robust enough to detect functional issues (no matter where they are introduced). I feel we can do better than now, and for my needs this PR goes into that direction. |
@rco-odoo At_install behavior is broken by construction, it only works fine for base. If you add a module coming first in the alphabetic order with the same depth all your at install tests will now use the new module on runbot. This is why we have the single module nightly builds. They test if only the modules (and auto install) are present, this is the closer to what you call a real unittest. Post install are easier to maintain because it is easy to replay them, some at_install test are very hard to debug because they fail at mid install of at_install build. This means that you need to install half the modules to be in the same scenario. For post install you can just download a dump of the database to reproduce the same scenario if it doesn't fail with the module alone. After this change, we have two simple case, only the module (nightly), or all the module (merge). The case, "all the module at the same depth present before me in the alphabetical order" disappears.
In this case you will have the overhead of the install per at_install split. The install takes ~18 minutes, the at install ~60 (it can vary, just picking one example) so ~42 minutes of tests. Most of the time when adding test, we just don't realize that it could be post install. It is usually better since there is more coverage in case of overrides. And if you need a at_install test, it can be tagged accordingly. |
@moylop260 FYI |
320d96a
to
bde7056
Compare
f7d79d5
to
37fd66a
Compare
37fd66a
to
aaad86c
Compare
36198c5
to
56994cc
Compare
Performance ----------- post_install tests are parallelized on runbot, allowing to reduce build times. With this PR, the incompressible at_install build time is reduced to 13 min (down from 36 min) for community, and to 27min (down from 61 min) for enterprise. Coverage -------- Post-install tests cover the full application (with all overrides installed) rather than a particular sub-set of the code. Tests of sub-set of the code are desirable too, but they are already tested with single-app builds on runbot. Maintenance ----------- Post-install tests are easier to maintain and to run, as dropping the database and installing it again is not necessary to run them.
56994cc
to
a0156aa
Compare
b993aae
to
1d23b49
Compare
post_install is now the default, the tags can be removed from tests.
1d23b49
to
1d69da0
Compare
Performance
post_install tests are parallelized on runbot, allowing to reduce build times. With this PR, the incompressible at_install build time is reduced to 13 min (down from 36 min) for community, and to 27min (down from 61 min) for enterprise.
Coverage
Post-install tests cover the full application (with all overrides installed) rather than a particular sub-set of the code.
Tests of sub-set of the code are desirable too, but they are already tested with single-app builds on runbot.
Maintenance
Post-install tests are easier to maintain and to run, as dropping the database and installing it again is not necessary to run them.
https://github.com/odoo/enterprise/pull/51557
odoo/design-themes#764
odoo/documentation#6670