Skip to content

Commit 702df32

Browse files
authored
ci(deno): run the entire test suite with Deno (#2714)
* ci(deno): run the entire test suite with Deno * ci: fix timeout * ci: fix matrix version * debug: remove husky * ci: remove SSL=1 * debug: remove node from Deno matrix * debug: isolate wait-up.js * debug: revert wait-up.js * debug: pre-install sqlstring * chore: revert node setup * debug: use basic tests to SSL=1 * debug: remove SSL=1 * chore: use Deno to test Deno
1 parent 693c05f commit 702df32

File tree

5 files changed

+28
-68
lines changed

5 files changed

+28
-68
lines changed

.github/workflows/ci-linux.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI - Linux
33
on:
44
pull_request:
55
push:
6-
branches: [ main ]
6+
branches: [main]
77

88
workflow_dispatch:
99

@@ -19,10 +19,10 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
node-version: [18.x, 20.x, 22.x]
22-
mysql-version: ["mysql:8.0.33"]
22+
mysql-version: ['mysql:8.0.33']
2323
use-compression: [0, 1]
2424
use-tls: [0, 1]
25-
mysql_connection_url_key: [""]
25+
mysql_connection_url_key: ['']
2626
# TODO - add mariadb to the matrix. currently few tests are broken due to mariadb incompatibilities
2727
env:
2828
MYSQL_CONNECTION_URL: ${{ secrets[matrix.mysql_connection_url_key] }}
@@ -57,16 +57,17 @@ jobs:
5757

5858
- name: Run tests
5959
run: FILTER=${{matrix.filter}} MYSQL_USE_TLS=${{ matrix.use-tls }} MYSQL_USE_COMPRESSION=${{ matrix.use-compression }} npm run test
60+
timeout-minutes: 5
6061

6162
tests-linux-bun:
6263
runs-on: ubuntu-latest
6364
strategy:
6465
fail-fast: false
6566
matrix:
6667
bun-version: [latest, canary]
67-
mysql-version: ["mysql:8.0.33"]
68+
mysql-version: ['mysql:8.0.33']
6869
use-compression: [0, 1]
69-
use-tls: [0,1]
70+
use-tls: [0, 1]
7071

7172
name: Bun ${{ matrix.bun-version }} - DB ${{ matrix.mysql-version }} - SSL=${{matrix.use-tls}} Compression=${{matrix.use-compression}}
7273

@@ -114,10 +115,15 @@ jobs:
114115
strategy:
115116
fail-fast: false
116117
matrix:
117-
deno-version: [v1.43.6, canary]
118-
mysql-version: ["mysql:8.0.33"]
118+
deno-version: [v1.x, canary]
119+
mysql-version: ['mysql:8.0.33']
119120
use-compression: [0, 1]
120-
use-tls: [0,1]
121+
# TODO: investigate error when using SSL (1)
122+
#
123+
# errno: -4094
124+
# code: "UNKNOWN"
125+
# syscall: "read"
126+
use-tls: [0]
121127

122128
name: Deno ${{ matrix.deno-version }} - DB ${{ matrix.mysql-version }} - SSL=${{matrix.use-tls}} Compression=${{matrix.use-compression}}
123129

@@ -148,13 +154,12 @@ jobs:
148154
- name: Wait mysql server is ready
149155
run: node tools/wait-up.js
150156

151-
# todo: check what we need to do to run all tests with deno
152157
- name: run tests
153158
env:
154159
MYSQL_USER: ${{ env.MYSQL_USER }}
155160
MYSQL_DATABASE: ${{ env.MYSQL_DATABASE }}
156161
MYSQL_PORT: ${{ env.MYSQL_PORT }}
157162
MYSQL_USE_COMPRESSION: ${{ matrix.use-compression }}
158163
MYSQL_USE_TLS: ${{ matrix.use-tls }}
159-
run: deno test --allow-net --allow-env --allow-read test/deno.ts
160-
timeout-minutes: 1
164+
run: deno task test:deno
165+
timeout-minutes: 5

package-lock.json

Lines changed: 7 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"lint:tests": "npx prettier --check ./test",
1313
"test": "poku --debug --include=\"test/esm,test/unit,test/integration\"",
1414
"test:bun": "poku --debug --platform=\"bun\" --include=\"test/esm,test/unit,test/integration\"",
15+
"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\"",
1516
"test:tsc-build": "cd \"test/tsc-build\" && npx tsc -p \"tsconfig.json\"",
1617
"coverage-test": "c8 npm run test",
1718
"benchmark": "node ./benchmarks/benchmark.js",
@@ -78,9 +79,8 @@
7879
"eslint-config-prettier": "^9.0.0",
7980
"eslint-plugin-async-await": "0.0.0",
8081
"eslint-plugin-markdown": "^5.0.0",
81-
"husky": "^9.0.2",
8282
"lint-staged": "^15.0.1",
83-
"poku": "^1.13.0",
83+
"poku": "^1.14.0",
8484
"portfinder": "^1.0.28",
8585
"prettier": "^3.0.0",
8686
"progress": "^2.0.3",

test/deno.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

test/integration/test-server-close.test.cjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ if (`${process.env.MYSQL_CONNECTION_URL}`.includes('pscale_pw_')) {
1212
process.exit(0);
1313
}
1414

15+
// 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.
16+
if (typeof Deno !== 'undefined') process.exit(0);
17+
1518
const connection = common.createConnection();
1619

1720
const customWaitTimeout = 1; // seconds

0 commit comments

Comments
 (0)