Help testing, improving and suggesting improvements for MySQL driver support branch
-
I have a pull request:
https://github.com/NodeBB/NodeBB/pull/13413Everything seems to work for me with my MySQL setup.
All 4947 tests are passing.That is more than the current test setup.
I fixed some wrong test discovery phase workarounds so there are more tests running now.
I solved it with top-level await to init the database in top-level instead of inbefore
, because somedescribes
depend on a running database in the test discovery phase. The workaround with putting adescribe
in anit
doesn't work.I translated many CommonJS test files to ESM files because the
require('mocks/databasemock.mjs')
doesn't work, because it contains now the top-level await. Requiring mjs files from cjs files is only allowed if the mjs doesn't contain any top-level await. Requiring mjs files is only possible without workarounds since Node.js version 20.19 (https://github.com/nodejs/node/pull/56927). So I changed the recommended Node.js version inpackage.json
to >= 20.19.0. I then found a workaround to abuse the test loading of mocha to loadmocks/databasemock.mjs
as a test before any other test and then it works because mocha can load cjs and mjs tests and the mjs tests are allowed to have top-level await and they are dynamicallyimport
ed correctly from mocha.Right now only MySQL 8.0 works. MariaDB doesn't work. At least I got an error when trying to use MariaDB and I didn't spend time fixing it.
Please help with suggestions for improvement, manual tests, ...!
-
S support@community.nodebb.org shared this topic