mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-11-01 22:08:18 +00:00
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:
1 parent
a0987016bb
commit
2433d117c2
91 files changed
+2219
-1615
No files matched your search
@@ -1,4 +1,4 @@
|
||||
name: cli-deno-tests
|
||||
name: cli-node-tests
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -6,9 +6,11 @@ on:
|
||||
- main
|
||||
- beta
|
||||
paths:
|
||||
- '.github/workflows/cli-deno-tests.yml'
|
||||
- '.github/workflows/cli-node-tests.yml'
|
||||
- 'src/apps/cli/**'
|
||||
- '!src/apps/cli/**/*.md'
|
||||
- 'test/e2e-cli/**'
|
||||
- '!test/e2e-cli/**/*.md'
|
||||
- 'src/LiveSyncBaseCore.ts'
|
||||
- 'src/common/**'
|
||||
- 'src/serviceFeatures/**'
|
||||
@@ -24,9 +26,11 @@ on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
paths:
|
||||
- '.github/workflows/cli-deno-tests.yml'
|
||||
- '.github/workflows/cli-node-tests.yml'
|
||||
- 'src/apps/cli/**'
|
||||
- '!src/apps/cli/**/*.md'
|
||||
- 'test/e2e-cli/**'
|
||||
- '!test/e2e-cli/**/*.md'
|
||||
- 'src/LiveSyncBaseCore.ts'
|
||||
- 'src/common/**'
|
||||
- 'src/serviceFeatures/**'
|
||||
@@ -42,7 +46,7 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
test_task:
|
||||
description: 'Deno test task to run'
|
||||
description: 'Node.js test task to run'
|
||||
type: choice
|
||||
options:
|
||||
- test:ci
|
||||
@@ -67,7 +71,7 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
|
||||
if: ${{ (github.event_name != 'pull_request' || !github.event.pull_request.draft) && (github.event_name != 'workflow_dispatch' || inputs.test_task != 'test:local') }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
env:
|
||||
@@ -89,10 +93,10 @@ jobs:
|
||||
|
||||
case "$SELECTED_TASK" in
|
||||
test:ci)
|
||||
TASK_MATRIX=$(jq -c . src/apps/cli/testdeno/ci-tasks.json)
|
||||
TASK_MATRIX=$(jq -c . test/e2e-cli/ci-tasks.json)
|
||||
;;
|
||||
test:local)
|
||||
TASK_MATRIX='["test:setup-put-cat","test:mirror","test:daemon"]'
|
||||
TASK_MATRIX='["test:local"]'
|
||||
;;
|
||||
test:e2e-matrix)
|
||||
TASK_MATRIX='["test:e2e-matrix:couchdb-enc0","test:e2e-matrix:couchdb-enc1","test:e2e-matrix:minio-enc0","test:e2e-matrix:minio-enc1"]'
|
||||
@@ -108,7 +112,7 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: '24.x'
|
||||
node-version: '26.x'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
@@ -127,12 +131,12 @@ jobs:
|
||||
retention-days: 1
|
||||
|
||||
test:
|
||||
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
|
||||
if: ${{ (github.event_name != 'pull_request' || !github.event.pull_request.draft) && (github.event_name != 'workflow_dispatch' || inputs.test_task != 'test:local') }}
|
||||
needs: prepare
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
DENO_DIR: ~/.cache/deno
|
||||
NODE_OPTIONS: --max-old-space-size=3072
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -144,23 +148,10 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: '24.x'
|
||||
node-version: '26.x'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: package-lock.json
|
||||
|
||||
- name: Setup Deno
|
||||
uses: denoland/setup-deno@v2
|
||||
with:
|
||||
deno-version: v2.x
|
||||
|
||||
- name: Cache Deno dependencies
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/.cache/deno
|
||||
key: ${{ runner.os }}-deno-${{ hashFiles('src/apps/cli/testdeno/deno.lock', 'src/apps/cli/testdeno/deno.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-deno-
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
@@ -184,8 +175,8 @@ jobs:
|
||||
bucketName=livesync-test-bucket-ci
|
||||
EOF
|
||||
|
||||
- name: Run Deno tests
|
||||
working-directory: src/apps/cli/testdeno
|
||||
- name: Run Node.js tests
|
||||
working-directory: test/e2e-cli
|
||||
env:
|
||||
LIVESYNC_DOCKER_MODE: native
|
||||
LIVESYNC_CLI_RETRY: 3
|
||||
@@ -194,11 +185,44 @@ jobs:
|
||||
LIVESYNC_USE_COTURN: ${{ inputs.use_coturn == true && '1' || '0' }}
|
||||
run: |
|
||||
TASK="${{ matrix.task }}"
|
||||
echo "[INFO] Running Deno task: $TASK"
|
||||
deno task "$TASK"
|
||||
echo "[INFO] Running Node.js task: $TASK"
|
||||
node run-task.ts "$TASK"
|
||||
|
||||
- name: Stop leftover containers
|
||||
if: always()
|
||||
run: |
|
||||
docker stop couchdb-test minio-test relay-test coturn-test >/dev/null 2>&1 || true
|
||||
docker rm couchdb-test minio-test relay-test coturn-test >/dev/null 2>&1 || true
|
||||
|
||||
local-smoke:
|
||||
if: ${{ (github.event_name != 'pull_request' || !github.event.pull_request.draft) && (github.event_name != 'workflow_dispatch' || inputs.test_task == 'test:local') }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 45
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
env:
|
||||
NODE_OPTIONS: --max-old-space-size=3072
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: '26.x'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build CLI
|
||||
env:
|
||||
LIVESYNC_CLI_TEST_SUPPORT: '1'
|
||||
run: npm run build --workspace self-hosted-livesync-cli
|
||||
|
||||
- name: Run local smoke tests
|
||||
working-directory: src/apps/cli
|
||||
run: node ../../../test/e2e-cli/run-task.ts test:local
|
||||
@@ -9,6 +9,8 @@ on:
|
||||
- '.github/workflows/cli-p2p-tests.yml'
|
||||
- 'src/apps/cli/**'
|
||||
- '!src/apps/cli/**/*.md'
|
||||
- 'test/e2e-cli/**'
|
||||
- '!test/e2e-cli/**/*.md'
|
||||
- 'src/LiveSyncBaseCore.ts'
|
||||
- 'src/common/**'
|
||||
- 'src/serviceFeatures/**'
|
||||
@@ -29,6 +31,8 @@ on:
|
||||
- '.github/workflows/cli-p2p-tests.yml'
|
||||
- 'src/apps/cli/**'
|
||||
- '!src/apps/cli/**/*.md'
|
||||
- 'test/e2e-cli/**'
|
||||
- '!test/e2e-cli/**/*.md'
|
||||
- 'src/LiveSyncBaseCore.ts'
|
||||
- 'src/common/**'
|
||||
- 'src/serviceFeatures/**'
|
||||
|
||||
@@ -39,7 +39,7 @@ on:
|
||||
- '.github/workflows/prepare-release.yml'
|
||||
- '.github/workflows/finalise-release.yml'
|
||||
- '.github/workflows/release.yml'
|
||||
- '.github/workflows/cli-deno-tests.yml'
|
||||
- '.github/workflows/cli-node-tests.yml'
|
||||
- '.github/workflows/cli-p2p-tests.yml'
|
||||
- '.github/workflows/cli-docker-validation.yml'
|
||||
- '.github/workflows/cli-docker.yml'
|
||||
@@ -78,7 +78,7 @@ on:
|
||||
- '.github/workflows/prepare-release.yml'
|
||||
- '.github/workflows/finalise-release.yml'
|
||||
- '.github/workflows/release.yml'
|
||||
- '.github/workflows/cli-deno-tests.yml'
|
||||
- '.github/workflows/cli-node-tests.yml'
|
||||
- '.github/workflows/cli-p2p-tests.yml'
|
||||
- '.github/workflows/cli-docker-validation.yml'
|
||||
- '.github/workflows/cli-docker.yml'
|
||||
|
||||
Reference in new issue
Block a user