mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-04 07:18:50 +00:00
Made by tools/layout/move_0216.py (the commit before this one) on db8e0be9c, the final code head of 0.2.16:
- 75 git mv (renames, so `git log --follow` and blame keep working; packaging/acceptance_matrix.md shows as delete + add because its links
changed too) and 3 removals: SETUP.bat, UPDATE.bat and update.sh (setup.py --update pulls the code now);
- 1,425 path edits in 307 files: root-relative paths in CI, Docker, .gitignore and the release scripts; Markdown links; Python and
Node joins from a root that moved with its folder; explicit edits for code that computes a root or names a moved path; tables of
repository paths inside tests.
engine/ holds what CMake builds (src, include, cmake, metal, sycl, spark, third_party, the C++ tests and benches). app/ is the desktop
app and its host (was apps/). terminal/ is the Terminal in the layout of the installed one (strata.py, setup.py, strata_cli,
strata_control, serve, bin, data, ref, crates, the Python tools and tests). docs/ has the documentation, docs/lang/ the translated
READMEs, docs/history and docs/bench-results. tools/ has the repository's own checks, packaging, docker, research and nix.
tests/core/test_tqp_ref.py is a pytest file and stays with the Python tests (terminal/tests/core/).
AGENTS.md, README.md, LICENSE, setup.sh and START-HERE.bat stay at the root.
No behaviour change: the same command lines, the same sources. For this head a replay of the script gave the same numbers and the path
scan (tools/layout/checks/path_scan.py) reports no hit; the suites and the builds run on this commit next.
26 lines
2.6 KiB
JavaScript
26 lines
2.6 KiB
JavaScript
#!/usr/bin/env node
|
|
/** Enumerate test files explicitly so npm test works without shell glob expansion. */
|
|
import {readdirSync} from 'node:fs';
|
|
import {spawn} from 'node:child_process';
|
|
import {resolve} from 'node:path';
|
|
const root=resolve(import.meta.dirname,'..');
|
|
/* Relative to the host folder, where node runs (cwd below): the command line must not grow with the length of the checkout's own path. 337 absolute paths in a worktree
|
|
with a long name were 34,272 characters against Windows' 32,767 and the spawn failed with ENAMETOOLONG; relative, the line is about 12,000 wherever the checkout is. */
|
|
const files=readdirSync(resolve(root,'tests')).filter(name=>name.endsWith('.test.mjs')).sort().map(name=>`tests/${name}`);
|
|
/* Every test file runs against scratch copies of the per-user places the host writes to (the owner's real profile is never touched). */
|
|
import {mkdirSync,mkdtempSync} from 'node:fs';
|
|
import {tmpdir} from 'node:os';
|
|
import {join} from 'node:path';
|
|
const scratch=mkdtempSync(join(tmpdir(),'strata-host-suite-profile-'));
|
|
// Harness discovers personal skills through the home directory, independently of APPDATA/XDG.
|
|
const home=join(scratch,'home');mkdirSync(home);
|
|
const env={...process.env,HOME:home,USERPROFILE:home,STRATA_HOME:home,STRATA_SETTINGS_FILE:join(scratch,'app-settings.json'),STRATA_COMPONENTS_DIR:join(scratch,'components'),LOCALAPPDATA:join(scratch,'Local'),APPDATA:join(scratch,'Roaming'),XDG_DATA_HOME:join(scratch,'xdg-data'),XDG_STATE_HOME:join(scratch,'xdg-state'),XDG_CONFIG_HOME:join(scratch,'xdg-config')};
|
|
/* Run from PowerShell 7 (GitHub's Windows runners), PSModulePath names PowerShell 7's module folders first and a Windows PowerShell 5.1 child
|
|
that a test starts cannot load Get-Acl / Get-FileHash from them: keep only the folders that are not PowerShell 7's. */
|
|
if(process.platform==='win32'&&env.PSModulePath){const ps7=p=>{const l=p.toLowerCase().replace(/\//g,'\\');return l.includes('\\powershell\\')&&!l.includes('\\windowspowershell\\');};env.PSModulePath=env.PSModulePath.split(';').filter(p=>p&&!ps7(p)).join(';');}
|
|
/* A test that never finishes fails after STRATA_TEST_TIMEOUT_MS (default 10 minutes) instead of holding the whole run for ever; extra arguments (a reporter, --test-name-pattern) go to node --test. */
|
|
const timeout=Number(process.env.STRATA_TEST_TIMEOUT_MS)||600000;
|
|
const child=spawn(process.execPath,['--test',`--test-timeout=${timeout}`,...process.argv.slice(2),...files],{cwd:root,stdio:'inherit',env});
|
|
child.on('error',error=>{console.error(error.message);process.exitCode=1;});
|
|
child.on('exit',(code,signal)=>{process.exitCode=code??(signal?1:0);});
|