From 7fef57faba62c584272c11f0a13e6d60492299fb Mon Sep 17 00:00:00 2001 From: lukasIO Date: Wed, 4 Feb 2026 14:48:01 +0100 Subject: [PATCH 1/5] Add bun and deno runtime tests --- .github/workflows/ci.yml | 18 ++++++++++++++++++ package.json | 6 ++++++ packages/livekit-rtc/src/tests/e2e.test.ts | 14 +++++++------- .../livekit-server-sdk/src/AccessToken.test.ts | 4 +--- 4 files changed, 32 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f1750a1..97848f43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,6 +98,24 @@ jobs: - name: Test env livekit-server-sdk (Edge Runtime) run: pnpm --filter="livekit-server-sdk" test:edge + test-bun: + name: Run tests with bun + runs-on: ubuntu-latest + steps: + - uses: oven-sh/setup-bun@v2 + - run: bun install + - run: bun test --concurrent + + test-deno: + name: Run tests with deno + runs-on: ubuntu-latest + steps: + - uses: denoland/setup-deno@v2 + with: + deno-version: v2.x # Run with latest stable Deno. + - run: deno install + - run: deno -A npm:vitest run + build: if: ${{ needs.check-changes.outputs.rtc_build == 'true' }} strategy: diff --git a/package.json b/package.json index 5927b87e..710540d3 100644 --- a/package.json +++ b/package.json @@ -41,5 +41,11 @@ "typescript": "5.8.2", "vitest": "^3.0.0" }, + "workspaces": { + "packages": [ + "packages/*", + "packages/livekit-rtc/npm/*" + ] + }, "packageManager": "pnpm@10.18.2" } diff --git a/packages/livekit-rtc/src/tests/e2e.test.ts b/packages/livekit-rtc/src/tests/e2e.test.ts index 3aad6760..5ea186fe 100644 --- a/packages/livekit-rtc/src/tests/e2e.test.ts +++ b/packages/livekit-rtc/src/tests/e2e.test.ts @@ -202,7 +202,7 @@ describeE2E('livekit-rtc e2e', () => { await dispose(); }); - it.concurrent( + it( 'connects to a room', async () => { const { roomName, rooms } = await connectTestRooms(1); @@ -225,7 +225,7 @@ describeE2E('livekit-rtc e2e', () => { testTimeoutMs, ); - it.concurrent( + it( 'connects multiple participants to the same room', async () => { const { roomName, rooms } = await connectTestRooms(2); @@ -241,7 +241,7 @@ describeE2E('livekit-rtc e2e', () => { testTimeoutMs, ); - it.concurrent( + it( 'emits participantDisconnected when a participant leaves', async () => { const { rooms } = await connectTestRooms(2); @@ -267,7 +267,7 @@ describeE2E('livekit-rtc e2e', () => { testTimeoutMs, ); - it.concurrent( + it( 'transfers audio between two participants (sine detection)', async () => { const cases = [ @@ -367,7 +367,7 @@ describeE2E('livekit-rtc e2e', () => { testTimeoutMs * 2, ); - it.concurrent( + it( 'publishes and receives reliable data packets', async () => { const { rooms } = await connectTestRooms(2); @@ -407,7 +407,7 @@ describeE2E('livekit-rtc e2e', () => { testTimeoutMs, ); - it.concurrent( + it( 'sends and receives text and byte streams', async () => { const { rooms } = await connectTestRooms(2); @@ -469,7 +469,7 @@ describeE2E('livekit-rtc e2e', () => { testTimeoutMs, ); - it.concurrent( + it( 'invokes RPC methods and returns structured errors', async () => { const { rooms } = await connectTestRooms(2); diff --git a/packages/livekit-server-sdk/src/AccessToken.test.ts b/packages/livekit-server-sdk/src/AccessToken.test.ts index c1f7036f..d7c7f659 100644 --- a/packages/livekit-server-sdk/src/AccessToken.test.ts +++ b/packages/livekit-server-sdk/src/AccessToken.test.ts @@ -59,9 +59,7 @@ describe('identity is required for only join grants', () => { const t = new AccessToken(testApiKey, testSecret); t.addGrant({ roomJoin: true }); - await expect(async () => { - await t.toJwt(); - }).rejects.toThrow(); + await expect(t.toJwt()).rejects.toThrow(); }); }); From 1f46b9cf343833db8a2ebdac11e74af13f0fc739 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Wed, 4 Feb 2026 14:49:33 +0100 Subject: [PATCH 2/5] fix test --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97848f43..73d2eba0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,6 +102,7 @@ jobs: name: Run tests with bun runs-on: ubuntu-latest steps: + - uses: actions/checkout@v6 - uses: oven-sh/setup-bun@v2 - run: bun install - run: bun test --concurrent @@ -110,6 +111,7 @@ jobs: name: Run tests with deno runs-on: ubuntu-latest steps: + - uses: actions/checkout@v6 - uses: denoland/setup-deno@v2 with: deno-version: v2.x # Run with latest stable Deno. From 681abab263ebff14e2aebcb88a75511e62cd1a8e Mon Sep 17 00:00:00 2001 From: lukasIO Date: Wed, 4 Feb 2026 15:02:31 +0100 Subject: [PATCH 3/5] update package.json --- package.json | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 710540d3..171e7841 100644 --- a/package.json +++ b/package.json @@ -41,11 +41,10 @@ "typescript": "5.8.2", "vitest": "^3.0.0" }, - "workspaces": { - "packages": [ - "packages/*", - "packages/livekit-rtc/npm/*" - ] - }, + "workspaces": [ + "examples/*", + "packages/*", + "packages/livekit-rtc/npm/*" + ], "packageManager": "pnpm@10.18.2" } From 537f406cfce151d860ec1a8d792cde2747e72392 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Wed, 4 Feb 2026 15:11:01 +0100 Subject: [PATCH 4/5] run bun tests after build on linux --- .github/workflows/ci.yml | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73d2eba0..bb0ad565 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,26 +98,6 @@ jobs: - name: Test env livekit-server-sdk (Edge Runtime) run: pnpm --filter="livekit-server-sdk" test:edge - test-bun: - name: Run tests with bun - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: oven-sh/setup-bun@v2 - - run: bun install - - run: bun test --concurrent - - test-deno: - name: Run tests with deno - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: denoland/setup-deno@v2 - with: - deno-version: v2.x # Run with latest stable Deno. - - run: deno install - - run: deno -A npm:vitest run - build: if: ${{ needs.check-changes.outputs.rtc_build == 'true' }} strategy: @@ -225,6 +205,7 @@ jobs: curl -fsSL https://rpm.nodesource.com/setup_20.x | bash - yum install -y nodejs --setopt=nodesource-nodejs.module_hotfixes=1 npm install --global pnpm + npm install --global bun groupadd -g "$HOST_GID" hostgroup 2>/dev/null || true useradd -m -u "$HOST_UID" -g "$HOST_GID" hostuser 2>/dev/null || true @@ -250,6 +231,9 @@ jobs: export LIVEKIT_API_KEY=${{ secrets.LIVEKIT_API_KEY }} export LIVEKIT_API_SECRET=${{ secrets.LIVEKIT_API_SECRET }} pnpm --filter "@livekit/rtc-node" test + bun install + bun test + " ' From cdb103ac9faf45823af7745cc8a28030c35dc975 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Thu, 5 Feb 2026 17:51:56 +0100 Subject: [PATCH 5/5] concurrency --- .github/workflows/ci.yml | 2 +- packages/livekit-rtc/src/tests/e2e.test.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb0ad565..bdcffd83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,7 +232,7 @@ jobs: export LIVEKIT_API_SECRET=${{ secrets.LIVEKIT_API_SECRET }} pnpm --filter "@livekit/rtc-node" test bun install - bun test + bun test --concurrent " ' diff --git a/packages/livekit-rtc/src/tests/e2e.test.ts b/packages/livekit-rtc/src/tests/e2e.test.ts index 5ea186fe..ad1d5af2 100644 --- a/packages/livekit-rtc/src/tests/e2e.test.ts +++ b/packages/livekit-rtc/src/tests/e2e.test.ts @@ -4,7 +4,7 @@ import { AccessToken } from 'livekit-server-sdk'; import { randomUUID } from 'node:crypto'; import { setTimeout as delay } from 'node:timers/promises'; -import { afterAll, describe, expect, it } from 'vitest'; +import { afterAll, describe, expect, it as itRaw } from 'vitest'; import { AudioFrame, AudioSource, @@ -20,6 +20,9 @@ import { dispose, } from '../index.js'; +// use concurrent testing if available on the runner (currently not supported by bun's api) +const it = typeof itRaw.concurrent === 'function' ? itRaw.concurrent : itRaw; + const hasE2EEnv = !!process.env.LIVEKIT_URL && !!process.env.LIVEKIT_API_KEY && !!process.env.LIVEKIT_API_SECRET; const describeE2E = hasE2EEnv ? describe : describe.skip;