summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2021-05-06 13:36:52 +0000
committerThibault Delavallée <tde@odoo.com>2021-05-06 15:29:12 +0000
commit879647265bf804e63bd8e89ec3ca58b51ffb29ea (patch)
tree122153229813850a0d250121dd2ea6ae47d058e2 /addons
parent6ee1484adcfee52116ca5f7889a376fd47fc6486 (diff)
[IMP] various: update query counters according to latest runbot run
Base: seems related fields take only 1 extra query instead of 3 Crm: assignment seems to have been slightly improved. Some randomness still happens. Hr Holidays: seems it was further improved beyond space frontier Test mail: those tests were a bit random, seems random is gone (hopefully) Test mail full: updated local counters Test mass mailing: seems we gained one query, updated local counters closes odoo/odoo#70486 Related: odoo/enterprise#18180 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/crm/tests/test_crm_lead_convert_mass.py8
-rw-r--r--addons/hr_holidays/tests/test_company_leave.py2
-rw-r--r--addons/test_mail/tests/test_performance.py2
-rw-r--r--addons/test_mail_full/tests/test_sms_performance.py6
-rw-r--r--addons/test_mass_mailing/tests/test_performance.py8
5 files changed, 13 insertions, 13 deletions
diff --git a/addons/crm/tests/test_crm_lead_convert_mass.py b/addons/crm/tests/test_crm_lead_convert_mass.py
index 44d6281cef2..8e007b582c2 100644
--- a/addons/crm/tests/test_crm_lead_convert_mass.py
+++ b/addons/crm/tests/test_crm_lead_convert_mass.py
@@ -5,7 +5,7 @@ from odoo.addons.crm.tests import common as crm_common
from odoo.tests.common import tagged, users
-@tagged('lead_manage')
+@tagged('lead_manage', 'crm_performance')
class TestLeadConvertMass(crm_common.TestLeadConvertMassCommon):
@classmethod
@@ -24,7 +24,7 @@ class TestLeadConvertMass(crm_common.TestLeadConvertMassCommon):
with self.assertQueryCount(user_sales_manager=0):
test_leads = self.env['crm.lead'].browse(test_leads.ids)
- with self.assertQueryCount(user_sales_manager=254): # crm only: 251
+ with self.assertQueryCount(user_sales_manager=251):
test_leads.handle_salesmen_assignment(user_ids=user_ids, team_id=False)
self.assertEqual(test_leads.team_id, self.sales_team_convert | self.sales_team_1)
@@ -42,7 +42,7 @@ class TestLeadConvertMass(crm_common.TestLeadConvertMassCommon):
with self.assertQueryCount(user_sales_manager=0):
test_leads = self.env['crm.lead'].browse(test_leads.ids)
- with self.assertQueryCount(user_sales_manager=220): # crm only: 215
+ with self.assertQueryCount(user_sales_manager=218): # still some randomness (217 spotted) - crm only: 215
test_leads.handle_salesmen_assignment(user_ids=user_ids, team_id=team_id)
self.assertEqual(test_leads.team_id, self.sales_team_convert)
@@ -166,7 +166,7 @@ class TestLeadConvertMass(crm_common.TestLeadConvertMassCommon):
test_leads = self._create_leads_batch(count=50, user_ids=[False])
user_ids = self.assign_users.ids
- with self.assertQueryCount(user_sales_manager=1363): # crm only: 1352
+ with self.assertQueryCount(user_sales_manager=1361): # still some randomness (1360 spotted) - crm only: 1352
mass_convert = self.env['crm.lead2opportunity.partner.mass'].with_context({
'active_model': 'crm.lead',
'active_ids': test_leads.ids,
diff --git a/addons/hr_holidays/tests/test_company_leave.py b/addons/hr_holidays/tests/test_company_leave.py
index c34c3c93fa2..941a5595a9a 100644
--- a/addons/hr_holidays/tests/test_company_leave.py
+++ b/addons/hr_holidays/tests/test_company_leave.py
@@ -313,7 +313,7 @@ class TestCompanyLeave(SavepointCase):
})
company_leave._compute_date_from_to()
- count = 865
+ count = 732
with self.assertQueryCount(__system__=count, admin=count):
# Original query count: 1987
# Without tracking/activity context keys: 5154
diff --git a/addons/test_mail/tests/test_performance.py b/addons/test_mail/tests/test_performance.py
index b0fad48da95..658e353a81e 100644
--- a/addons/test_mail/tests/test_performance.py
+++ b/addons/test_mail/tests/test_performance.py
@@ -623,7 +623,7 @@ class TestMailComplexPerformance(BaseMailPerformance):
customer_id = self.customer.id
user_id = self.user_portal.id
- with self.assertQueryCount(__system__=109, emp=110):
+ with self.assertQueryCount(__system__=108, emp=109):
rec = self.env['mail.test.ticket'].create({
'name': 'Test',
'container_id': container_id,
diff --git a/addons/test_mail_full/tests/test_sms_performance.py b/addons/test_mail_full/tests/test_sms_performance.py
index 58a1d245e09..cfa30321987 100644
--- a/addons/test_mail_full/tests/test_sms_performance.py
+++ b/addons/test_mail_full/tests/test_sms_performance.py
@@ -51,7 +51,7 @@ class TestSMSPerformance(BaseMailPerformance, sms_common.SMSCase):
def test_message_sms_record_1_partner(self):
record = self.test_record.with_user(self.env.user)
pids = self.customer.ids
- with self.mockSMSGateway(sms_allow_unlink=True), self.assertQueryCount(employee=23): # test_mail_enterprise: 25
+ with self.mockSMSGateway(sms_allow_unlink=True), self.assertQueryCount(employee=23): # test_mail_enterprise: 18
messages = record._message_sms(
body='Performance Test',
partner_ids=pids,
@@ -66,7 +66,7 @@ class TestSMSPerformance(BaseMailPerformance, sms_common.SMSCase):
def test_message_sms_record_10_partners(self):
record = self.test_record.with_user(self.env.user)
pids = self.partners.ids
- with self.mockSMSGateway(sms_allow_unlink=True), self.assertQueryCount(employee=41): # test_mail_enterprise: 43
+ with self.mockSMSGateway(sms_allow_unlink=True), self.assertQueryCount(employee=41):
messages = record._message_sms(
body='Performance Test',
partner_ids=pids,
@@ -80,7 +80,7 @@ class TestSMSPerformance(BaseMailPerformance, sms_common.SMSCase):
@warmup
def test_message_sms_record_default(self):
record = self.test_record.with_user(self.env.user)
- with self.mockSMSGateway(sms_allow_unlink=True), self.assertQueryCount(employee=26): # test_mail_enterprise: 28
+ with self.mockSMSGateway(sms_allow_unlink=True), self.assertQueryCount(employee=26):
messages = record._message_sms(
body='Performance Test',
)
diff --git a/addons/test_mass_mailing/tests/test_performance.py b/addons/test_mass_mailing/tests/test_performance.py
index 5ae91d52aa6..9f9e26776d0 100644
--- a/addons/test_mass_mailing/tests/test_performance.py
+++ b/addons/test_mass_mailing/tests/test_performance.py
@@ -50,8 +50,8 @@ class TestMassMailPerformance(TestMassMailPerformanceBase):
'mailing_domain': [('id', 'in', self.mm_recs.ids)],
})
- # runbot needs +50 compared to local
- with self.assertQueryCount(__system__=1714, marketing=1715):
+ # runbot needs +51 compared to local
+ with self.assertQueryCount(__system__=1714, marketing=1715): # test_mass_mailing_only: 1663 - 1664
mailing.action_send_mail()
self.assertEqual(mailing.sent, 50)
@@ -90,8 +90,8 @@ class TestMassMailBlPerformance(TestMassMailPerformanceBase):
'mailing_domain': [('id', 'in', self.mm_recs.ids)],
})
- # runbot needs +62 compared to local
- with self.assertQueryCount(__system__=1993, marketing=1994):
+ # runbot needs +70 compared to local
+ with self.assertQueryCount(__system__=1992, marketing=1993): # test_mass_mailing only: 1929 - 1930
mailing.action_send_mail()
self.assertEqual(mailing.sent, 50)