Skip to content

Commit a872a75

Browse files
committed
[16.0][IMP] l10n_br_setup_tests: house the performance test framework here (as suggested in review)
Move the l10n_br performance testing framework out of the business modules and into l10n_br_setup_tests, so it no longer pollutes l10n_br_account / l10n_br_sale with test infrastructure unrelated to those modules' domain. Suggested by @rvalyi in the review of PR #4741. Moved (history preserved via git mv): - l10n_br_account/tests/perf_common.py -> l10n_br_setup_tests/tests/perf_common.py - l10n_br_account/tests/test_performance.py -> l10n_br_setup_tests/tests/test_performance_account.py - l10n_br_sale/tests/test_performance.py -> l10n_br_setup_tests/tests/test_performance_sale.py The moved suites still reuse l10n_br_account's AccountMoveBRCommon (imported via odoo.addons.l10n_br_account.tests.common, which stays in l10n_br_account) and now import PerfMixin from the local perf_common. l10n_br_setup_tests gains l10n_br_account and l10n_br_sale as dependencies so the common test class, the fiscal demo records and the fiscal sale.order model are available. Opt-in behaviour is unchanged: both suites keep the "-standard"/"l10n_br_performance" tags, so they are excluded from the default test run and executed only with --test-tags l10n_br_performance.
1 parent 38c462e commit a872a75

8 files changed

Lines changed: 12 additions & 5 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
if: contains(github.event.pull_request.labels.*.name, 'performance')
8181
run: |
8282
unbuffer $(which odoo) -d ${PGDATABASE} \
83-
-u l10n_br_account,l10n_br_sale --test-enable \
83+
-u l10n_br_account,l10n_br_sale,l10n_br_setup_tests --test-enable \
8484
--test-tags l10n_br_performance --stop-after-init
8585
- uses: codecov/codecov-action@v4
8686
with:

l10n_br_account/tests/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@
99
from . import test_multi_localizations_invoice
1010
from . import test_payment_status
1111
from . import test_move_workflow
12-
from . import test_performance

l10n_br_sale/tests/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@
66
from . import test_l10n_br_sale_pricelist
77
from . import test_sale_order_report
88
from . import test_sale_order_ind_final
9-
from . import test_performance

l10n_br_setup_tests/__manifest__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
# "mrp",
1717
# "l10n_br_sale_stock",
1818
"base_technical_features",
19+
# Performance test framework moved here from l10n_br_account/l10n_br_sale
20+
# (needs AccountMoveBRCommon, the fiscal demo records and the fiscal
21+
# sale.order model).
22+
"l10n_br_account",
23+
"l10n_br_sale",
1924
],
2025
"installable": True,
2126
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
# from . import test_sale_picking
2+
from . import test_performance_account
3+
from . import test_performance_sale

l10n_br_account/tests/test_performance.py renamed to l10n_br_setup_tests/tests/test_performance_account.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151

5252
from odoo.tests.common import tagged, warmup
5353

54-
from .common import AccountMoveBRCommon
54+
from odoo.addons.l10n_br_account.tests.common import AccountMoveBRCommon
55+
5556
from .perf_common import PerfMixin
5657

5758
LINES_SIMPLE = 2

l10n_br_sale/tests/test_performance.py renamed to l10n_br_setup_tests/tests/test_performance_sale.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
from odoo.tests.common import tagged, warmup
4242

4343
from odoo.addons.l10n_br_account.tests.common import AccountMoveBRCommon
44-
from odoo.addons.l10n_br_account.tests.perf_common import PerfMixin
44+
45+
from .perf_common import PerfMixin
4546

4647
LINES_SIMPLE = 2
4748
LINES_COMPLEX = 30

0 commit comments

Comments
 (0)