Migrate CLI E2E tests to Node.js 26

Run the CLI subprocess suites and benchmark tools as native TypeScript with
node:test, and move them under test/e2e-cli.

Update CI and Compose runners, run local smoke tests on Linux, macOS, and
Windows, and collect source-mapped CLI coverage with c8.
This commit is contained in:
vorotamoroz committed 2026-10-31 06:01:30 +00:00
1 parent a0987016bb
commit 2433d117c2
91 files changed
+2219 -1615

No files matched your search

+3 -18
View File
@@ -1,14 +1,11 @@
# syntax=docker/dockerfile:1
FROM node:24-slim
FROM node:26-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl unzip python3 make g++ iproute2 libjpeg-turbo-progs time \
&& rm -rf /var/lib/apt/lists/*
ENV DENO_INSTALL=/usr/local
RUN curl -fsSL https://deno.land/install.sh | sh
WORKDIR /workspace
COPY package.json package-lock.json ./
@@ -20,22 +17,10 @@ RUN npm ci
COPY . .
RUN NODE_OPTIONS=--max-old-space-size=3072 LIVESYNC_CLI_TEST_SUPPORT=1 npm run build -w self-hosted-livesync-cli
WORKDIR /workspace/src/apps/cli/testdeno
RUN deno cache --lock=deno.lock \
bench-network-cases.ts \
bench-latency-sweep.ts \
bench-p2p-split-node.ts \
bench-p2p.ts \
bench-couchdb.ts \
bench-compression.ts \
test-p2p-sync.ts \
test-p2p-automatic-host.ts \
test-p2p-replicator-replacement.ts \
test-p2p-relay-disconnect.ts
WORKDIR /workspace/test/e2e-cli
COPY test/bench-network/run-bench.sh /usr/local/bin/run-livesync-bench
COPY src/apps/cli/testdeno/run-cli-e2e.sh /usr/local/bin/run-livesync-cli-e2e
COPY test/e2e-cli/run-cli-e2e.sh /usr/local/bin/run-livesync-cli-e2e
RUN chmod +x /usr/local/bin/run-livesync-bench /usr/local/bin/run-livesync-cli-e2e
CMD ["run-livesync-bench"]
+13 -13
View File
@@ -74,10 +74,10 @@ services:
BENCH_COMMAND: ${BENCH_COMMAND:-cases}
BENCH_CASES: ${BENCH_CASES:-couchdb-baseline,p2p-direct-local}
BENCH_REPEAT_COUNT: ${BENCH_REPEAT_COUNT:-1}
BENCH_CASES_ROOT: /workspace/src/apps/cli/testdeno/bench-results
BENCH_COMPRESSION_RESULT_ROOT: /workspace/src/apps/cli/testdeno/bench-results
BENCH_CASES_ROOT: /workspace/test/e2e-cli/bench-results
BENCH_COMPRESSION_RESULT_ROOT: /workspace/test/e2e-cli/bench-results
BENCH_COMPRESSION_REPEAT_COUNT: ${BENCH_COMPRESSION_REPEAT_COUNT:-1}
BENCH_SWEEP_ROOT: /workspace/src/apps/cli/testdeno/bench-results
BENCH_SWEEP_ROOT: /workspace/test/e2e-cli/bench-results
BENCH_SWEEP_RTT_MS: ${BENCH_SWEEP_RTT_MS:-20,50,100,150,300}
BENCH_SWEEP_INCLUDE_P2P: ${BENCH_SWEEP_INCLUDE_P2P:-true}
BENCH_COUCHDB_MANAGED: "false"
@@ -110,7 +110,7 @@ services:
TURN_SERVERS: ${TURN_SERVERS:-none}
LIVESYNC_P2P_PEERS_RETRY: ${LIVESYNC_P2P_PEERS_RETRY:-1}
volumes:
- ./bench-results:/workspace/src/apps/cli/testdeno/bench-results
- ./bench-results:/workspace/test/e2e-cli/bench-results
couchdb-shim:
build:
@@ -156,8 +156,8 @@ services:
BENCH_COMMAND: ${BENCH_COMMAND:-cases}
BENCH_CASES: ${BENCH_CASES:-couchdb-netem-home-wifi}
BENCH_REPEAT_COUNT: ${BENCH_REPEAT_COUNT:-1}
BENCH_CASES_ROOT: /workspace/src/apps/cli/testdeno/bench-results
BENCH_SWEEP_ROOT: /workspace/src/apps/cli/testdeno/bench-results
BENCH_CASES_ROOT: /workspace/test/e2e-cli/bench-results
BENCH_SWEEP_ROOT: /workspace/test/e2e-cli/bench-results
BENCH_COUCHDB_MANAGED: "false"
BENCH_COUCHDB_BACKEND_URI: http://couchdb-shim:5984
BENCH_SHIM_COUCHDB_URI: http://couchdb-shim:5984
@@ -173,7 +173,7 @@ services:
BENCH_SYNC_TIMEOUT: ${BENCH_SYNC_TIMEOUT:-300}
BENCH_LIVESYNC_TEST_TEE: ${BENCH_LIVESYNC_TEST_TEE:-0}
volumes:
- ./bench-results:/workspace/src/apps/cli/testdeno/bench-results
- ./bench-results:/workspace/test/e2e-cli/bench-results
p2p-signalling-shim:
build:
@@ -219,7 +219,7 @@ services:
BENCH_COMMAND: ${BENCH_COMMAND:-cases}
BENCH_CASES: ${BENCH_CASES:-p2p-signalling-netem-home-wifi}
BENCH_REPEAT_COUNT: ${BENCH_REPEAT_COUNT:-1}
BENCH_CASES_ROOT: /workspace/src/apps/cli/testdeno/bench-results
BENCH_CASES_ROOT: /workspace/test/e2e-cli/bench-results
BENCH_SIGNAL_SHIM_RELAY: ws://p2p-signalling-shim:7777/
BENCH_MD_FILE_COUNT: ${BENCH_MD_FILE_COUNT:-20}
BENCH_MD_MIN_SIZE_BYTES: ${BENCH_MD_MIN_SIZE_BYTES:-512}
@@ -232,7 +232,7 @@ services:
LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS: ${LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS:-60000}
BENCH_LIVESYNC_TEST_TEE: ${BENCH_LIVESYNC_TEST_TEE:-0}
volumes:
- ./bench-results:/workspace/src/apps/cli/testdeno/bench-results
- ./bench-results:/workspace/test/e2e-cli/bench-results
p2p-split-host:
build:
@@ -250,7 +250,7 @@ services:
BENCH_P2P_SPLIT_ROLE: host
BENCH_SPLIT_RUN_ID: ${BENCH_SPLIT_RUN_ID:-bench-split-run}
BENCH_SPLIT_WORK_ROOT: /p2p-work
BENCH_SPLIT_RESULT_ROOT: /workspace/src/apps/cli/testdeno/bench-results
BENCH_SPLIT_RESULT_ROOT: /workspace/test/e2e-cli/bench-results
BENCH_RELAY: ws://nostr-relay:7777/
BENCH_APP_ID: ${BENCH_APP_ID:-self-hosted-livesync-cli-benchmark}
BENCH_ROOM_ID: ${BENCH_ROOM_ID:-bench-split-room}
@@ -276,7 +276,7 @@ services:
LIVESYNC_TEST_TEE: ${BENCH_LIVESYNC_TEST_TEE:-0}
volumes:
- p2p-split-work:/p2p-work
- ./bench-results:/workspace/src/apps/cli/testdeno/bench-results
- ./bench-results:/workspace/test/e2e-cli/bench-results
p2p-split-client:
build:
@@ -296,7 +296,7 @@ services:
BENCH_P2P_SPLIT_ROLE: client
BENCH_SPLIT_RUN_ID: ${BENCH_SPLIT_RUN_ID:-bench-split-run}
BENCH_SPLIT_WORK_ROOT: /p2p-work
BENCH_SPLIT_RESULT_ROOT: /workspace/src/apps/cli/testdeno/bench-results
BENCH_SPLIT_RESULT_ROOT: /workspace/test/e2e-cli/bench-results
BENCH_RELAY: ws://nostr-relay:7777/
BENCH_APP_ID: ${BENCH_APP_ID:-self-hosted-livesync-cli-benchmark}
BENCH_ROOM_ID: ${BENCH_ROOM_ID:-bench-split-room}
@@ -317,7 +317,7 @@ services:
LIVESYNC_TEST_TEE: ${BENCH_LIVESYNC_TEST_TEE:-0}
volumes:
- p2p-split-work:/p2p-work
- ./bench-results:/workspace/src/apps/cli/testdeno/bench-results
- ./bench-results:/workspace/test/e2e-cli/bench-results
netem-smoke:
build:
+4 -4
View File
@@ -3,16 +3,16 @@ set -eu
case "${BENCH_COMMAND:-cases}" in
cases)
exec deno task bench:cases
exec node run-task.ts bench:cases
;;
latency-sweep)
exec deno task bench:latency-sweep
exec node run-task.ts bench:latency-sweep
;;
compression)
exec deno task bench:compression
exec node run-task.ts bench:compression
;;
p2p-split-node)
exec deno task bench:p2p-split-node
exec node run-task.ts bench:p2p-split-node
;;
*)
echo "Unknown BENCH_COMMAND: ${BENCH_COMMAND}" >&2