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

XCTest output is not recorded when using CodeLLDB #1100

Closed
plemarquand opened this issue Sep 25, 2024 · 2 comments
Closed

XCTest output is not recorded when using CodeLLDB #1100

plemarquand opened this issue Sep 25, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@plemarquand
Copy link
Contributor

Describe the bug
When using CodeLLDB as the debug adapter XCTest output is not captured and so test results are not recorded. If swift.debugger.useDebugAdapterFromToolchain is true then output is captured and tests work as expected.

To Reproduce
Create a simple XCTest:

import XCTest

class MyTests: XCTestCase {
    func testFoo() {
        print("x")
    }
}
  • Right click testFoo()'s test icon, Debug Test
  • Notice there is Debug Console output for the test, but the test is not marked as passed.

Environment

  • OS: macOS
  • Swift version: swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.11 clang-1600.0.26.2)
  • vscode-swift version: 1.11.2
@plemarquand plemarquand added the bug Something isn't working label Sep 25, 2024
plemarquand added a commit to plemarquand/vscode-swift that referenced this issue Sep 26, 2024
The CodeLLDB extension expects the debug adapter to be called `lldb`. If
we are using it and we don't call `registerDebugAdapterTrackerFactory`
with `lldb` as the adapter name then we fail to get logs in the
debugSessionCallback when running tests. This prevents XCTests results
from being parsed, and hides the swift-testing outout.

Revert a portion of swiftlang#1024 that always set the debug adapter name to
`swift-lldb` and use `lldb` when we're using CodeLLDB as the debug
adapter.

Issue swiftlang#1100
plemarquand added a commit that referenced this issue Sep 26, 2024
The CodeLLDB extension expects the debug adapter to be called `lldb`. If
we are using it and we don't call `registerDebugAdapterTrackerFactory`
with `lldb` as the adapter name then we fail to get logs in the
debugSessionCallback when running tests. This prevents XCTests results
from being parsed, and hides the swift-testing outout.

Revert a portion of #1024 that always set the debug adapter name to
`swift-lldb` and use `lldb` when we're using CodeLLDB as the debug
adapter.

Issue #1100
@plemarquand plemarquand added the needs verification Issue has been fixed, but requires verification before closing label Sep 26, 2024
@michael-weng
Copy link
Contributor

I will verify this one.

@michael-weng
Copy link
Contributor

Verified with and without the patch, the bug is fixed with the patch applied.

@award999 award999 removed the needs verification Issue has been fixed, but requires verification before closing label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

3 participants