mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-07 19:22:14 +09:00
chore(deps): upgrade all dependencies, toolchains and images (#2825)
This commit is contained in:
@@ -20,11 +20,11 @@
|
||||
"bench": "vitest bench --run",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"typecheck": "tsgo --noEmit"
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "catalog:",
|
||||
"@typescript/native-preview": "catalog:",
|
||||
"typescript": "catalog:ts7",
|
||||
"vitest": "catalog:"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import type {
|
||||
VoiceEngineV2ScreenOptions,
|
||||
VoiceEngineV2Stats,
|
||||
} from '@fluxer/voice_engine_v2/src/protocol/types';
|
||||
import {bench, describe} from 'vitest';
|
||||
import {test} from 'vitest';
|
||||
|
||||
interface VoiceEngineV2BenchFixture {
|
||||
events: Array<VoiceEngineV2Event>;
|
||||
@@ -100,28 +100,28 @@ const participantEvent: VoiceEngineV2Event = {
|
||||
const statsPayload: VoiceEngineV2Stats = Object.freeze({rttMs: 42, outbound: [], inbound: []});
|
||||
const statsEvent: VoiceEngineV2Event = {type: 'stats.collected', operationId: 9_999_999, stats: statsPayload};
|
||||
|
||||
describe('voice engine v2 reducer hot paths', () => {
|
||||
bench('inboundVideo.frameReceived', () => {
|
||||
test('voice engine v2 reducer hot paths', async ({bench}) => {
|
||||
await bench('inboundVideo.frameReceived', () => {
|
||||
transitionVoiceEngineV2(connectedSnapshot, frameEvent);
|
||||
});
|
||||
}).run();
|
||||
|
||||
bench('inboundVideo.frameStats', () => {
|
||||
await bench('inboundVideo.frameStats', () => {
|
||||
transitionVoiceEngineV2(connectedSnapshot, frameStatsEvent);
|
||||
});
|
||||
}).run();
|
||||
|
||||
bench('microphone.publishRequested', () => {
|
||||
await bench('microphone.publishRequested', () => {
|
||||
transitionVoiceEngineV2(connectedSnapshot, microphoneEvent);
|
||||
});
|
||||
}).run();
|
||||
|
||||
bench('screen.publishRequested', () => {
|
||||
await bench('screen.publishRequested', () => {
|
||||
transitionVoiceEngineV2(connectedSnapshot, screenEvent);
|
||||
});
|
||||
}).run();
|
||||
|
||||
bench('room.participantJoined', () => {
|
||||
await bench('room.participantJoined', () => {
|
||||
transitionVoiceEngineV2(connectedSnapshot, participantEvent);
|
||||
});
|
||||
}).run();
|
||||
|
||||
bench('stats.collected', () => {
|
||||
await bench('stats.collected', () => {
|
||||
transitionVoiceEngineV2(connectedSnapshot, statsEvent);
|
||||
});
|
||||
}).run();
|
||||
});
|
||||
|
||||
@@ -98,87 +98,88 @@ interface VoiceTrackClassificationFixture {
|
||||
}
|
||||
|
||||
describe('voice engine v2 policies', () => {
|
||||
it.each(
|
||||
microphoneFailureFixtures as Array<MicrophoneFailureFixture>,
|
||||
)('replays microphone failure action fixture: $name', ({result, requestedEnabled, context, expected}) => {
|
||||
expect(getVoiceEngineV2MicrophoneOperationFailureAction(result, requestedEnabled, context)).toBe(expected);
|
||||
});
|
||||
it.each(microphoneFailureFixtures as Array<MicrophoneFailureFixture>)(
|
||||
'replays microphone failure action fixture: $name',
|
||||
({result, requestedEnabled, context, expected}) => {
|
||||
expect(getVoiceEngineV2MicrophoneOperationFailureAction(result, requestedEnabled, context)).toBe(expected);
|
||||
},
|
||||
);
|
||||
|
||||
it.each(
|
||||
hardwareEncoderCapabilityFixtures as Array<HardwareEncoderCapabilityFixture>,
|
||||
)('replays hardware encoder capability fixture: $name', ({
|
||||
input,
|
||||
codec,
|
||||
expectedCapabilities,
|
||||
expectedNativeNvenc,
|
||||
}) => {
|
||||
const capabilities = normalizeVoiceEngineV2HardwareEncoderCapabilities(input);
|
||||
expect(capabilities).toMatchObject(expectedCapabilities);
|
||||
expect(hasVoiceEngineV2NativeNvencEncoder(capabilities, codec)).toBe(expectedNativeNvenc);
|
||||
});
|
||||
it.each(hardwareEncoderCapabilityFixtures as Array<HardwareEncoderCapabilityFixture>)(
|
||||
'replays hardware encoder capability fixture: $name',
|
||||
({input, codec, expectedCapabilities, expectedNativeNvenc}) => {
|
||||
const capabilities = normalizeVoiceEngineV2HardwareEncoderCapabilities(input);
|
||||
expect(capabilities).toMatchObject(expectedCapabilities);
|
||||
expect(hasVoiceEngineV2NativeNvencEncoder(capabilities, codec)).toBe(expectedNativeNvenc);
|
||||
},
|
||||
);
|
||||
|
||||
it.each(
|
||||
screenShareEncodingPlanFixtures as Array<ScreenShareEncodingPlanFixture>,
|
||||
)('replays screen-share encoding plan fixture: $name', (fixture) => {
|
||||
const plan = planVoiceEngineV2ScreenEncodingChange(fixture.input);
|
||||
expect(plan.action).toBe(fixture.expectedAction);
|
||||
expect(plan.reason).toBe(fixture.expectedReason);
|
||||
if (fixture.expectedCodec !== undefined) {
|
||||
expect(plan.desired?.codec).toBe(fixture.expectedCodec);
|
||||
}
|
||||
if (fixture.expectedHardwareEncoding !== undefined) {
|
||||
expect(plan.desired?.hardwareEncoding).toBe(fixture.expectedHardwareEncoding);
|
||||
}
|
||||
if (fixture.expectedZeroCopyRequired !== undefined) {
|
||||
expect(plan.desired?.zeroCopyRequired).toBe(fixture.expectedZeroCopyRequired);
|
||||
}
|
||||
if (fixture.expectedErrorCode !== undefined) {
|
||||
expect(plan.error?.code).toBe(fixture.expectedErrorCode);
|
||||
}
|
||||
});
|
||||
it.each(screenShareEncodingPlanFixtures as Array<ScreenShareEncodingPlanFixture>)(
|
||||
'replays screen-share encoding plan fixture: $name',
|
||||
(fixture) => {
|
||||
const plan = planVoiceEngineV2ScreenEncodingChange(fixture.input);
|
||||
expect(plan.action).toBe(fixture.expectedAction);
|
||||
expect(plan.reason).toBe(fixture.expectedReason);
|
||||
if (fixture.expectedCodec !== undefined) {
|
||||
expect(plan.desired?.codec).toBe(fixture.expectedCodec);
|
||||
}
|
||||
if (fixture.expectedHardwareEncoding !== undefined) {
|
||||
expect(plan.desired?.hardwareEncoding).toBe(fixture.expectedHardwareEncoding);
|
||||
}
|
||||
if (fixture.expectedZeroCopyRequired !== undefined) {
|
||||
expect(plan.desired?.zeroCopyRequired).toBe(fixture.expectedZeroCopyRequired);
|
||||
}
|
||||
if (fixture.expectedErrorCode !== undefined) {
|
||||
expect(plan.error?.code).toBe(fixture.expectedErrorCode);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it.each(
|
||||
cameraShareEncodingPlanFixtures as Array<CameraShareEncodingPlanFixture>,
|
||||
)('replays camera-share encoding plan fixture: $name', (fixture) => {
|
||||
const plan = planVoiceEngineV2CameraEncodingChange(fixture.input);
|
||||
expect(plan.action).toBe(fixture.expectedAction);
|
||||
expect(plan.reason).toBe(fixture.expectedReason);
|
||||
if (fixture.expectedCodec !== undefined) {
|
||||
expect(plan.desired?.codec).toBe(fixture.expectedCodec);
|
||||
}
|
||||
if (fixture.expectedMirror !== undefined) {
|
||||
expect(plan.desired?.mirror).toBe(fixture.expectedMirror);
|
||||
}
|
||||
if (fixture.expectedBackgroundMode !== undefined) {
|
||||
expect(plan.desired?.backgroundMode).toBe(fixture.expectedBackgroundMode);
|
||||
}
|
||||
if (fixture.expectedWidth !== undefined) {
|
||||
expect(plan.desired?.width).toBe(fixture.expectedWidth);
|
||||
}
|
||||
if (fixture.expectedFrameRate !== undefined) {
|
||||
expect(plan.desired?.frameRate).toBe(fixture.expectedFrameRate);
|
||||
}
|
||||
if (fixture.expectedErrorCode !== undefined) {
|
||||
expect(plan.error?.code).toBe(fixture.expectedErrorCode);
|
||||
}
|
||||
});
|
||||
it.each(cameraShareEncodingPlanFixtures as Array<CameraShareEncodingPlanFixture>)(
|
||||
'replays camera-share encoding plan fixture: $name',
|
||||
(fixture) => {
|
||||
const plan = planVoiceEngineV2CameraEncodingChange(fixture.input);
|
||||
expect(plan.action).toBe(fixture.expectedAction);
|
||||
expect(plan.reason).toBe(fixture.expectedReason);
|
||||
if (fixture.expectedCodec !== undefined) {
|
||||
expect(plan.desired?.codec).toBe(fixture.expectedCodec);
|
||||
}
|
||||
if (fixture.expectedMirror !== undefined) {
|
||||
expect(plan.desired?.mirror).toBe(fixture.expectedMirror);
|
||||
}
|
||||
if (fixture.expectedBackgroundMode !== undefined) {
|
||||
expect(plan.desired?.backgroundMode).toBe(fixture.expectedBackgroundMode);
|
||||
}
|
||||
if (fixture.expectedWidth !== undefined) {
|
||||
expect(plan.desired?.width).toBe(fixture.expectedWidth);
|
||||
}
|
||||
if (fixture.expectedFrameRate !== undefined) {
|
||||
expect(plan.desired?.frameRate).toBe(fixture.expectedFrameRate);
|
||||
}
|
||||
if (fixture.expectedErrorCode !== undefined) {
|
||||
expect(plan.error?.code).toBe(fixture.expectedErrorCode);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it.each(
|
||||
voiceStatsCoercionFixtures as Array<VoiceStatsCoercionFixture>,
|
||||
)('replays voice stats coercion fixture: $name', ({input, expected}) => {
|
||||
expect(coerceVoiceEngineV2Stats(input)).toMatchObject(expected);
|
||||
});
|
||||
it.each(voiceStatsCoercionFixtures as Array<VoiceStatsCoercionFixture>)(
|
||||
'replays voice stats coercion fixture: $name',
|
||||
({input, expected}) => {
|
||||
expect(coerceVoiceEngineV2Stats(input)).toMatchObject(expected);
|
||||
},
|
||||
);
|
||||
|
||||
it.each(voiceStatsSummaryFixtures as Array<VoiceStatsSummaryFixture>)('replays voice stats summary fixture: $name', ({
|
||||
input,
|
||||
expectedSummary,
|
||||
}) => {
|
||||
expect(summarizeVoiceEngineV2Stats(input)).toMatchObject(expectedSummary);
|
||||
});
|
||||
it.each(voiceStatsSummaryFixtures as Array<VoiceStatsSummaryFixture>)(
|
||||
'replays voice stats summary fixture: $name',
|
||||
({input, expectedSummary}) => {
|
||||
expect(summarizeVoiceEngineV2Stats(input)).toMatchObject(expectedSummary);
|
||||
},
|
||||
);
|
||||
|
||||
it.each(
|
||||
voiceTrackClassificationFixtures as Array<VoiceTrackClassificationFixture>,
|
||||
)('replays voice track classification fixture: $name', ({input, expected}) => {
|
||||
expect(classifyVoiceEngineV2TrackStats(input)).toEqual(expected);
|
||||
});
|
||||
it.each(voiceTrackClassificationFixtures as Array<VoiceTrackClassificationFixture>)(
|
||||
'replays voice track classification fixture: $name',
|
||||
({input, expected}) => {
|
||||
expect(classifyVoiceEngineV2TrackStats(input)).toEqual(expected);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
@@ -18,7 +18,7 @@ import type {
|
||||
} from '@fluxer/voice_engine_v2/src/protocol/types';
|
||||
import {createVoiceEngineV2MemoryEventLogSpillSink} from '@fluxer/voice_engine_v2/src/runtime/eventLogRing';
|
||||
import {VoiceEngineV2Runtime} from '@fluxer/voice_engine_v2/src/runtime/VoiceEngineV2Runtime';
|
||||
import {bench, describe} from 'vitest';
|
||||
import {test} from 'vitest';
|
||||
|
||||
interface VoiceEngineV2BenchFixture {
|
||||
events: Array<VoiceEngineV2Event>;
|
||||
@@ -108,24 +108,24 @@ const runtimeForScreen = buildRuntimeWithConnectedSession();
|
||||
const runtimeForParticipant = buildRuntimeWithConnectedSession();
|
||||
const runtimeForStats = buildRuntimeWithConnectedSession();
|
||||
|
||||
describe('voice engine v2 runtime dispatch round-trip', () => {
|
||||
bench('dispatch inboundVideo.frameReceived', () => {
|
||||
test('voice engine v2 runtime dispatch round-trip', async ({bench}) => {
|
||||
await bench('dispatch inboundVideo.frameReceived', () => {
|
||||
runtimeForFrames.dispatch(frameEvent);
|
||||
});
|
||||
}).run();
|
||||
|
||||
bench('dispatch microphone.publishRequested', () => {
|
||||
await bench('dispatch microphone.publishRequested', () => {
|
||||
runtimeForMicrophone.dispatch(microphoneEvent);
|
||||
});
|
||||
}).run();
|
||||
|
||||
bench('dispatch screen.publishRequested', () => {
|
||||
await bench('dispatch screen.publishRequested', () => {
|
||||
runtimeForScreen.dispatch(screenEvent);
|
||||
});
|
||||
}).run();
|
||||
|
||||
bench('dispatch room.participantJoined', () => {
|
||||
await bench('dispatch room.participantJoined', () => {
|
||||
runtimeForParticipant.dispatch(participantEvent);
|
||||
});
|
||||
}).run();
|
||||
|
||||
bench('dispatch stats.collected', () => {
|
||||
await bench('dispatch stats.collected', () => {
|
||||
runtimeForStats.dispatch(statsEvent);
|
||||
});
|
||||
}).run();
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
VoiceEngineV2Track,
|
||||
VoiceEngineV2TrackSource,
|
||||
} from '@fluxer/voice_engine_v2/src/protocol/types';
|
||||
import {bench, describe} from 'vitest';
|
||||
import {test} from 'vitest';
|
||||
|
||||
const PARTICIPANT_COUNT = 8;
|
||||
const TRACKS_PER_PARTICIPANT = 4;
|
||||
@@ -56,16 +56,16 @@ function buildRealisticSnapshot(): VoiceEngineV2Snapshot {
|
||||
const realisticSnapshot = buildRealisticSnapshot();
|
||||
const serializedSnapshot = JSON.stringify(realisticSnapshot);
|
||||
|
||||
describe('voice engine v2 snapshot serialise/deserialise baseline', () => {
|
||||
bench('JSON.stringify snapshot (8 participants × 4 tracks)', () => {
|
||||
test('voice engine v2 snapshot serialise/deserialise baseline', async ({bench}) => {
|
||||
await bench('JSON.stringify snapshot (8 participants × 4 tracks)', () => {
|
||||
JSON.stringify(realisticSnapshot);
|
||||
});
|
||||
}).run();
|
||||
|
||||
bench('JSON.parse snapshot (8 participants × 4 tracks)', () => {
|
||||
await bench('JSON.parse snapshot (8 participants × 4 tracks)', () => {
|
||||
JSON.parse(serializedSnapshot);
|
||||
});
|
||||
}).run();
|
||||
|
||||
bench('JSON.stringify + JSON.parse round-trip', () => {
|
||||
await bench('JSON.stringify + JSON.parse round-trip', () => {
|
||||
JSON.parse(JSON.stringify(realisticSnapshot));
|
||||
});
|
||||
}).run();
|
||||
});
|
||||
|
||||
@@ -12,7 +12,6 @@ export default defineConfig({
|
||||
benchmark: {
|
||||
include: ['**/*.bench.{ts,tsx}'],
|
||||
exclude: ['node_modules', 'dist'],
|
||||
reporters: ['default'],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user