Merge pull request #1502 from bilawalsidhu/sameh/core-leftovers

Keep the timing test's Vite cache out of the package tree
This commit is contained in:
Sameh Khamis authored and GitHub committed 2026-11-01 22:53:51 -08:00
commit 4ef37d44c5
2 files changed
+12 -1

No files matched your search

+1 -1
View File
@@ -2,4 +2,4 @@
looks up place names when no OpenAI key is configured, reverse-geocodes at looks up place names when no OpenAI key is configured, reverse-geocodes at
most two points instead of up to four, and looks up again only once the view most two points instead of up to four, and looks up again only once the view
shows a different area, not after every small pan, so a small pan no longer shows a different area, not after every small pan, so a small pan no longer
asks OpenAI for a new summary either (samehkhamis, #0000). asks OpenAI for a new summary either (samehkhamis, #1459).
+11
View File
@@ -1,5 +1,8 @@
import assert from 'node:assert/strict'; import assert from 'node:assert/strict';
import { readLayerSource } from '../testSupport/readLayerSource.mjs'; import { readLayerSource } from '../testSupport/readLayerSource.mjs';
import { mkdtempSync, rmSync } from 'node:fs';
import { tmpdir } from 'node:os';
import path from 'node:path';
import test from 'node:test'; import test from 'node:test';
import { fileURLToPath } from 'node:url'; import { fileURLToPath } from 'node:url';
@@ -136,6 +139,7 @@ test('traffic timing pairs real ordering to the scheduling change and guards re-
const timeouts = new Map(); const timeouts = new Map();
let timerId = 0; let timerId = 0;
let server; let server;
const cacheDir = mkdtempSync(path.join(tmpdir(), 'gev-traffic-timing-vite-'));
let trafficLayer; let trafficLayer;
let viewer; let viewer;
@@ -159,6 +163,12 @@ test('traffic timing pairs real ordering to the scheduling change and guards re-
}; };
server = await createServer({ server = await createServer({
root: fileURLToPath(new URL('../..', import.meta.url)), root: fileURLToPath(new URL('../..', import.meta.url)),
// Its own optimizer cache, not node_modules/.vite in the package tree:
// a host running Core's suite refuses files inside Core.
cacheDir,
// The test loads modules over SSR; the browser dependency optimizer would
// keep writing its cache after the server closes.
optimizeDeps: { noDiscovery: true, include: [] },
configFile: false, configFile: false,
appType: 'custom', appType: 'custom',
logLevel: 'silent', logLevel: 'silent',
@@ -328,6 +338,7 @@ test('traffic timing pairs real ordering to the scheduling change and guards re-
console.warn = originalWarn; console.warn = originalWarn;
performance.clearMarks(); performance.clearMarks();
performance.clearMeasures(); performance.clearMeasures();
rmSync(cacheDir, { recursive: true, force: true, maxRetries: 3 });
} }
}); });