You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using the Xcode Swift toolchain with the Swift for VSCode extension, I’ve encountered an issue where test code is not recompiled when running tests via the UI (either through the test sidebar or the inline test buttons). This leads to outdated or incorrect test results if the test implementation or any of its dependencies have changed.
This behavior is especially noticeable when the changes are made in modules or targets that the test code depends on — for instance, editing a function in a library target that’s imported by the test target. Despite such changes, running tests via the UI seems to bypass recompilation, resulting in stale binary execution.
Running swift test in the terminal, however, correctly triggers a rebuild and reflects all code changes.
Expected behavior
Tests should be recompiled whenever the test runner is triggered from the VSCode UI, particularly when changes have been made to modules or targets that the test code depends on — consistent with the behavior of swift test in the terminal.
Environment
OS: macOS 15.4.1
Swift version Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)
Visual Studio Code version: Cursor 0.49.4
vscode-swift version: 2.2.0
The text was updated successfully, but these errors were encountered:
Does this issue still persist if you do View > Terminal > Building and Running Tests and copy and run the command used into a standalone terminal? The command should look something like /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift test --enable-xctest --disable-experimental-swift-testing -Xswiftc -diagnostic-style=llvm
When I modify code in the Domain module (which is a dependency of the Persistent module) and then run tests by clicking the test button within Persistent, the tests are executed without recompiling sometimes , resulting in outdated test behavior based on the old code.
However, when running /usr/bin/swift test directly in the terminal (also using the Xcode toolchain), it correctly triggers a full rebuild before executing the tests, and the updated code is reflected in the test results.
Describe the bug
When using the Xcode Swift toolchain with the Swift for VSCode extension, I’ve encountered an issue where test code is not recompiled when running tests via the UI (either through the test sidebar or the inline test buttons). This leads to outdated or incorrect test results if the test implementation or any of its dependencies have changed.
This behavior is especially noticeable when the changes are made in modules or targets that the test code depends on — for instance, editing a function in a library target that’s imported by the test target. Despite such changes, running tests via the UI seems to bypass recompilation, resulting in stale binary execution.
Running swift test in the terminal, however, correctly triggers a rebuild and reflects all code changes.
Expected behavior
Tests should be recompiled whenever the test runner is triggered from the VSCode UI, particularly when changes have been made to modules or targets that the test code depends on — consistent with the behavior of swift test in the terminal.
Environment
The text was updated successfully, but these errors were encountered: