Skip to content

Tests not recompiled when using Xcode toolchain #1519

Open
@fatbobman

Description

@fatbobman

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwaiting on inputStalled waiting on Input

    Type

    No type

    Projects

    Status

    Unscreened

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions