Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Testing makes whole package rebuild after each change from run to debug mode inside tests #7710

Open
machineko opened this issue Jun 20, 2024 · 2 comments
Labels

Comments

@machineko
Copy link

Executing task: swift: Building and Running Tests 

> swift test  --enable-experimental-swift-testing --experimental-event-stream-version 0 --experimental-event-stream-output /tmp/vscodemkfifo-1718907655582 --disable-xctest --filter RebuildTest\.DeviceTest\/ -Xswiftc -diagnostic-style=swift -Xswiftc -cxx-interoperability-mode=default

Building for debugging...
[8/8]
Build complete! (0.11s)
....
✔ Test run with 3 tests passed after 0.149 seconds.
true
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: swift: Build All 

> swift build --build-tests -Xswiftc -diagnostic-style=swift -Xswiftc -cxx-interoperability-mode=default
Building for debugging...
[14/369]

To Reproduce
Use any Testing project run test, after it finish run debug on the same test.

Expected behavior
No rebuilding with every run (debugging tests shouldn't use .xctest?)

Environment

  • OS: WSL debian 12
  • Swift version Swift version 6.0-dev (LLVM bf8bbb910874156, Swift a0bb875256e41ae)
    Target: x86_64-unknown-linux-gnu
  • Visual Studio Code version: 1.90.2
  • vscode-swift version: 1.10.2
@machineko machineko added the bug label Jun 20, 2024
@plemarquand
Copy link

After digging in to this a bit it looks like swift build --build-tests is not passing the -DSWIFT_PM_SUPPORTS_SWIFT_TESTING flag like swift test is. This difference in build arguments is causing a rebuild.

I'm going to move this issue under https://github.com/apple/swift-package-manager/ once it is migrated to the swiftlang organization (hopefully soon).

@plemarquand
Copy link

So the SWIFT_PM_SUPPORTS_SWIFT_TESTING flag can soon be removed from SwiftPM since swift-testing no longer requires it. This became the case with the removal of 5.10 support in swift-testing: apple/swift-testing#467. Once a swift-testing 0.11.0 is tagged the flag can be removed from SwiftPM and this usecase should speed up.

@plemarquand plemarquand transferred this issue from swiftlang/vscode-swift Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants