FsHotWatch.TestPrune
0.7.0-alpha.10
See the version list below for details.
dotnet add package FsHotWatch.TestPrune --version 0.7.0-alpha.10
NuGet\Install-Package FsHotWatch.TestPrune -Version 0.7.0-alpha.10
<PackageReference Include="FsHotWatch.TestPrune" Version="0.7.0-alpha.10" />
<PackageVersion Include="FsHotWatch.TestPrune" Version="0.7.0-alpha.10" />
<PackageReference Include="FsHotWatch.TestPrune" />
paket add FsHotWatch.TestPrune --version 0.7.0-alpha.10
#r "nuget: FsHotWatch.TestPrune, 0.7.0-alpha.10"
#:package FsHotWatch.TestPrune@0.7.0-alpha.10
#addin nuget:?package=FsHotWatch.TestPrune&version=0.7.0-alpha.10&prerelease
#tool nuget:?package=FsHotWatch.TestPrune&version=0.7.0-alpha.10&prerelease
FsHotWatch.TestPrune
Plugin for test impact analysis. When you change a source file, TestPrune figures out which tests are affected and runs only those -- instead of your entire test suite.
Why
Running all tests after every save is slow. If you change a single function, you probably only need to run 3 tests out of 500. TestPrune uses the warm FSharpChecker's symbol analysis to track which tests depend on which symbols, so it can tell you exactly what to re-run.
How it works
- You save a file
- TestPrune receives
FileCheckedwith the warm compiler's results - It analyzes which symbols changed
- It looks up which test classes reference those symbols
- If
testConfigsare provided, it runs only the affected tests - It emits
TestCompletedfor downstream plugins (like Coverage)
Configuration
In .fs-hot-watch.json:
{
"tests": {
"beforeRun": "dotnet build",
"projects": [
{
"project": "MyApp.Tests",
"command": "dotnet",
"args": "run --project tests/MyApp.Tests --no-build --",
"filterTemplate": "--filter-class {classes}",
"classJoin": " ",
"group": "unit"
}
]
}
}
| Field | Type | Default | Description |
|---|---|---|---|
beforeRun |
string |
-- | Command to run before each test run (e.g. "dotnet build"). |
projects[].project |
string |
"unknown" |
Project name (for filtering and display). |
projects[].command |
string |
"dotnet" |
Test runner command. |
projects[].args |
string |
"test --project <name>" |
Arguments to the test runner. |
projects[].group |
string |
"default" |
Group name (for running subsets via fs-hot-watch test -p). |
projects[].environment |
object |
{} |
Extra environment variables as "KEY": "VALUE" pairs. |
projects[].filterTemplate |
string |
-- | Template for class-based filtering. {classes} is replaced with affected test class names. |
projects[].classJoin |
string |
" " |
Separator for joining class names in the filter. |
CLI
# Run all affected tests
fs-hot-watch test
# Run tests for a specific project group
fs-hot-watch test -p MyApp.Tests
# Run only previously-failed tests
fs-hot-watch test --only-failed
# Query which tests are affected by recent changes
fs-hot-watch affected-tests
# Reset coverage baseline — next full run rebuilds coverage.baseline.json
fs-hot-watch coverage refresh-baseline
Coverage
When projects[].coverage is true (the default), TestPrune asks coverlet to
emit its native JSON format per test project under
<repoRoot>/<tests.coverageDir>/<project>/:
coverage.baseline.json— written by every full run. Authoritative snapshot of the whole suite's coverage.coverage.partial.json— written by impact-filtered runs. Only the subset of lines the filtered tests touched.coverage.cobertura.xml— always derived; downstream gating (coverageratchet, editor badges, etc.) reads this file.
After each test run, TestPrune either converts the baseline directly (full run) or merges the partial into the baseline per-line (max of hit counts) before rewriting the cobertura file. Partial runs never lower the reported coverage.
Bootstrap. If no coverage.baseline.json exists and the run was filtered,
TestPrune skips cobertura emission entirely. Run fs-hot-watch test (or any
full-suite invocation) once to produce a baseline; subsequent filtered runs
will merge against it.
Caveat. Coverlet's merge keys by file path + line number, not by content hash. Edits between a baseline and a partial can misattribute hits at the line level. The aggregate coverage ratio stays correct.
Programmatic usage
From the FullPipelineExample:
daemon.RegisterHandler(
TestPrunePlugin.create
".fshw/test-impact.db" // database path
repoRoot // repo root
(Some [ // test configs
{ Project = "MyApp.Tests"
Command = "dotnet"
Args = "run --project tests/MyApp.Tests --no-build --"
Group = "unit"
Environment = []
FilterTemplate = Some "--filter-class {classes}"
ClassJoin = " " }
])
None // symbol snapshot
None // beforeRun callback
None // afterRun callback
None // coveragePaths: project -> CoveragePaths option
None // getCommitId for caching
)
Install
dotnet add package FsHotWatch.TestPrune
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- FSharp.Core (>= 10.1.203)
- FsHotWatch (>= 0.8.0-alpha.10)
- System.Security.Cryptography.Xml (>= 10.0.6)
- TestPrune.Core (>= 4.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.7.0-alpha.14 | 44 | 5/5/2026 |
| 0.7.0-alpha.13 | 43 | 5/4/2026 |
| 0.7.0-alpha.12 | 49 | 4/29/2026 |
| 0.7.0-alpha.11 | 69 | 4/26/2026 |
| 0.7.0-alpha.10 | 52 | 4/25/2026 |
| 0.7.0-alpha.9 | 48 | 4/23/2026 |
| 0.7.0-alpha.8 | 55 | 4/22/2026 |
| 0.7.0-alpha.7 | 62 | 4/20/2026 |
| 0.7.0-alpha.6 | 52 | 4/20/2026 |
| 0.7.0-alpha.3 | 60 | 4/18/2026 |
| 0.7.0-alpha.2 | 70 | 4/15/2026 |
| 0.6.0-alpha.1 | 52 | 4/12/2026 |
| 0.5.0-alpha.1 | 52 | 4/12/2026 |
| 0.3.0-alpha.1 | 55 | 4/8/2026 |
| 0.2.0-alpha.1 | 65 | 4/8/2026 |
| 0.1.0-alpha.1 | 67 | 4/3/2026 |