Skip to content

SE-0501: HTML coverage report - #9076

Draft
bkhouri wants to merge 1 commit into
swiftlang:mainfrom
bkhouri:t/main/swift-testing-generate-covreport
Draft

SE-0501: HTML coverage report#9076
bkhouri wants to merge 1 commit into
swiftlang:mainfrom
bkhouri:t/main/swift-testing-generate-covreport

Conversation

@bkhouri

@bkhouri bkhouri commented Aug 29, 2025

Copy link
Copy Markdown
Contributor

Currently, swift test supports generating a JSON coverage report, which is great for ingesting into various systems. The JSON coverage report generation is processed by llvm-cov where SwiftPM is simply orchestrating the command line invocation. The JSON, however, is not very "human consumable friendly" while iterating at-desk.

This change adds an additional command line argument to swift test that allows specify whether to generate a JSON or HTML report. Selecting HTML will produce a llvm-cov HTML report, that is more easily consumable by a developer at desk. Similar to the JSON coverage report, Swift Package Manager is only responsible for constructing the command line argument that will be passed to llvm-cov, which will produce the HTML report.

Since llvm-cov show (which would produce the HTML) has numerous CLI arguments that allows configurations of the HTML report, this change supports -Xcov argument for specifying additional coverage report arguments.

See SE-0501: HTML Coverage Report and an update to the proposal

TODO:

  • Update documentation
  • Add automated tests
  • Add tests that verify the deprecation command line arguments
  • Remove HTML report response file support
  • Hook in the -Xcov arguments to the JSON and HTML report
  • Ensure all proposal changes are implemented
  • ensure nothing is implemented that is not part of the proposal
  • update release notes

Depends on: apple/swift-argument-parser#830
Depends on: #9162
Depends on: #10146
Depends on: #10400
Depends on: swiftlang/swift#89403

@bkhouri
bkhouri force-pushed the t/main/swift-testing-generate-covreport branch 4 times, most recently from e5b2559 to 8761ac3 Compare September 18, 2025 15:48
@bkhouri
bkhouri force-pushed the t/main/swift-testing-generate-covreport branch 6 times, most recently from d184ab9 to be05442 Compare September 29, 2025 04:54
@bkhouri
bkhouri force-pushed the t/main/swift-testing-generate-covreport branch 4 times, most recently from 0f83da6 to 235517a Compare October 2, 2025 02:19
@bkhouri
bkhouri force-pushed the t/main/swift-testing-generate-covreport branch 3 times, most recently from 74feb40 to f17b23d Compare November 13, 2025 04:06
@bkhouri
bkhouri force-pushed the t/main/swift-testing-generate-covreport branch from f17b23d to 89f8663 Compare November 18, 2025 16:51
@bkhouri
bkhouri force-pushed the t/main/swift-testing-generate-covreport branch from b0d20ee to e541cfe Compare November 19, 2025 17:51
@bkhouri
bkhouri force-pushed the t/main/swift-testing-generate-covreport branch 2 times, most recently from f31c064 to 5b5935a Compare January 12, 2026 07:25
@bkhouri bkhouri changed the title Swift Test: Add HTML coverage report SE-0501: Add HTML coverage report Jan 12, 2026
@bkhouri bkhouri changed the title SE-0501: Add HTML coverage report SE-0501: HTML coverage report Jan 12, 2026
@bkhouri
bkhouri force-pushed the t/main/swift-testing-generate-covreport branch from 5b5935a to 5c884e0 Compare April 9, 2026 01:44
@bkhouri
bkhouri force-pushed the t/main/swift-testing-generate-covreport branch 2 times, most recently from 65b5ef5 to c0a054d Compare May 5, 2026 13:38
@bkhouri

bkhouri commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

This PR is blocked on a Swift Argument Parser release which contains apple/swift-argument-parser#830

bkhouri added a commit to bkhouri/swift that referenced this pull request May 27, 2026
Update Swift Argument Parser to use release 1.8.1 to support
SE-0501: HTML Coverage report

Relates to: swiftlang/swift-package-manager#9076
bkhouri added a commit to bkhouri/swift that referenced this pull request May 27, 2026
Update Swift Argument Parser to use release 1.8.1 to support
SE-0501: HTML Coverage report

Relates to: swiftlang/swift-package-manager#9076

(cherry picked from commit a914523)
bkhouri added a commit to bkhouri/swift that referenced this pull request May 27, 2026
Update Swift Argument Parser to use release 1.8.1 to support
SE-0501: HTML Coverage report

Relates to: swiftlang/swift-package-manager#9076

(cherry picked from commit a914523)
@bkhouri
bkhouri force-pushed the t/main/swift-testing-generate-covreport branch from c0a054d to aac2de3 Compare May 30, 2026 06:47
@bkhouri
bkhouri changed the base branch from main to release/6.4.x May 30, 2026 06:48
@bkhouri bkhouri changed the title SE-0501: HTML coverage report [6.4] SE-0501: HTML coverage report May 30, 2026
@bkhouri
bkhouri force-pushed the t/main/swift-testing-generate-covreport branch from aac2de3 to b059f6e Compare May 30, 2026 19:02
bkhouri added a commit to bkhouri/swift that referenced this pull request Jun 22, 2026
Update Swift Argument Parser to use release 1.8.1 to support
SE-0501: HTML Coverage report

Relates to: swiftlang/swift-package-manager#9076
bkhouri added a commit to bkhouri/swift that referenced this pull request Jun 22, 2026
Update Swift Argument Parser to use release 1.8.1 to support
SE-0501: HTML Coverage report

Relates to: swiftlang/swift-package-manager#9076

(cherry picked from commit a914523)
bkhouri added a commit to bkhouri/swift that referenced this pull request Jun 22, 2026
Update Swift Argument Parser to use release 1.8.1 to support
SE-0501: HTML Coverage report

Relates to: swiftlang/swift-package-manager#9076

(cherry picked from commit 9529cf5)
bkhouri added a commit to bkhouri/swift that referenced this pull request Jun 29, 2026
Update Swift Argument Parser to use release 1.8.1 to support
SE-0501: HTML Coverage report

Relates to: swiftlang/swift-package-manager#9076
bkhouri added a commit to bkhouri/swift that referenced this pull request Jun 29, 2026
Update Swift Argument Parser to use release 1.8.1 to support
SE-0501: HTML Coverage report

Relates to: swiftlang/swift-package-manager#9076

(cherry picked from commit a3e8cdf)
bkhouri added a commit to bkhouri/swift that referenced this pull request Jun 29, 2026
Update Swift Argument Parser to use release 1.8.2 to support
SE-0501: HTML Coverage report

Relates to: swiftlang/swift-package-manager#9076
bkhouri added a commit to bkhouri/swift that referenced this pull request Jun 29, 2026
Update Swift Argument Parser to use release 1.8.2 to support
SE-0501: HTML Coverage report

Relates to: swiftlang/swift-package-manager#9076

(cherry picked from commit 241fcbb)
bkhouri added a commit to bkhouri/swift that referenced this pull request Jul 15, 2026
Update Swift Argument Parser to use release 1.8.2 to support
SE-0501: HTML Coverage report

Relates to: swiftlang/swift-package-manager#9076
bkhouri added a commit to bkhouri/swift that referenced this pull request Aug 10, 2026
Update Swift Argument Parser to use release 1.8.2 for `main`, `rebranch`
and `next` to support SE-0501: HTML Coverage report, and another
proposal, allow for deprecating package products, which is currently in
a pitch [1].

Relates to: swiftlang/swift-package-manager#9076

[1]: https://forums.swift.org/t/pitch-deprecating-package-products-in-the-package-manifest/88468/
@FranzBusch

Copy link
Copy Markdown
Member

@bkhouri What is the latest on this? The evolution has been accepted but the implementation is still pending

@bkhouri
bkhouri force-pushed the t/main/swift-testing-generate-covreport branch from b059f6e to a415f45 Compare August 11, 2026 15:54
@bkhouri
bkhouri changed the base branch from release/6.4.x to main August 11, 2026 15:54
@bkhouri bkhouri changed the title [6.4] SE-0501: HTML coverage report SE-0501: HTML coverage report Aug 11, 2026
@bkhouri

bkhouri commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

@bkhouri What is the latest on this? The evolution has been accepted but the implementation is still pending

@FranzBusch : This change required a feature in Swift Argument Parser 1.8.1, but that version requires being build with Swift 6.0. Building the toolchain on linux currently failed as the base version in the images uses Swift 5.x. So this PR is currently blocked on swiftlang/swift#89403.

We need @shahmishal to update the Swift version used in the docker images used to build the Linux toolchain.

@shahmishal

Copy link
Copy Markdown
Member

We need @shahmishal to update the Swift version used in the docker images used to build the Linux toolchain.

The Docker images were updated for main branch to 6.2.x version a few weeks ago.

@bkhouri
bkhouri force-pushed the t/main/swift-testing-generate-covreport branch from a415f45 to 40e464d Compare August 13, 2026 19:34
Currently, `swift test` supports generating a JSON coverage report,
which is great for ingesting into various systems. The JSON coverage
report generation is processed by `llvm-cov`` where SwiftPM is simply
orchestrating the command line invocation. The JSON, however, is not
very "human consumable friendly" while iterating at-desk.

This change adds an additional command line argument to swift test that
allows specify whether to generate a JSON or HTML report. Selecting HTML
will produce a `llvm-cov`` HTML report, that is more easily consumable
by a developer at desk. Similar to the JSON coverage report, Swift
Package Manager is only responsible for constructing the command line
argument that will be passed to `llvm-cov``, which will produce the HTML
report.

Since `llvm-cov show` (which would produce the HTML) has numerous CLI
arguments that allows configurations of the HTML report, this change
supports `-Xcov` argument for specifying additional coverage report
arguments.
@bkhouri
bkhouri force-pushed the t/main/swift-testing-generate-covreport branch from 40e464d to de046a6 Compare August 14, 2026 21:47
@bkhouri

bkhouri commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

@swift-ci test

@bkhouri

bkhouri commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

@swift-ci test windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants