Skip to content

Commit 09f9ecb

Browse files
Merge pull request #42 from gjsjohnmurray:fix-41
Worka around ObjectScript v3.0 change which broke our handling of client-side tests
2 parents 2a874e8 + 6fc8be4 commit 09f9ecb

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/commonRunTestsHandler.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ export async function commonRunTestsHandler(controller: vscode.TestController, r
9191
true
9292
);
9393
let authority = mapInstance[0];
94-
let query = "";
9594
const mapTestClasses = mapInstance[1];
9695
const firstClassTestItem = Array.from(mapTestClasses.values())[0];
9796
const oneUri = firstClassTestItem.uri;
@@ -132,14 +131,10 @@ export async function commonRunTestsHandler(controller: vscode.TestController, r
132131

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

0 commit comments

Comments
 (0)