Created attachment 183352 [details] [review] Bug 40170: Replace cypress-mysql with mysql2 - Cypress tests This patch suggests to replace cypress-mysql with mysql2 cypress-mysql provides a custom Cypress command (cy.query) that run within the browser context. This approach mixes test-side and server-side and is limited in flexibility and error handling. mysql2 runs inside Cypress plugins (Node process) via cy.task calls, which are executed server-side (outside the browser) This is needed for the follow-up bug reports where we need to request the DB from other plugins Test plan: Run `yarn install` to install the mysql2 All the Cypress tests modified by this patch must still pass The new test t/cypress/integration/t/db.ts must also pass
Created attachment 183359 [details] [review] Bug 40170: Replace cypress-mysql with mysql2 - Cypress tests This patch suggests to replace cypress-mysql with mysql2 cypress-mysql provides a custom Cypress command (cy.query) that run within the browser context. This approach mixes test-side and server-side and is limited in flexibility and error handling. mysql2 runs inside Cypress plugins (Node process) via cy.task calls, which are executed server-side (outside the browser) This is needed for the follow-up bug reports where we need to request the DB from other plugins Test plan: Run `yarn install` to install the mysql2 All the Cypress tests modified by this patch must still pass The new test t/cypress/integration/t/db.ts must also pass Signed-off-by: David Nind <david@davidnind.com>
Testing notes (using KTD): 1. New or changed tests: yarn cypress run --spec t/cypress/integration/Auth/csrf.ts yarn cypress run --spec t/cypress/integration/Islands/AcquisitionsMenu_spec.ts yarn cypress run --spec t/cypress/integration/KohaTable/Holdings_spec.ts yarn cypress run --spec t/cypress/integration/KohaTable/PatronSearch_spec.ts yarn cypress run --spec t/cypress/integration/t/db.ts