openvibers/openrestream Commits
npm test no longer counts a skipped test as passed (roadmap WS-Q task 7; openvibe-shared/test-runner, Shared v1.25.0). test/run.js counted every file that exited 0 as passed, so rtmp-e2e without ffmpeg, which checks nothing and exits 0, read as green. It is now the shared runner (same files, one at a time as before, 180 s timeout per file): a test prints "<label>: skipped (<why>)" for what it could not run, and that file is listed with ○ and its reasons and not counted as passed; --strict makes a skip fail the run. rtmp-e2e now prints "rtmp-e2e: skipped (no ffmpeg on PATH)" (it said SKIPPED, in words no runner read); without ffmpeg the run reads 17/18 test files passed, 1 skipped. openvibe-shared is pinned at v1.25.0 (from v1.24.0; README and STATUS.json follow). npm test (Node 22, ffmpeg installed) 18/18.
Changes
@@@ -32,7 +32,7 @@ The ingest/restream control plane and runtime extracted from OpenVibe.Live. Live- OpenVibe.Network (JWKS for service tokens and user JWTs; OAuth client `openre`; client-credentials tokens for Events/Media)- OpenVibe.Events (event relay; optional: rows wait in the outbox)- OpenVibe.Media (recording requests; optional: sessions work without it)--- OpenVibe.Contracts v0.49.0 (ids, problem+json, capability checks), OpenVibe.SDK v0.12.0 (outbox, token client, per-actor limits), OpenVibe.Shared v1.24.0 (chrome, readiness), pinned by release tarball++- OpenVibe.Contracts v0.49.0 (ids, problem+json, capability checks), OpenVibe.SDK v0.12.0 (outbox, token client, per-actor limits), OpenVibe.Shared v1.25.0 (chrome, readiness), pinned by release tarball- OpenVibe.Live (`live.lineage.resolve`: which channel a Live-linked stream belongs to)- node-media-server 2.7.4 (the RTMP session code Live runs) and the system ffmpeg@@@ -8,7 +8,7 @@"port": 4500,"rtmpPort": 1936,"domain": "openre.stream",-- "contracts": "openvibe-contracts v0.49.0 (openvibe-sdk v0.12.0, openvibe-shared v1.24.0)",++ "contracts": "openvibe-contracts v0.49.0 (openvibe-sdk v0.12.0, openvibe-shared v1.25.0)","protocols": {"rtmp": "ingest ported (openre-rtmp-ingest)","restream": "RTMP source to RTMP/RTMPS/SRT destinations ported (openre-restream-worker)",@@@ -16,7 +16,7 @@"node-media-server": "2.7.4","openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.49.0","openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.12.0",-- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.24.0"++ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.25.0"},"engines": {"node": ">=22.12.0"@@@ -1140,9 +1140,9 @@}},"node_modules/openvibe-shared": {-- "version": "1.24.0",-- "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.24.0",-- "integrity": "sha512-VPzafrc07Pw0oqmXioOlDRtlX5xu82jNLBYkVYxXvhjkILMpWsyjExItIRt5Y6l2st0ozHm7bDQFTJpKEShMEA==",++ "version": "1.25.0",++ "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.25.0",++ "integrity": "sha512-oqZ+PvljrWi8IEbtg6bDYai17ZV2sALFx/ezMptniELSr10TgFUiGUQt+b1IWwiHv0T2Y1U2iSrkirJxMNgjSw==","license": "MIT","dependencies": {"jsonwebtoken": "^9.0.0"@@@ -25,7 +25,7 @@"node-media-server": "2.7.4","openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.49.0","openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.12.0",-- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.24.0"++ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.25.0"},"engines": {"node": ">=22.12.0"@@@ -17,7 +17,7 @@ const {} = require('./helpers');if (!hasFfmpeg()) {-- console.log('rtmp-e2e: SKIPPED (no ffmpeg on PATH)');++ console.log('rtmp-e2e: skipped (no ffmpeg on PATH)');process.exit(0);}@@@ -2,56 +2,15 @@/*** Runs every test in test/ — the files named *.test.js — each in its own process, and fails* if any of them fails. They use temp SQLite databases, generated RSA keys and stub subscribers-- * on random ports; none of them needs the network or a running OpenVibe.Network. The RTMP end-to-end tests use-- * the system ffmpeg and say SKIPPED when it is missing.++ * on random ports; none of them needs the network or a running OpenVibe.Network. The RTMP end-to-end test uses++ * the system ffmpeg and prints `rtmp-e2e: skipped (no ffmpeg on PATH)` when it is missing.** npm test # everything* npm test -- publish sse # only files whose name contains one of the words++ * npm test -- --strict # a skipped test fails the run too++ *++ * A test that cannot run something here prints `<label>: skipped (<why>)`: that file is listed with++ * ○ and not counted as passed (openvibe-shared/test-runner).*/'use strict';--const { spawn } = require('child_process');--const fs = require('fs');--const path = require('path');----const filters = process.argv.slice(2).filter((a) => !a.startsWith('-'));--const files = fs.readdirSync(__dirname)-- .filter((f) => f.endsWith('.test.js'))-- .filter((f) => !filters.length || filters.some((w) => f.includes(w)))-- .sort();--const TIMEOUT_MS = 180000;----function runOne(file) {-- return new Promise((resolve) => {-- const started = Date.now();-- const child = spawn(process.execPath, [path.join(__dirname, file)], {-- cwd: path.join(__dirname, '..'),-- env: { ...process.env, NODE_ENV: 'test' },-- stdio: ['ignore', 'pipe', 'pipe'],-- });-- let output = '';-- child.stdout.on('data', (c) => { output += c; });-- child.stderr.on('data', (c) => { output += c; });-- const timer = setTimeout(() => { output += `\n[run] timed out after ${TIMEOUT_MS}ms`; child.kill('SIGKILL'); }, TIMEOUT_MS);-- child.on('close', (code, signal) => {-- clearTimeout(timer);-- resolve({ file, ok: code === 0, code: code ?? signal, ms: Date.now() - started, output });-- });-- });--}----(async () => {-- if (!files.length) { console.error('no test files matched'); process.exit(1); }-- const results = [];-- for (const f of files) {-- const r = await runOne(f);-- results.push(r);-- console.log(`${r.ok ? '✓' : '✗'} ${r.file.padEnd(32)} ${String(r.ms).padStart(6)}ms`);-- }-- const failed = results.filter((r) => !r.ok);-- for (const r of failed) {-- console.log(`\n── ${r.file} (exit ${r.code}) ──`);-- console.log(r.output.split('\n').slice(-60).join('\n'));-- }-- console.log(`\n${results.length - failed.length}/${results.length} test files passed`);-- process.exit(failed.length ? 1 : 0);--})();++require('openvibe-shared/test-runner').main({ dir: __dirname, timeoutMs: 180000, pad: 32, parallel: 1 });
@@ -32,7 +32,7 @@ The ingest/restream control plane and runtime extracted from OpenVibe.Live. Live
@@ -32,7 +32,7 @@ The ingest/restream control plane and runtime extracted from OpenVibe.Live. Live
- OpenVibe.Network (JWKS for service tokens and user JWTs; OAuth client `openre`; client-credentials tokens for Events/Media)
- OpenVibe.Network (JWKS for service tokens and user JWTs; OAuth client `openre`; client-credentials tokens for Events/Media)
- OpenVibe.Events (event relay; optional: rows wait in the outbox)
- OpenVibe.Events (event relay; optional: rows wait in the outbox)
- OpenVibe.Media (recording requests; optional: sessions work without it)
- OpenVibe.Media (recording requests; optional: sessions work without it)
-- OpenVibe.Contracts v0.49.0 (ids, problem+json, capability checks), OpenVibe.SDK v0.12.0 (outbox, token client, per-actor limits), OpenVibe.Shared v1.24.0 (chrome, readiness), pinned by release tarball
+- OpenVibe.Contracts v0.49.0 (ids, problem+json, capability checks), OpenVibe.SDK v0.12.0 (outbox, token client, per-actor limits), OpenVibe.Shared v1.25.0 (chrome, readiness), pinned by release tarball
- OpenVibe.Live (`live.lineage.resolve`: which channel a Live-linked stream belongs to)
- OpenVibe.Live (`live.lineage.resolve`: which channel a Live-linked stream belongs to)
- node-media-server 2.7.4 (the RTMP session code Live runs) and the system ffmpeg
- node-media-server 2.7.4 (the RTMP session code Live runs) and the system ffmpeg
@@ -8,7 +8,7 @@
@@ -8,7 +8,7 @@
"port": 4500,
"port": 4500,
"rtmpPort": 1936,
"rtmpPort": 1936,
"domain": "openre.stream",
"domain": "openre.stream",
- "contracts": "openvibe-contracts v0.49.0 (openvibe-sdk v0.12.0, openvibe-shared v1.24.0)",
+ "contracts": "openvibe-contracts v0.49.0 (openvibe-sdk v0.12.0, openvibe-shared v1.25.0)",
"protocols": {
"protocols": {
"rtmp": "ingest ported (openre-rtmp-ingest)",
"rtmp": "ingest ported (openre-rtmp-ingest)",
"restream": "RTMP source to RTMP/RTMPS/SRT destinations ported (openre-restream-worker)",
"restream": "RTMP source to RTMP/RTMPS/SRT destinations ported (openre-restream-worker)",
@@ -16,7 +16,7 @@
@@ -16,7 +16,7 @@
"node-media-server": "2.7.4",
"node-media-server": "2.7.4",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.49.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.49.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.12.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.12.0",
- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.24.0"
+ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.25.0"
},
},
"engines": {
"engines": {
"node": ">=22.12.0"
"node": ">=22.12.0"
@@ -1140,9 +1140,9 @@
@@ -1140,9 +1140,9 @@
}
}
},
},
"node_modules/openvibe-shared": {
"node_modules/openvibe-shared": {
- "version": "1.24.0",
- "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.24.0",
- "integrity": "sha512-VPzafrc07Pw0oqmXioOlDRtlX5xu82jNLBYkVYxXvhjkILMpWsyjExItIRt5Y6l2st0ozHm7bDQFTJpKEShMEA==",
+ "version": "1.25.0",
+ "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.25.0",
+ "integrity": "sha512-oqZ+PvljrWi8IEbtg6bDYai17ZV2sALFx/ezMptniELSr10TgFUiGUQt+b1IWwiHv0T2Y1U2iSrkirJxMNgjSw==",
"license": "MIT",
"license": "MIT",
"dependencies": {
"dependencies": {
"jsonwebtoken": "^9.0.0"
"jsonwebtoken": "^9.0.0"
@@ -25,7 +25,7 @@
@@ -25,7 +25,7 @@
"node-media-server": "2.7.4",
"node-media-server": "2.7.4",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.49.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.49.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.12.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.12.0",
- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.24.0"
+ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.25.0"
},
},
"engines": {
"engines": {
"node": ">=22.12.0"
"node": ">=22.12.0"
@@ -17,7 +17,7 @@ const {
@@ -17,7 +17,7 @@ const {
} = require('./helpers');
} = require('./helpers');
if (!hasFfmpeg()) {
if (!hasFfmpeg()) {
- console.log('rtmp-e2e: SKIPPED (no ffmpeg on PATH)');
+ console.log('rtmp-e2e: skipped (no ffmpeg on PATH)');
process.exit(0);
process.exit(0);
}
}
@@ -2,56 +2,15 @@
@@ -2,56 +2,15 @@
/**
/**
* Runs every test in test/ — the files named *.test.js — each in its own process, and fails
* Runs every test in test/ — the files named *.test.js — each in its own process, and fails
* if any of them fails. They use temp SQLite databases, generated RSA keys and stub subscribers
* if any of them fails. They use temp SQLite databases, generated RSA keys and stub subscribers
- * on random ports; none of them needs the network or a running OpenVibe.Network. The RTMP end-to-end tests use
- * the system ffmpeg and say SKIPPED when it is missing.
+ * on random ports; none of them needs the network or a running OpenVibe.Network. The RTMP end-to-end test uses
+ * the system ffmpeg and prints `rtmp-e2e: skipped (no ffmpeg on PATH)` when it is missing.
*
*
* npm test # everything
* npm test # everything
* npm test -- publish sse # only files whose name contains one of the words
* npm test -- publish sse # only files whose name contains one of the words
+ * npm test -- --strict # a skipped test fails the run too
+ *
+ * A test that cannot run something here prints `<label>: skipped (<why>)`: that file is listed with
+ * ○ and not counted as passed (openvibe-shared/test-runner).
*/
*/
'use strict';
'use strict';
-const { spawn } = require('child_process');
-const fs = require('fs');
-const path = require('path');
-
-const filters = process.argv.slice(2).filter((a) => !a.startsWith('-'));
-const files = fs.readdirSync(__dirname)
- .filter((f) => f.endsWith('.test.js'))
- .filter((f) => !filters.length || filters.some((w) => f.includes(w)))
- .sort();
-const TIMEOUT_MS = 180000;
-
-function runOne(file) {
- return new Promise((resolve) => {
- const started = Date.now();
- const child = spawn(process.execPath, [path.join(__dirname, file)], {
- cwd: path.join(__dirname, '..'),
- env: { ...process.env, NODE_ENV: 'test' },
- stdio: ['ignore', 'pipe', 'pipe'],
- });
- let output = '';
- child.stdout.on('data', (c) => { output += c; });
- child.stderr.on('data', (c) => { output += c; });
- const timer = setTimeout(() => { output += `\n[run] timed out after ${TIMEOUT_MS}ms`; child.kill('SIGKILL'); }, TIMEOUT_MS);
- child.on('close', (code, signal) => {
- clearTimeout(timer);
- resolve({ file, ok: code === 0, code: code ?? signal, ms: Date.now() - started, output });
- });
- });
-}
-
-(async () => {
- if (!files.length) { console.error('no test files matched'); process.exit(1); }
- const results = [];
- for (const f of files) {
- const r = await runOne(f);
- results.push(r);
- console.log(`${r.ok ? '✓' : '✗'} ${r.file.padEnd(32)} ${String(r.ms).padStart(6)}ms`);
- }
- const failed = results.filter((r) => !r.ok);
- for (const r of failed) {
- console.log(`\n── ${r.file} (exit ${r.code}) ──`);
- console.log(r.output.split('\n').slice(-60).join('\n'));
- }
- console.log(`\n${results.length - failed.length}/${results.length} test files passed`);
- process.exit(failed.length ? 1 : 0);
-})();
+require('openvibe-shared/test-runner').main({ dir: __dirname, timeoutMs: 180000, pad: 32, parallel: 1 });