openvibers/openvibe.sites Commits
Run test/.test.js through test/run.js so ov test can shard them (#6)
Changes
@@@ -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` failslocally 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`),@@@ -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"@@@ -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,nnew file mode 100644@@@ -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); });
@@ -67,10 +67,11 @@ subdomain of a live service says it is not routed yet; only a repository with no
@@ -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
"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.
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
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`),
`dist/<domain>/` with status 404 and that page (`try_files … =404` + `error_page 404 /404.html`),
@@ -4,7 +4,7 @@
@@ -4,7 +4,7 @@
"description": "Placeholder and hub pages for the planned OpenVibe domains (static build)",
"description": "Placeholder and hub pages for the planned OpenVibe domains (static build)",
"scripts": {
"scripts": {
"build": "node build.js",
"build": "node build.js",
- "test": "node test/build.test.js && node test/deploy-wrapper.test.js"
+ "test": "node test/run.js"
},
},
"dependencies": {
"dependencies": {
"openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v2.5.0"
"openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v2.5.0"
@@ -13,6 +13,13 @@ const read = (p) => fs.readFileSync(path.join(ROOT, p), 'utf8');
@@ -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).
// 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' });
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.
// 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;
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,
// Claims no OpenVibe service makes good on (2026-09-24 audit): Host serves static files only (Stage C,
new file mode 100644
new file mode 100644
@@ -0,0 +1,25 @@
@@ -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); });