openvibers/openvibe.extensions Commits
npm test no longer counts a skipped test as passed (roadmap WS-Q task 7, the rule of openvibe-shared/test-runner). test/run.js counted every file that exited 0 as passed, so a file that printed that it skipped its work and checked nothing would still read as green. A test now prints "<label>: skipped (<why>)" for what it could not run, and the runner lists that file with ○ and its reasons and does not count it as passed: the summary reads "4/5 test files passed, 1 skipped (…)", and only a run with nothing skipped says N/N; --strict (or OV_TEST_STRICT=1) makes a skip fail the run. This repository does not depend on openvibe-shared, so the runner keeps its own loop (spawnSync, VERBOSE) with SKIP_RE and skipsIn copied from the module. No test here skips anything. STATUS.json is dated 2026-09-28. npm test (Node 22) 5/5.
Changes
@@@ -26,5 +26,5 @@"store listings (Chrome Web Store, addons.mozilla.org) and the store extension ids in COUPONS_EXTENSION_ORIGINS"],"deployed": false,-- "updated": "2026-09-23"++ "updated": "2026-09-28"}@@@ -5,23 +5,51 @@** npm test # everything* npm test -- manifest # only files whose name contains one of the words++ * npm test -- --strict # a skipped test fails the run too (or OV_TEST_STRICT=1)++ *++ * A test that cannot run something here prints `<label>: skipped (<why>)`: that file is listed with++ * ○ and its reasons and not counted as passed, so the summary reads `7/8 test files passed,++ * 1 skipped (…)`; only a run with nothing skipped says `N/N test files passed`. This is the rule of++ * openvibe-shared/test-runner, copied here because this repository does not depend on openvibe-shared.*/'use strict';const { spawnSync } = require('child_process');const fs = require('fs');const path = require('path');++const strict = process.argv.includes('--strict') || process.env.OV_TEST_STRICT === '1';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();if (!files.length) { console.error('no test files matched'); process.exit(1); }++++/** `<label>: skipped (<why>)` on a line of its own (SKIP_RE from openvibe-shared/test-runner). */++const SKIP_RE = /^[ \t]*[\w .,'()/+#-]{1,120}: skipped \((.+)\)[ \t]*$/gm;++++/** The skip lines in a test's output, in order, without repeats (skipsIn from openvibe-shared/test-runner). */++function skipsIn(output) {++ const out = [];++ for (const m of String(output || '').matchAll(SKIP_RE)) {++ const line = m[0].trim();++ if (!out.includes(line)) out.push(line);++ }++ return out;++}++let failed = 0;++const skipped = [];for (const f of files) {const started = Date.now();const r = spawnSync(process.execPath, [path.join(__dirname, f)], { cwd: path.join(__dirname, '..'), encoding: 'utf8', timeout: 60000 });const ok = r.status === 0;++ const skips = ok ? skipsIn((r.stdout || '') + (r.stderr || '')) : [];if (!ok) failed++;-- console.log(`${ok ? '✓' : '✗'} ${f.padEnd(28)} ${String(Date.now() - started).padStart(6)}ms`);++ if (skips.length) skipped.push({ file: f, skips });++ const mark = !ok ? '✗' : skips.length ? '○' : '✓';++ console.log(`${mark} ${f.padEnd(28)} ${String(Date.now() - started).padStart(6)}ms${skips.length ? ` ${skips.join('; ')}` : ''}`);if (!ok || process.env.VERBOSE) console.log((r.stdout || '') + (r.stderr || ''));}--console.log(`\n${files.length - failed}/${files.length} test files passed`);--process.exit(failed ? 1 : 0);++const passed = files.length - failed - skipped.length;++console.log(skipped.length++ ? `\n${passed}/${files.length} test files passed, ${skipped.length} skipped (${skipped.map((s) => `${s.file}: ${s.skips.join('; ')}`).join(' | ')})${strict ? ' — strict: skips fail the run' : ''}`++ : `\n${passed}/${files.length} test files passed`);++process.exit(failed || (strict && skipped.length) ? 1 : 0);
@@ -26,5 +26,5 @@
@@ -26,5 +26,5 @@
"store listings (Chrome Web Store, addons.mozilla.org) and the store extension ids in COUPONS_EXTENSION_ORIGINS"
"store listings (Chrome Web Store, addons.mozilla.org) and the store extension ids in COUPONS_EXTENSION_ORIGINS"
],
],
"deployed": false,
"deployed": false,
- "updated": "2026-09-23"
+ "updated": "2026-09-28"
}
}
@@ -5,23 +5,51 @@
@@ -5,23 +5,51 @@
*
*
* npm test # everything
* npm test # everything
* npm test -- manifest # only files whose name contains one of the words
* npm test -- manifest # only files whose name contains one of the words
+ * npm test -- --strict # a skipped test fails the run too (or OV_TEST_STRICT=1)
+ *
+ * A test that cannot run something here prints `<label>: skipped (<why>)`: that file is listed with
+ * ○ and its reasons and not counted as passed, so the summary reads `7/8 test files passed,
+ * 1 skipped (…)`; only a run with nothing skipped says `N/N test files passed`. This is the rule of
+ * openvibe-shared/test-runner, copied here because this repository does not depend on openvibe-shared.
*/
*/
'use strict';
'use strict';
const { spawnSync } = require('child_process');
const { spawnSync } = require('child_process');
const fs = require('fs');
const fs = require('fs');
const path = require('path');
const path = require('path');
+const strict = process.argv.includes('--strict') || process.env.OV_TEST_STRICT === '1';
const filters = process.argv.slice(2).filter((a) => !a.startsWith('-'));
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 files = fs.readdirSync(__dirname).filter((f) => f.endsWith('.test.js')).filter((f) => !filters.length || filters.some((w) => f.includes(w))).sort();
if (!files.length) { console.error('no test files matched'); process.exit(1); }
if (!files.length) { console.error('no test files matched'); process.exit(1); }
+
+/** `<label>: skipped (<why>)` on a line of its own (SKIP_RE from openvibe-shared/test-runner). */
+const SKIP_RE = /^[ \t]*[\w .,'()/+#-]{1,120}: skipped \((.+)\)[ \t]*$/gm;
+
+/** The skip lines in a test's output, in order, without repeats (skipsIn from openvibe-shared/test-runner). */
+function skipsIn(output) {
+ const out = [];
+ for (const m of String(output || '').matchAll(SKIP_RE)) {
+ const line = m[0].trim();
+ if (!out.includes(line)) out.push(line);
+ }
+ return out;
+}
+
let failed = 0;
let failed = 0;
+const skipped = [];
for (const f of files) {
for (const f of files) {
const started = Date.now();
const started = Date.now();
const r = spawnSync(process.execPath, [path.join(__dirname, f)], { cwd: path.join(__dirname, '..'), encoding: 'utf8', timeout: 60000 });
const r = spawnSync(process.execPath, [path.join(__dirname, f)], { cwd: path.join(__dirname, '..'), encoding: 'utf8', timeout: 60000 });
const ok = r.status === 0;
const ok = r.status === 0;
+ const skips = ok ? skipsIn((r.stdout || '') + (r.stderr || '')) : [];
if (!ok) failed++;
if (!ok) failed++;
- console.log(`${ok ? '✓' : '✗'} ${f.padEnd(28)} ${String(Date.now() - started).padStart(6)}ms`);
+ if (skips.length) skipped.push({ file: f, skips });
+ const mark = !ok ? '✗' : skips.length ? '○' : '✓';
+ console.log(`${mark} ${f.padEnd(28)} ${String(Date.now() - started).padStart(6)}ms${skips.length ? ` ${skips.join('; ')}` : ''}`);
if (!ok || process.env.VERBOSE) console.log((r.stdout || '') + (r.stderr || ''));
if (!ok || process.env.VERBOSE) console.log((r.stdout || '') + (r.stderr || ''));
}
}
-console.log(`\n${files.length - failed}/${files.length} test files passed`);
-process.exit(failed ? 1 : 0);
+const passed = files.length - failed - skipped.length;
+console.log(skipped.length
+ ? `\n${passed}/${files.length} test files passed, ${skipped.length} skipped (${skipped.map((s) => `${s.file}: ${s.skips.join('; ')}`).join(' | ')})${strict ? ' — strict: skips fail the run' : ''}`
+ : `\n${passed}/${files.length} test files passed`);
+process.exit(failed || (strict && skipped.length) ? 1 : 0);