Strip project scope prefix from IDs copied by "Copy test ID" - #26153
Eduardo Villalpando Mello (edvilme) merged 4 commits into
Conversation
Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
|
🔒 Automated review in progress — Bill Schnurr (@bschnurr) is auto-reviewing this PR. |
Bill Schnurr (bschnurr)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
|
Result: Verification detailsVerification: Isolated verification observed failures that were not classified as caused by this PR: Dependency and test discovery. The relevant tests could not be fully run in the isolated environment; this review is not fully verified. Summary: The targeted utils unit suite compiled and passed all 13 tests, including scoped pytest, parameterized, Windows, legacy, and unittest IDs. TypeScript compilation and ESLint also passed. An initial combined run and git-based discovery were blocked by sandbox infrastructure, so the verdict is partially verified despite the successful targeted run. Test runs: 3 passed, 1 failed, 1 not run
|
Fixes #26092
"Copy test ID" copied the raw
TestItem.id, which since project scoping is{projectId}@@vsc@@{testId}, so users pastedfile:///path/to/workspace@@vsc@@/path/to/workspace/tests/unit/test_foo.py::test_barinstead of the test ID.Changes
src/client/testing/utils.ts:writeTestIdToClipboardnow normalizes the ID with the existingparseVsIdhelper before unittest detection/conversion, the pytest clipboard write, and logging.TestItem.idis not mutated and discovery/execution scoping is untouched — only the clipboard-facing value is normalized.parseVsIdreturns[undefined, vsId]for unscoped IDs, so legacy behavior and themodule.class.methodunittest formatting are preserved.src/test/testing/utils.unit.test.ts: this file was a top-level IIFE withtry/catch-swallowed assertions that mocha never registered as tests (and itsidToModuleClassMethodinputs had lost their backslash separators). Converted to asuite/testfile asserting the real clipboard contents via theMockClipboardfromsrc/test/vscode-mock.ts, with cases for project-scoped pytest IDs, parameterized IDs (test_pipe_single[False]preserved verbatim), Windows-style paths, legacy unscoped IDs, and project-scoped unittest IDs.