Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

"
'

Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,10 @@
"typescript": "5.8.2",
"vitest": "^3.0.0"
},
"workspaces": [
"examples/*",
"packages/*",
"packages/livekit-rtc/npm/*"
],
"packageManager": "pnpm@10.18.2"
}
19 changes: 11 additions & 8 deletions packages/livekit-rtc/src/tests/e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -202,7 +205,7 @@ describeE2E('livekit-rtc e2e', () => {
await dispose();
});

it.concurrent(
it(
'connects to a room',
async () => {
Comment on lines 207 to 210
Copy link
Contributor

@1egoman 1egoman Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion(if-minor): I am assuming these were removed becaue bun doesn't support it.concurrent. Does removing these slow down the e2e tests significantly? And if so, is it worth trying to make these conditionally concurrent depending on if the test runner supports it.concurrent or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, I had this initially and removed it as it seemed less elegant than just removing the concurrent version but in the long run it might pay off to make the change now!

const { roomName, rooms } = await connectTestRooms(1);
Expand All @@ -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);
Expand All @@ -241,7 +244,7 @@ describeE2E('livekit-rtc e2e', () => {
testTimeoutMs,
);

it.concurrent(
it(
'emits participantDisconnected when a participant leaves',
async () => {
const { rooms } = await connectTestRooms(2);
Expand All @@ -267,7 +270,7 @@ describeE2E('livekit-rtc e2e', () => {
testTimeoutMs,
);

it.concurrent(
it(
'transfers audio between two participants (sine detection)',
async () => {
const cases = [
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions packages/livekit-server-sdk/src/AccessToken.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});

Expand Down
Loading