diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f1750a1..bdcffd83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -205,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 @@ -230,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 --concurrent + " ' diff --git a/package.json b/package.json index 5927b87e..171e7841 100644 --- a/package.json +++ b/package.json @@ -41,5 +41,10 @@ "typescript": "5.8.2", "vitest": "^3.0.0" }, + "workspaces": [ + "examples/*", + "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..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; @@ -202,7 +205,7 @@ describeE2E('livekit-rtc e2e', () => { await dispose(); }); - it.concurrent( + it( 'connects to a room', async () => { const { roomName, rooms } = await connectTestRooms(1); @@ -225,7 +228,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 +244,7 @@ describeE2E('livekit-rtc e2e', () => { testTimeoutMs, ); - it.concurrent( + it( 'emits participantDisconnected when a participant leaves', async () => { const { rooms } = await connectTestRooms(2); @@ -267,7 +270,7 @@ describeE2E('livekit-rtc e2e', () => { testTimeoutMs, ); - it.concurrent( + it( 'transfers audio between two participants (sine detection)', async () => { const cases = [ @@ -367,7 +370,7 @@ describeE2E('livekit-rtc e2e', () => { testTimeoutMs * 2, ); - it.concurrent( + it( 'publishes and receives reliable data packets', async () => { const { rooms } = await connectTestRooms(2); @@ -407,7 +410,7 @@ describeE2E('livekit-rtc e2e', () => { testTimeoutMs, ); - it.concurrent( + it( 'sends and receives text and byte streams', async () => { const { rooms } = await connectTestRooms(2); @@ -469,7 +472,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(); }); });