[18.0][BUG] web_pivot_computed_measure: unit tests fail and cause another module migration to fail

Aperta
#3,039 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
28/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, python

Direzione di ricerca

Start with web_pivot_computed_measure/tests/test_ui_pivot.py and its browser tour, then inspect the failing PivotModel.addComputedMeasure call shown in the trace. Reproduce the UI test with websocket-client installed and check how the test handles the modal and computed measure. Done means the module's tests pass and the reported missing res_users fields are no longer queried during the migration.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug stale

Module

web_pivot_computed_measure

Describe the bug

I am trying to add migration PR #3037 for web_responsive, I got an error that these fields: user_year_born, user_year_now do not exist.

`2024-12-24 18:00:42,135 250 INFO odoo odoo.addons.web_pivot_computed_measure.tests.test_ui_pivot.TestUIPivot.test_ui: waiting for threads: []
2024-12-24 18:00:42,136 250 INFO odoo odoo.addons.web_pivot_computed_measure.tests.test_ui_pivot: ======================================================================
2024-12-24 18:00:42,136 250 ERROR odoo odoo.addons.web_pivot_computed_measure.tests.test_ui_pivot: FAIL: TestUIPivot.test_ui
Traceback (most recent call last):
File "/__w/web/web/web_pivot_computed_measure/tests/test_ui_pivot.py", line 32, in test_ui
self.start_tour(
File "/opt/odoo/odoo/tests/common.py", line 2076, in start_tour
return self.browser_js(url_path=url_path, code=code, ready=ready, timeout=timeout, success_signal="tour succeeded", **kwargs)
File "/opt/odoo/odoo/tests/common.py", line 2052, in browser_js
self.fail('%s\n\n%s' % (message, error))
AssertionError: The test code "odoo.startTour('web_pivot_computed_measure_tour', {"stepDelay": 100, "keepWatchBrowser": false, "debug": false, "startUrl": "/odoo", "delayToCheckUndeterminisms": 0})" failed

FAILED: [1/18] Tour web_pivot_computed_measure_tour → Step .o_navbar_apps_menu button.
Element has been found.
BUT: It is not allowed to do action on an element that's below a modal.
TIMEOUT: The step failed to complete within 10100 ms.

2024-12-24 18:00:42,197 250 INFO odoo odoo.addons.base.models.ir_attachment: filestore gc 34 checked, 2 removed
2024-12-24 18:00:42,208 250 INFO odoo odoo.addons.web_responsive.tests.test_ir_http: Starting TestIrHttp.test_session_info ...
2024-12-24 18:00:42,213 250 ERROR odoo odoo.sql_db: bad query: b'SELECT "res_users"."id", "res_users"."partner_id", "res_users"."login", "res_users"."signature", "res_users"."active", "res_users"."action_id", "res_users"."share", "res_users"."company_id", "res_users"."create_uid", "res_users"."create_date", "res_users"."write_uid", "res_users"."write_date", "res_users"."tour_enabled", "res_users"."notification_type", "res_users"."odoobot_state", "res_users"."odoobot_failed", "res_users"."apps_menu_search_type", "res_users"."apps_menu_theme", "res_users"."is_redirect_home", "res_users"."user_year_born", "res_users"."user_year_now" FROM "res_users" WHERE ("res_users"."id" IN (2))'
ERROR: column res_users.user_year_born does not exist
LINE 1: ...apps_menu_theme", "res_users"."is_redirect_home", "res_users...`

I suggest reviewing and editing the tests as I tried to fix the issue in this PR #3038.

Unfortunately, this external module was not mentioned in the tests requirements: websocket-client

As a result the tests was not running, and after I installed websocket-client test failed.

`2024-12-25 07:26:39,542 54005 INFO web_responsive_9 odoo.addons.web_pivot_computed_measure.tests.test_ui_pivot.TestUIPivot.test_ui: waiting for threads: []
2024-12-25 07:26:39,544 54005 INFO web_responsive_9 odoo.addons.web_pivot_computed_measure.tests.test_ui_pivot: ======================================================================
2024-12-25 07:26:39,544 54005 ERROR web_responsive_9 odoo.addons.web_pivot_computed_measure.tests.test_ui_pivot: FAIL: TestUIPivot.test_ui
Traceback (most recent call last):
File "/home/kobros/Workspace/odoo18/web/web_pivot_computed_measure/tests/test_ui_pivot.py", line 62, in test_ui
self.start_tour(
File "/home/kobros/Workspace/odoo18/odoo/odoo/tests/common.py", line 2076, in start_tour
return self.browser_js(url_path=url_path, code=code, ready=ready, timeout=timeout, success_signal="tour succeeded", **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kobros/Workspace/odoo18/odoo/odoo/tests/common.py", line 2052, in browser_js
self.fail('%s\n\n%s' % (message, error))
AssertionError: The test code "odoo.startTour('web_pivot_computed_measure_tour', {"stepDelay": 100, "keepWatchBrowser": false, "debug": false, "startUrl": "/odoo", "delayToCheckUndeterminisms": 0})" failed

UncaughtTypeError: Cannot read properties of undefined (reading '__computed_id')
at PivotModel.addComputedMeasure (http://127.0.0.1:8069/web/assets/06ae128/web.assets_backend_lazy.min.js:375:229)
at DropdownItemCustomMeasure.addMeasure (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:14672:150)
at Object.mainEventHandler (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:1603:77)
at HTMLButtonElement.listener (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:762:15)
at dispatch (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:15204:71)
at triggerClick (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:15132:94)
at _pointerUp (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:15187:24)
at async _click (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:15141:456)
at async Object.click (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:15197:187)
at async TourHelpers.click (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:14733:72)
at addComputedMeasure (http://127.0.0.1:8069/web/assets/06ae128/web.assets_backend_lazy.min.js:374:228)
at addMeasure (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:14671:149)
at mainEventHandler (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:1602:76)
at listener (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:761:14)
at dispatch (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:15203:70)
at triggerClick (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:15131:93)
at _pointerUp (http://127.0.0.1:8069/web/assets/aeba509/web.assets_web.min.js:15186:23)

`

To Reproduce

Affected versions:

Steps to reproduce the behavior:

  1. install web_pivot_computed_measure without websocket-client and tests enabled
  2. install web_pivot_computed_measure with websocket-client and tests enabled

Expected behavior
In step 1 no eerors arises, just warnings, but in step 2 you get errors

@rvalyi
@zeroheure
@ovnicraft
@azmeuk
@pniederlag

Lingua principale
JavaScript
Stelle
1.2k
Fork
2.2k
Merge medio
3g 15h
PR unite (30g)
30

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OCA/web

Tutte le issue di OCA/web

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.