User tests: Successful: Unsuccessful:
Pull Request resolves # .
deleteInsertedItems() in tests/System/plugins/db.mjs cleans up the rows created by cy.db_* commands after each test. For users, articles and modules it also deletes from dependent tables (#__user_usergroup_map, #__user_profiles, #__session, #__content_frontpage, #__contentitem_tag_map, #__workflow_associations, #__modules_menu).
Those dependent DELETEs were pushed into the promises array from inside a .then() callback, i.e. after Promise.all(promises) had already been called on it. So the cleanupDB task resolved before they finished and any error in them was lost. The next test could start while the cleanup was still running.
This PR:
Promise.all() of them from the .then(), so the cleanup task only resolves when everything is deleted.if (error && error.errno) resolved with undefined for errors without an errno, which hid them. The PostgreSQL branch already rejects on every error.No test files are changed.
Run the System Tests, e.g. the specs which create users, articles and modules:
npx cypress run --spec 'tests/System/integration/install/Installation.cy.js,tests/System/integration/administrator/components/com_users/Users.cy.js,tests/System/integration/administrator/components/com_content/Article.cy.js,tests/System/integration/administrator/components/com_modules/Module.cy.js'
or the complete suite. Code review: compare the old and new deleteInsertedItems().
The cleanup of dependent tables runs after the cleanupDB task has already resolved. MySQL errors without errno are silently ignored.
All tests pass. The cleanupDB task waits for all DELETE queries, and DB errors fail the test.
Tested locally in the joomlaprojects/docker-images:cypress8.5 image (PHP 8.5) with MySQL 8.4 and Chrome: complete suite with all specs (169 incl. the re-enabled smart search spec): 726 passed, 2 skipped, 1 failed. The failure is plugins/system/webauthn/WebauthnPlugin.cy.js, because plugins/system/webauthn/fido.jwt could not be downloaded in my local container (CI provides it as artifact). It is unrelated to this change.
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | JavaScript Unit Tests |
I have tested this item ✅ successfully on 724885e
I have tested this item ✅ successfully on 724885e
I have tested this item ✅ successfully on 724885e
RTC
RTC
RTC
| Status | Pending | ⇒ | Ready to Commit |
RTC
RTC
I have tested this item ✅ successfully on 724885e
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48781.