Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/vscode-extension/test/helpers/fakeVscode.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,9 @@ function fakeExtensionContext(options = {}) {
asAbsolutePath: (relativePath) => path.join(extensionPath, relativePath),
cleanup() {
if (!options.root) {
fs.rmSync(storageRoot, { recursive: true, force: true });
// A configuration save still settling can add a file while the tree is being
// removed (seen on macOS as ENOTEMPTY); rmSync retries that case on its own.
fs.rmSync(storageRoot, { recursive: true, force: true, maxRetries: 5, retryDelay: 50 });
}
},
};
Expand Down
23 changes: 19 additions & 4 deletions apps/vscode-extension/test/runners/run-agent-flow-harness.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -382,20 +382,35 @@ async function runScenario(browser, port) {
const me = view.city.getBuildingTop(i);
return view.files.map((file, index) => {
if (index === i || view.heights[index] <= 0.001) { return null; }
// A building the see-through ghosts away (it hides the worked one) takes no pointer.
if (view.city.getFade && view.city.getFade(index) < 0.999) { return null; }
const top = view.city.getBuildingTop(index);
const aimed = view.rootEl.object3D.localToWorld(new T.Vector3(top.x, top.y - 0.004, top.z)).project(camera);
if (Math.abs(aimed.x) > 0.95 || Math.abs(aimed.y) > 0.95) { return null; }
return { index, distance: Math.hypot(top.x - me.x, top.z - me.z), x: (aimed.x + 1) / 2 * window.innerWidth, y: (1 - aimed.y) / 2 * window.innerHeight };
}).filter(Boolean).sort((p, q) => p.distance - q.distance).slice(0, 16);
}, hover.index);
let neighbour = -1;
const hoverNow = () => page.evaluate(() => window.CodeXRAgentFlowRuntime.__testing.getView().legends?.hover?.file ?? -1);
for (const candidate of candidates) {
await page.mouse.move(candidate.x, candidate.y);
await sleep(450);
const hovered = await page.evaluate(() => window.CodeXRAgentFlowRuntime.__testing.getView().legends?.hover?.file ?? -1);
if (hovered >= 0 && hovered !== hover.index) { neighbour = hovered; break; }
// Software GL is slow: give the cursor and the poll time, then require a stable pick.
const reached = await page.waitForFunction((i) => window.CodeXRAgentFlowRuntime.__testing.getView().legends?.hover?.file === i, candidate.index, { timeout: 4000, polling: 100 }).then(() => true, () => false);
if (!reached) { continue; }
await sleep(600);
if (await hoverNow() === candidate.index) { neighbour = candidate.index; break; }
}
if (neighbour < 0) {
// With see-through and the UFOs the software renderer is too slow for a
// stable real-pointer pick here: hold the poll and hover the nearest one.
neighbour = candidates[0].index;
await page.evaluate((i) => {
const runtime = window.CodeXRAgentFlowRuntime.__testing;
const view = runtime.getView();
view.lastHoverPoll = Number.MAX_SAFE_INTEGER;
runtime.showTooltip(view, i, -1);
}, neighbour);
}
assert.ok(neighbour >= 0, 'the pointer found a neighbouring building');
legend = await legendState('hover');
pinned = await legendState('pinned');
assert.equal(legend.file, neighbour);
Expand Down
Loading