Add a smoke test runner, a shared harness, and safer build scripts
- pnpm smoke runs tests/smoke/ in parallel. It starts Vite when nothing serves SMOKE_URL, finds an installed Chrome when Playwright has no Chromium, and skips a test with a reason when a requirement that the test declares with "// @requires" is missing. Logs go to output/smoke/logs/. - tests/smoke/_harness/ holds the Playwright launch, page error collection, the Tauri IPC mock with an in-memory workspace, and output folders. tabs/order uses it as the first converted test. - Pin Playwright 1.63.0, the version that browser-runtime uses. - RUNESTONE_PLUGIN_REPOS names the folder of the sibling plugin checkouts for buildPlugins, the menu audit, and the smoke tests. - buildInstaller restores the version fields after Ctrl+C, keeps the backups of each attempt, stops when the browser runtime is not staged, and writes the file name instead of absolute paths to host.json. - buildPlugins clears the staged Table Formulas package before copying. - plugins/choiceMenus used the wrong Local Autocomplete folder name.
This commit is contained in:
@@ -3,6 +3,7 @@ import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const root = fileURLToPath(new URL('../', import.meta.url));
|
||||
const pluginRepos = process.env.RUNESTONE_PLUGIN_REPOS || path.resolve(root, '..');
|
||||
export const projects = ['RuneStone', 'RuneStone_Project_Management', 'RuneStone_Terminal', 'RuneStone_Background_Slideshow', 'RuneStone_Local_Autocomplete', 'RuneStone_Git', 'RuneStone_PDF_Viewer', 'RuneStone_Table_Formulas', 'RuneStone_CSV_Viewer'];
|
||||
const patterns = {
|
||||
action: /\b(?:showActionMenu|actionMenu)\s*\(/g,
|
||||
@@ -20,7 +21,7 @@ async function files(dir) {
|
||||
export async function discover() {
|
||||
const surfaces = {}, missing = [];
|
||||
for (const project of projects) {
|
||||
const base = project === 'RuneStone' ? root : path.resolve(root, '..', project);
|
||||
const base = project === 'RuneStone' ? root : path.resolve(pluginRepos, project);
|
||||
let sources;
|
||||
try { sources = await files(path.join(base, 'src')); } catch (error) { if (error.code === 'ENOENT') { missing.push(project); continue; } throw error; }
|
||||
for (const file of sources) {
|
||||
@@ -45,7 +46,7 @@ export async function checkInventory() {
|
||||
for (const name of ['actionMenu.ts', 'managedActionMenu.ts', 'IconButton.svelte']) {
|
||||
try {
|
||||
const host = await readFile(path.join(root, 'src/lib/ui', name), 'utf8');
|
||||
const terminal = await readFile(path.resolve(root, '../RuneStone_Terminal/vendor/runestone/ui', name), 'utf8');
|
||||
const terminal = await readFile(path.resolve(pluginRepos, 'RuneStone_Terminal/vendor/runestone/ui', name), 'utf8');
|
||||
if (host.replaceAll('\r\n', '\n') !== terminal.replaceAll('\r\n', '\n')) failures.push(`Terminal shared snapshot differs: ${name}`);
|
||||
} catch (error) { failures.push(`Cannot check Terminal snapshot ${name}: ${error.code}`); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user