diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 9df30a8cd1..01c5a3cb4d 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -3,7 +3,7 @@ name: CI - Linux on: pull_request: push: - branches: [ main ] + branches: [main] workflow_dispatch: @@ -19,10 +19,10 @@ jobs: fail-fast: false matrix: node-version: [18.x, 20.x, 22.x] - mysql-version: ["mysql:8.0.33"] + mysql-version: ['mysql:8.0.33'] use-compression: [0, 1] use-tls: [0, 1] - mysql_connection_url_key: [""] + mysql_connection_url_key: [''] # TODO - add mariadb to the matrix. currently few tests are broken due to mariadb incompatibilities env: MYSQL_CONNECTION_URL: ${{ secrets[matrix.mysql_connection_url_key] }} @@ -57,6 +57,7 @@ jobs: - name: Run tests run: FILTER=${{matrix.filter}} MYSQL_USE_TLS=${{ matrix.use-tls }} MYSQL_USE_COMPRESSION=${{ matrix.use-compression }} npm run test + timeout-minutes: 5 tests-linux-bun: runs-on: ubuntu-latest @@ -64,9 +65,9 @@ jobs: fail-fast: false matrix: bun-version: [latest, canary] - mysql-version: ["mysql:8.0.33"] + mysql-version: ['mysql:8.0.33'] use-compression: [0, 1] - use-tls: [0,1] + use-tls: [0, 1] name: Bun ${{ matrix.bun-version }} - DB ${{ matrix.mysql-version }} - SSL=${{matrix.use-tls}} Compression=${{matrix.use-compression}} @@ -114,10 +115,15 @@ jobs: strategy: fail-fast: false matrix: - deno-version: [v1.43.6, canary] - mysql-version: ["mysql:8.0.33"] + deno-version: [v1.x, canary] + mysql-version: ['mysql:8.0.33'] use-compression: [0, 1] - use-tls: [0,1] + # TODO: investigate error when using SSL (1) + # + # errno: -4094 + # code: "UNKNOWN" + # syscall: "read" + use-tls: [0] name: Deno ${{ matrix.deno-version }} - DB ${{ matrix.mysql-version }} - SSL=${{matrix.use-tls}} Compression=${{matrix.use-compression}} @@ -148,7 +154,6 @@ jobs: - name: Wait mysql server is ready run: node tools/wait-up.js - # todo: check what we need to do to run all tests with deno - name: run tests env: MYSQL_USER: ${{ env.MYSQL_USER }} @@ -156,5 +161,5 @@ jobs: MYSQL_PORT: ${{ env.MYSQL_PORT }} MYSQL_USE_COMPRESSION: ${{ matrix.use-compression }} MYSQL_USE_TLS: ${{ matrix.use-tls }} - run: deno test --allow-net --allow-env --allow-read test/deno.ts - timeout-minutes: 1 \ No newline at end of file + run: deno task test:deno + timeout-minutes: 5 diff --git a/package-lock.json b/package-lock.json index a417b285e2..7052e9c34b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,9 +30,8 @@ "eslint-config-prettier": "^9.0.0", "eslint-plugin-async-await": "0.0.0", "eslint-plugin-markdown": "^5.0.0", - "husky": "^9.0.2", "lint-staged": "^15.0.1", - "poku": "^1.13.0", + "poku": "^1.14.0", "portfinder": "^1.0.28", "prettier": "^3.0.0", "progress": "^2.0.3", @@ -1487,21 +1486,6 @@ "node": ">=16.17.0" } }, - "node_modules/husky": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.6.tgz", - "integrity": "sha512-EEuw/rfTiMjOfuL7pGO/i9otg1u36TXxqjIA6D9qxVjd/UXoDOsLor/BSFf5hTK50shwzCU3aVVwdXDp/lp7RA==", - "dev": true, - "bin": { - "husky": "bin.js" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/typicode" - } - }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -2408,9 +2392,9 @@ "dev": true }, "node_modules/poku": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/poku/-/poku-1.13.0.tgz", - "integrity": "sha512-B84dFiA0tRI5ZyJDSZw/kKIydgx1DrVy2YVKvkuIrlz6rIPTGCdB8630dmUy6a07JnClypnE5k9Y41wBJ3/S+A==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/poku/-/poku-1.14.0.tgz", + "integrity": "sha512-o//neq31fT3eB1LQZpqYnQkkX36ieisGGtuCwFO7COOOyyt+QkCVSDjE4Up/xeI7x0Jn7cIR+Oqp54bqRfyLXw==", "dev": true, "license": "MIT", "bin": { @@ -4188,12 +4172,6 @@ "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", "dev": true }, - "husky": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.6.tgz", - "integrity": "sha512-EEuw/rfTiMjOfuL7pGO/i9otg1u36TXxqjIA6D9qxVjd/UXoDOsLor/BSFf5hTK50shwzCU3aVVwdXDp/lp7RA==", - "dev": true - }, "iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -4820,9 +4798,9 @@ "dev": true }, "poku": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/poku/-/poku-1.13.0.tgz", - "integrity": "sha512-B84dFiA0tRI5ZyJDSZw/kKIydgx1DrVy2YVKvkuIrlz6rIPTGCdB8630dmUy6a07JnClypnE5k9Y41wBJ3/S+A==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/poku/-/poku-1.14.0.tgz", + "integrity": "sha512-o//neq31fT3eB1LQZpqYnQkkX36ieisGGtuCwFO7COOOyyt+QkCVSDjE4Up/xeI7x0Jn7cIR+Oqp54bqRfyLXw==", "dev": true }, "portfinder": { diff --git a/package.json b/package.json index c8fab15ce1..a0196169a4 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "lint:tests": "npx prettier --check ./test", "test": "poku --debug --include=\"test/esm,test/unit,test/integration\"", "test:bun": "poku --debug --platform=\"bun\" --include=\"test/esm,test/unit,test/integration\"", + "test:deno": "deno run --allow-read --allow-env --allow-run npm:poku --debug --platform=\"deno\" --deno-allow=\"read,env,net,sys\" --deno-cjs=\".js,.cjs\" --include=\"test/esm,test/unit,test/integration\"", "test:tsc-build": "cd \"test/tsc-build\" && npx tsc -p \"tsconfig.json\"", "coverage-test": "c8 npm run test", "benchmark": "node ./benchmarks/benchmark.js", @@ -78,9 +79,8 @@ "eslint-config-prettier": "^9.0.0", "eslint-plugin-async-await": "0.0.0", "eslint-plugin-markdown": "^5.0.0", - "husky": "^9.0.2", "lint-staged": "^15.0.1", - "poku": "^1.13.0", + "poku": "^1.14.0", "portfinder": "^1.0.28", "prettier": "^3.0.0", "progress": "^2.0.3", diff --git a/test/deno.ts b/test/deno.ts deleted file mode 100644 index ae5e6ba987..0000000000 --- a/test/deno.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { createRequire } from 'node:module'; -const require = createRequire(import.meta.url); -const mysql = require('../index.js'); - -const connection = mysql.createConnection({ - host: Deno.env.get('MYSQL_HOST'), - port: Deno.env.get('MYSQL_PORT'), - user: Deno.env.get('MYSQL_USER'), - password: Deno.env.get('MYSQL_PASSWORD'), - database: Deno.env.get('MYSQL_DATABASE'), -}); - -connection.on('error', (err: Error) => { - console.error(err); - Deno.exit(1); -}); - -connection.on('connect', () => { - connection.query('SELECT 1 + 1 AS solution', (err: Error) => { - if (err) { - console.error(err); - Deno.exit(1); - } - connection.end(); - }); -}); diff --git a/test/integration/test-server-close.test.cjs b/test/integration/test-server-close.test.cjs index 7a20e34051..6ed4f6a999 100644 --- a/test/integration/test-server-close.test.cjs +++ b/test/integration/test-server-close.test.cjs @@ -12,6 +12,9 @@ if (`${process.env.MYSQL_CONNECTION_URL}`.includes('pscale_pw_')) { process.exit(0); } +// Uncaught AssertionError: Connection lost: The server closed the connection. == The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior. +if (typeof Deno !== 'undefined') process.exit(0); + const connection = common.createConnection(); const customWaitTimeout = 1; // seconds