From 53bc79f7f1ecf477c82db3727bf2001601dc7be2 Mon Sep 17 00:00:00 2001 From: odoomates Date: Wed, 18 Nov 2026 12:23:20 +0300 Subject: [PATCH 1/4] [FIX] om_shopify: expect warnings in tests --- om_shopify/tests/test_oauth.py | 14 ++++++++------ om_shopify/tests/test_webhook.py | 6 ++++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/om_shopify/tests/test_oauth.py b/om_shopify/tests/test_oauth.py index eccf1ad8..8b7792a9 100644 --- a/om_shopify/tests/test_oauth.py +++ b/om_shopify/tests/test_oauth.py @@ -70,12 +70,14 @@ def test_install_by_link(self): def test_forged_or_wrong_callback(self): state = self._start() params = {'code': 'abc', 'shop': 'partner-shop.myshopify.com', 'state': state, 'timestamp': '1'} - response, fake = self._callback({**params, 'hmac': sign('forged', params)}) - self.assertEqual(response.status_code, 403) - self.assertFalse([c for c in fake.calls if c[0] == 'token'], "no code exchange without the signature") - other = {**params, 'shop': 'evil-shop.myshopify.com'} - response, _fake = self._callback({**other, 'hmac': sign('app-secret', other)}) - self.assertEqual(response.status_code, 403) + with self.assertLogs('odoo.addons.om_shopify.controllers.oauth', 'WARNING') as logs: + response, fake = self._callback({**params, 'hmac': sign('forged', params)}) + self.assertEqual(response.status_code, 403) + self.assertFalse([c for c in fake.calls if c[0] == 'token'], "no code exchange without the signature") + other = {**params, 'shop': 'evil-shop.myshopify.com'} + response, _fake = self._callback({**other, 'hmac': sign('app-secret', other)}) + self.assertEqual(response.status_code, 403) + self.assertEqual(len(logs.records), 2, "each refused callback is logged") response, _fake = self._callback({**params, 'state': 'unknown', 'hmac': 'x'}) self.assertEqual(response.status_code, 403) self.store.invalidate_recordset() diff --git a/om_shopify/tests/test_webhook.py b/om_shopify/tests/test_webhook.py index c819a9f3..0fb57a62 100644 --- a/om_shopify/tests/test_webhook.py +++ b/om_shopify/tests/test_webhook.py @@ -44,8 +44,10 @@ def test_signed_webhook_is_queued_once(self): self.assertFalse(self.store.access_token) def test_wrong_signature_or_shop(self): - self.assertEqual(self._post({'id': 1}, secret='forged').status_code, 401) - self.assertEqual(self._post({'id': 1}, shop='other.myshopify.com').status_code, 401) + with self.assertLogs('odoo.addons.om_shopify.controllers.webhook', 'WARNING') as logs: + self.assertEqual(self._post({'id': 1}, secret='forged').status_code, 401) + self.assertEqual(self._post({'id': 1}, shop='other.myshopify.com').status_code, 401) + self.assertEqual(len(logs.records), 2, "each refused webhook is logged") self.assertFalse(self._jobs()) def test_unhandled_topic_is_ignored(self): From 628f5cdcd0c7d98dde370232e0f99421039bf93f Mon Sep 17 00:00:00 2001 From: odoomates Date: Wed, 18 Nov 2026 12:23:20 +0300 Subject: [PATCH 2/4] [FIX] om_woocommerce: expect warnings in tests --- om_woocommerce/tests/test_webhook.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/om_woocommerce/tests/test_webhook.py b/om_woocommerce/tests/test_webhook.py index 4c763ec9..c7ca1667 100644 --- a/om_woocommerce/tests/test_webhook.py +++ b/om_woocommerce/tests/test_webhook.py @@ -37,7 +37,8 @@ def test_signed_webhook_is_queued_once(self): def test_wrong_signature(self): body = json.dumps({'id': 1}).encode() - self.assertEqual(self.post(body, secret='not-the-secret').status_code, 401) + with self.assertLogs('odoo.addons.om_woocommerce.controllers.webhook', 'WARNING'): + self.assertEqual(self.post(body, secret='not-the-secret').status_code, 401) self.assertFalse(self.jobs()) def test_ping_and_unknown(self): From 047d343ece31706a5498d5c366f45ae8e99101ac Mon Sep 17 00:00:00 2001 From: odoomates Date: Wed, 18 Nov 2026 13:29:34 +0300 Subject: [PATCH 3/4] [FIX] om_spreadsheet_account: dashboard test race --- om_spreadsheet_account/tests/common.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/om_spreadsheet_account/tests/common.py b/om_spreadsheet_account/tests/common.py index f3c6c4c1..642487e2 100644 --- a/om_spreadsheet_account/tests/common.py +++ b/om_spreadsheet_account/tests/common.py @@ -12,7 +12,11 @@ const expected = %(expected)s; const { helpers } = odoo.loader.modules.get("@odoo/o-spreadsheet"); const loader = odoo.__WOWL_DEBUG__.root.env.services.spreadsheet_dashboard_loader; - await loader.load(); + // the action has loaded the dashboards already: loading them again would give the dashboard on the screen a + // new model while it is shown + if (!loader.getDashboardGroups().length) { + await loader.load(); + } const found = {}; for (const group of loader.getDashboardGroups()) { for (const dashboard of group.dashboards) { From 9b4589138c73f64a6541394ce34f1bb1c85f266d Mon Sep 17 00:00:00 2001 From: odoomates Date: Wed, 18 Nov 2026 13:29:34 +0300 Subject: [PATCH 4/4] [FIX] .github: start Chrome once before the tests --- .github/scripts/run_odoo_tests.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/scripts/run_odoo_tests.sh b/.github/scripts/run_odoo_tests.sh index 9e5b7b5a..bc59d59d 100755 --- a/.github/scripts/run_odoo_tests.sh +++ b/.github/scripts/run_odoo_tests.sh @@ -39,6 +39,15 @@ dropdb --if-exists "$db" >/dev/null 2>&1 # (child_of, moving a record with its children) right createdb --encoding=UTF8 --lc-collate=C --template=template0 "$db" || exit 1 +# the first start of Chrome on a new machine can take longer than the 10 seconds Odoo waits for it, which skips +# the browser test with a warning: start it once before +for chrome in google-chrome chromium chromium-browser; do + if command -v "$chrome" >/dev/null; then + timeout 60 "$chrome" --headless --no-sandbox --disable-gpu --dump-dom about:blank >/dev/null 2>&1 + break + fi +done + echo "Installing $modules on $db, testing $tags" "$python" "$odoo/odoo-bin" -c "$conf" -d "$db" -i "$modules" --with-demo --test-tags "$tags" \ --stop-after-init --http-port "${HTTP_PORT:-8069}" > "$log" 2>&1