mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-15 15:52:21 +00:00
Delete dead render code and consolidate QA helpers
Remove code that nothing in the app, the runners or CI uses: - the one-off migration compare, look and bench scripts and the vector ground prototype they measured, with the bench tables in the docs; - the unused Navara-named shared render modules (polygons, ground picks, mover bank, ground ring); - the Cesium-shaped aircraft and vessel test renderers, and the trail, engineFromViewer and horizon-occluder helpers only they kept alive. Their tests now run on the production displays over the fake engine; - Navara's unread diagnostics, fallback ports, dead exports and parameters, stale effect-chain anchors and the unread capability flags. The QA scripts share one keyless guard and readiness wait, the session harness reuses the strict harness's browser flags and block list, and the harness honours QA_ANGLE and QA_RESERVED_PORTS. The bikeshare fixture keeps only what its scenario reads. The docs name the engine picker where it is (VISUAL PRESETS) and drop dated run results. No behaviour changes on either engine. Navara layer renderer lines fall from 189 to 0 and viewer lines from 891 to 849.
This commit is contained in:
1 parent
18f69c2699
commit
371d848eec
130 files changed
+633
-4542
No files matched your search
@@ -34,18 +34,11 @@ const CHOICES = Object.freeze([...ENGINES, 'navara-hd']);
|
||||
/** Local ports that belong to the user's own servers: never a QA preview. */
|
||||
export const RESERVED_PORTS = Object.freeze([
|
||||
'',
|
||||
'4173',
|
||||
'4174',
|
||||
'4185',
|
||||
'4186',
|
||||
'4187',
|
||||
'4188',
|
||||
'4189',
|
||||
'4194',
|
||||
'4196',
|
||||
...(process.env.QA_RESERVED_PORTS ?? '4173,4174,4185,4186,4187,4188,4189,4194,4196')
|
||||
.split(',').map((port) => port.trim()).filter(Boolean),
|
||||
]);
|
||||
/** Chrome flags every scenario's browser starts with (the GPU path). */
|
||||
const CHROME_ARGS = Object.freeze(['--use-angle=metal', '--enable-gpu']);
|
||||
export const CHROME_ARGS = Object.freeze([`--use-angle=${process.env.QA_ANGLE || 'metal'}`, '--enable-gpu']);
|
||||
|
||||
/** The values of --layers=a,b and --evidence=FILE (null when absent). */
|
||||
export function strictArguments(argv = process.argv) {
|
||||
@@ -69,6 +62,27 @@ export function localPreview(href) {
|
||||
return url;
|
||||
}
|
||||
|
||||
/** Refuse to start a preview over an existing local server. */
|
||||
export async function assertPreviewPortAvailable(href, request = fetch) {
|
||||
const url = localPreview(href);
|
||||
let response;
|
||||
try {
|
||||
response = await request(url.origin, { signal: AbortSignal.timeout(1000) });
|
||||
} catch (error) {
|
||||
if (error.cause?.code === 'ECONNREFUSED') return;
|
||||
throw error;
|
||||
}
|
||||
if (response) throw new Error(`Preview port ${url.port} already answers`);
|
||||
}
|
||||
|
||||
/** Check the running page before any scenario touches its layers. */
|
||||
export async function assertKeylessPreview(page) {
|
||||
await page.evaluate(() => {
|
||||
if (window.__godsEyeView.tileset || window.__GOOGLE_MAPS_API_KEY__)
|
||||
throw new Error('Keyless preview required');
|
||||
});
|
||||
}
|
||||
|
||||
/** The URL with no remote IP: fulfilled by a fixture or a cache, or a data URL. */
|
||||
const live = (response) => Boolean(response.remoteIPAddress);
|
||||
|
||||
@@ -567,6 +581,7 @@ export async function waitForEngine(page, kind, { timeout = 120000 } = {}) {
|
||||
await page.evaluate(
|
||||
() => window.__godsEyeView.styleManager.initialRestorePromise,
|
||||
);
|
||||
await assertKeylessPreview(page);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user