[Pitch] A stable JSON-based ABI for tools integration

One of the core components of Swift Testing is its ability to interoperate with Xcode 16, VS Code, and other tools. Swift Testing has been fully open-sourced across all platforms supported by Swift, and can be added as a package dependency (or—eventually—linked from the Swift toolchain.)

Because Swift Testing may be used in various forms, and because integration with various tools is critical to its success, we need it to have a stable interface that can be used regardless of how it's been added to a package.

Read the full proposal here.

18 Likes

Like it!

In addition to IDEs, I would imagine this being useful for CI providers as well.

Indeed, CI systems can use these interfaces exactly the same way an IDE might. We consider both to be "tools" for the purposes of this API and testing in general.

Thank you @grynspan!

This functionality is important to formally define and support to achieve our goal of integrating deeply with IDEs like VS Code and Xcode. Recent versions of those tools have either already adopted early versions of what is described in this proposal or are in the process of doing so. The proposal is accepted.

There has not been much discussion here about the proposal details, but there's one aspect I wanted to call attention to which came up in offline discussions. This feature is intentionally designed with versioning in mind from the outset. It is very possible there may be breaking changes to the JSON-encoded data which require new versions, although luckily new data may be added to existing versions and that would be non-breaking and would not require a version bump. We encourage anyone using this interface directly to explicitly specify a version to avoid breakages over time.

5 Likes