Skip to content

Commit 757820f

Browse files
committed
test: add webrtc stream benchmark
1 parent 8b52248 commit 757820f

7 files changed

Lines changed: 641 additions & 20 deletions

File tree

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,42 @@ jobs:
242242
- name: JS API simulator integration tests
243243
run: npm run test:integration:js-api
244244

245+
integration-webrtc:
246+
name: WebRTC stream benchmark
247+
runs-on: macos-15
248+
timeout-minutes: 20
249+
env:
250+
DEVELOPER_DIR: /Applications/Xcode_16.4.app/Contents/Developer
251+
needs:
252+
- rust
253+
- client
254+
- packages
255+
- build-artifacts
256+
257+
steps:
258+
- uses: actions/checkout@v4
259+
260+
- uses: actions/setup-node@v4
261+
with:
262+
node-version: 20
263+
264+
- name: Download integration artifacts
265+
uses: actions/download-artifact@v4
266+
with:
267+
name: simdeck-integration-artifacts
268+
path: .
269+
270+
- name: Make CLI executable
271+
run: chmod +x build/simdeck build/simdeck-bin
272+
273+
- name: WebRTC software stream benchmark
274+
run: npm run test:integration:webrtc
275+
env:
276+
SIMDECK_E2E_MIN_DECODED_FPS: "55"
277+
SIMDECK_E2E_MIN_PRESENTED_FPS: "55"
278+
SIMDECK_E2E_MIN_RECEIVED_FPS: "55"
279+
SIMDECK_E2E_WEBRTC_MS: "20000"
280+
245281
integration-android:
246282
name: Android emulator integration
247283
runs-on: ubuntu-latest

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"test:integration:cli:verbose": "SIMDECK_INTEGRATION_VERBOSE=1 SIMDECK_INTEGRATION_SHOW_SIMULATOR=1 node scripts/integration/cli.mjs",
7070
"test:integration:fixture": "node scripts/integration/prebuild-fixture.mjs",
7171
"test:integration:js-api": "node scripts/integration/js-api.mjs",
72+
"test:integration:webrtc": "node scripts/integration/webrtc.mjs",
7273
"test:integration:js-api:verbose": "SIMDECK_INTEGRATION_SHOW_SIMULATOR=1 node scripts/integration/js-api.mjs",
7374
"test:integration:android": "node scripts/integration/android.mjs",
7475
"test:integration:android:verbose": "SIMDECK_INTEGRATION_VERBOSE=1 node scripts/integration/android.mjs",

packages/simdeck-test/dist/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,23 +384,24 @@ async function startIsolatedDaemon(cliPath, options) {
384384
const projectRoot = fs.mkdtempSync(path.join(os.tmpdir(), "simdeck-test-project-"));
385385
const metadataPath = path.join(os.tmpdir(), `simdeck-test-${process.pid}-${Date.now()}-${crypto.randomUUID()}.json`);
386386
const accessToken = crypto.randomBytes(32).toString("hex");
387+
const packageRoot = options.projectRoot ?? process.cwd();
387388
const child = spawn(cliPath, [
388-
"daemon",
389+
"service",
389390
"run",
390-
"--project-root",
391-
projectRoot,
392391
"--metadata-path",
393392
metadataPath,
394393
"--port",
395394
String(port),
396395
"--bind",
397396
"127.0.0.1",
397+
"--client-root",
398+
path.join(packageRoot, "packages", "client", "dist"),
398399
"--access-token",
399400
accessToken,
400401
"--video-codec",
401402
options.videoCodec ?? "software",
402403
], {
403-
cwd: options.projectRoot,
404+
cwd: projectRoot,
404405
stdio: ["ignore", "pipe", "pipe"],
405406
});
406407
const output = captureChildOutput(child);

packages/simdeck-test/src/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -726,26 +726,27 @@ async function startIsolatedDaemon(
726726
`simdeck-test-${process.pid}-${Date.now()}-${crypto.randomUUID()}.json`,
727727
);
728728
const accessToken = crypto.randomBytes(32).toString("hex");
729+
const packageRoot = options.projectRoot ?? process.cwd();
729730
const child = spawn(
730731
cliPath,
731732
[
732-
"daemon",
733+
"service",
733734
"run",
734-
"--project-root",
735-
projectRoot,
736735
"--metadata-path",
737736
metadataPath,
738737
"--port",
739738
String(port),
740739
"--bind",
741740
"127.0.0.1",
741+
"--client-root",
742+
path.join(packageRoot, "packages", "client", "dist"),
742743
"--access-token",
743744
accessToken,
744745
"--video-codec",
745746
options.videoCodec ?? "software",
746747
],
747748
{
748-
cwd: options.projectRoot,
749+
cwd: projectRoot,
749750
stdio: ["ignore", "pipe", "pipe"],
750751
},
751752
);

0 commit comments

Comments
 (0)