Skip to content

Commit 4c55f7d

Browse files
wenytang-msCopilot
andcommitted
fix(e2e): use cross-platform workspaceFolderUri for removeLibrary URI
The previous template file:///${workspaceFolder}/extraJars/extra-a.jar happened to round-trip through vscode.Uri.parse(...).fsPath on Windows (where ${workspaceFolder} is a C:\... path) but on Linux it produced file:////home/runner/... (FOUR slashes). Uri.parse mapped that to a //home/... path, so workspace.asRelativePath did not match the include entry and removeLibrary silently did nothing -- both verify-extra-a-gone and verify-extra-a-excluded then timed out on the Linux CI matrix. Switch to the new ${workspaceFolderUri} placeholder (autotest 0.7.13), which is backed by Node's url.pathToFileURL and produces a correctly formed file:// URI on both Windows and POSIX. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b4c3c66 commit 4c55f7d

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

test/e2e-plans/java-dep-classpath.yaml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -191,16 +191,15 @@ steps:
191191
# jar-leaf `–`. Driving the command by id sidesteps the hit-target gap and
192192
# exercises the same handler — `removeLibrary(Uri.parse(node.uri).fsPath)`.
193193
#
194-
# We pass a `{uri}` payload via JSON. JSON.parse runs before
195-
# resolveWorkspacePlaceholders, so `${workspaceFolder}` here is a literal
196-
# substring inside a valid JSON string. After parse + placeholder
197-
# substitution the URI mixes forward slashes (from the template) with
198-
# backslashes (from the Windows `${workspaceFolder}`), but `vscode.Uri.parse`
199-
# tolerates both and the resulting `.fsPath` round-trips through
200-
# `workspace.asRelativePath` to match the include entry that
201-
# `java.project.addLibraries` wrote in cycle 2.
194+
# We pass a `{uri}` payload as JSON. JSON.parse runs before
195+
# resolveWorkspacePlaceholders, so `${workspaceFolderUri}` here is a literal
196+
# substring inside a valid JSON string. autotest substitutes it with a
197+
# correctly-formed `file:///...` URI for the current OS (drive-letter form
198+
# on Windows, plain absolute path on POSIX), so the same template round-trips
199+
# through `Uri.parse(...).fsPath` and `workspace.asRelativePath(...)` to
200+
# match the include entry that `java.project.addLibraries` wrote in cycle 2.
202201
- id: "invoke-remove-extra-a"
203-
action: 'executeVSCodeCommand java.project.removeLibrary {"uri":"file:///${workspaceFolder}/extraJars/extra-a.jar"}'
202+
action: 'executeVSCodeCommand java.project.removeLibrary {"uri":"${workspaceFolderUri}/extraJars/extra-a.jar"}'
204203

205204
- id: "wait-after-remove"
206205
action: "wait 5 seconds"
@@ -272,7 +271,7 @@ steps:
272271
# disappears — proving the exclude path works independently of the include
273272
# removal already covered in cycle 3.
274273
- id: "invoke-remove-extra-a-glob"
275-
action: 'executeVSCodeCommand java.project.removeLibrary {"uri":"file:///${workspaceFolder}/extraJars/extra-a.jar"}'
274+
action: 'executeVSCodeCommand java.project.removeLibrary {"uri":"${workspaceFolderUri}/extraJars/extra-a.jar"}'
276275

277276
- id: "wait-after-glob-remove"
278277
action: "wait 5 seconds"

0 commit comments

Comments
 (0)