Skip to content

Test count metrics #3741

@finestructure

Description

@finestructure

We added test target metrics a while ago and discussed ideas around further test metrics.

One of these was a test count.

Concerning this, Paul LeMarquand from the Swift Testing working group suggested to use lsp-server to index a project's tests and then query it for the number of tests it found. This would work for both XCTest and Swift Testing tests/targets and should give exactly the same results as seen in Xcode or VS Code.

The LSP server would be sent a workspace/_synchronize request to start indexing, followed by a workspace/tests request for the test hierarchy. (Full request spec)

We’d also want to disable background indexing in sourcekit-lsp, which would let the workspace/_pollIndex command kick off indexing once and then stop watching the workspace when it finishes.

One option to interface with LSP would be a client package like LanguageClient.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions