Skip to content

Work around ObjectScript v3.0 change which broke our handling of client-side tests #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2025
Merged
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
9 changes: 2 additions & 7 deletions src/commonRunTestsHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export async function commonRunTestsHandler(controller: vscode.TestController, r
true
);
let authority = mapInstance[0];
let query = "";
const mapTestClasses = mapInstance[1];
const firstClassTestItem = Array.from(mapTestClasses.values())[0];
const oneUri = firstClassTestItem.uri;
Expand Down Expand Up @@ -132,14 +131,10 @@ export async function commonRunTestsHandler(controller: vscode.TestController, r

// When client-side mode is using 'objectscript.conn.docker-compose the first piece of 'authority' is blank,
if (authority.startsWith(":")) {
const namespace = authority.slice(1).toUpperCase();
// Arguably this should be `encodeURIComponent(namespace)` but vscode-objectscript extension doesn't decode the ns queryparam
// (see https://github.com/intersystems-community/vscode-objectscript/blob/978dcff2bafad6261919a13e0c69f025d6027c61/src/api/index.ts#L109)
// It presumably gets away with this because %-prefixed namespaces are rare, and the common one %SYS can't be mistaken for an encoded one.
query = `ns=${namespace}`;
authority = folder?.name || "";
}
const testRoot = vscode.Uri.from({ scheme: 'isfs', authority, path: `/.vscode/UnitTestRoot/${username}`, query });
// No longer rely on ISFS redirection of /.vscode because since ObjectScript v3.0 it no longer works for client-only workspaces.
const testRoot = vscode.Uri.from({ scheme: 'isfs', authority: authority.split(":")[0], path: `/_vscode/${namespace}/UnitTestRoot/${username}`, query: "csp&ns=%SYS" });
try {
// Limitation of the Atelier API means this can only delete the files, not the folders
// but zombie folders shouldn't cause problems.
Expand Down
Loading