openvibers/openvibe.sites Commits

Run test/.test.js through test/run.js so ov test can shard them (#6)

OP OpenVibers committed 3 Oct 2026 · e17146ab48 · 4 files, +38 −5

local checks ✓ 3/3 · CI ✓ 3/3 · review SHIP by DeepSeek harness

https://github.com/OpenVibers/OpenVibe.Sites/pull/6

Changes

ddiff --git a/README.md b/README.md
iindex e1cb94c..674f6b3 100644
---- a/README.md
++++ b/README.md
@@@ -67,10 +67,11 @@ subdomain of a live service says it is not routed yet; only a repository with no
"charter only". The build reads the committed snapshot, so it is reproducible; `npm test` fails
locally when a sibling's `STATUS.json` stage or code flag no longer matches it.
--`npm test` runs `test/build.test.js` (dist is current; every label matches `facts.json`; no shared file
--comes from openvibe.network and each `/shared` URL carries its file's hash; a live service's domain is
--never also a placeholder; 404 pages) and `test/deploy-wrapper.test.js` (the deploy wrapper and its
--fallback, against a fake ovhost and a temp checkout).
++`npm test` runs `test/run.js`, which runs each `test/*.test.js` in its own process: `test/build.test.js`
++(dist is current; every label matches `facts.json`; no shared file comes from openvibe.network and each
++`/shared` URL carries its file's hash; a live service's domain is never also a placeholder; 404 pages)
++and `test/deploy-wrapper.test.js` (the deploy wrapper and its fallback, against a fake ovhost and a temp
++checkout).
Every domain also gets a `404.html`: its vhost answers any path that is not a file in
`dist/<domain>/` with status 404 and that page (`try_files … =404` + `error_page 404 /404.html`),
ddiff --git a/package.json b/package.json
iindex fad9f7d..c9951d2 100644
---- a/package.json
++++ b/package.json
@@@ -4,7 +4,7 @@
"description": "Placeholder and hub pages for the planned OpenVibe domains (static build)",
"scripts": {
"build": "node build.js",
-- "test": "node test/build.test.js && node test/deploy-wrapper.test.js"
++ "test": "node test/run.js"
},
"dependencies": {
"openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v2.5.0"
ddiff --git a/test/build.test.js b/test/build.test.js
iindex 52c9102..d0d463b 100644
---- a/test/build.test.js
++++ b/test/build.test.js
@@@ -13,6 +13,13 @@ const read = (p) => fs.readFileSync(path.join(ROOT, p), 'utf8');
// dist/ and the vhosts must match sites.json + build.js (deploy serves dist/ as committed).
execFileSync(process.execPath, [path.join(ROOT, 'build.js'), '--check'], { stdio: 'pipe' });
++// package.json keeps the shared runner shape (`node test/run.js`, what every other repository here uses):
++// a bare "npm test" of another shape is refused inside agent jobs by openvibe-agents' PATH shim, so
++// `ov test` could not run the suite at all (review of OpenVibers/openvibe-agents#51).
++const pkg = JSON.parse(read('package.json'));
++assert.strictEqual(pkg.scripts.test, 'node test/run.js', 'package.json: test runs node test/run.js');
++assert.ok(fs.existsSync(path.join(ROOT, 'test', 'run.js')), 'test/run.js exists (the shared runner)');
++
// Pricing copy is never used on the network (no "free"/"$0"/"no ads" claims); "free speech" is fine.
const PRICING = /\$0\b|\bfor free\b|\bfree (forever|to use|of charge|plan|tier)\b|\bno ads\b|\bad-free\b/i;
// Claims no OpenVibe service makes good on (2026-09-24 audit): Host serves static files only (Stage C,
ddiff --git a/test/run.js b/test/run.js
nnew file mode 100644
iindex 0000000..f061312
---- /dev/null
++++ b/test/run.js
@@@ -0,0 +1,25 @@
++#!/usr/bin/env node
++/**
++ * Runs every test/*.test.js in its own process and fails if any fails. build.test.js rebuilds the pages in
++ * memory (`node build.js --check`) and checks them against sites.json and the committed facts.json;
++ * deploy-wrapper.test.js drives the deploy wrapper against a fake ovhost and a temp checkout. Neither
++ * needs the network or a running site.
++ *
++ * npm test # everything
++ * npm test -- build # 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 { run } = require('openvibe-shared/test-runner');
++
++// VERBOSE=1 also prints every file's output, then the summary again.
++run({ dir: __dirname, timeoutMs: 120000, pad: 26, parallel: 2 }).then((r) => {
++ if (process.env.VERBOSE) {
++ for (const t of r.results) console.log(`\n── ${t.file} ──\n${t.output.trimEnd()}`);
++ console.log(`\n${r.summary}`);
++ }
++ process.exit(r.exitCode);
++}, (err) => { console.error(err); process.exit(1); });