FsHotWatch.TestPrune 0.2.0-alpha.1

This is a prerelease version of FsHotWatch.TestPrune.
dotnet add package FsHotWatch.TestPrune --version 0.2.0-alpha.1
                    
NuGet\Install-Package FsHotWatch.TestPrune -Version 0.2.0-alpha.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FsHotWatch.TestPrune" Version="0.2.0-alpha.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FsHotWatch.TestPrune" Version="0.2.0-alpha.1" />
                    
Directory.Packages.props
<PackageReference Include="FsHotWatch.TestPrune" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FsHotWatch.TestPrune --version 0.2.0-alpha.1
                    
#r "nuget: FsHotWatch.TestPrune, 0.2.0-alpha.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FsHotWatch.TestPrune@0.2.0-alpha.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FsHotWatch.TestPrune&version=0.2.0-alpha.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=FsHotWatch.TestPrune&version=0.2.0-alpha.1&prerelease
                    
Install as a Cake Tool

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

  1. You save a file
  2. TestPrune receives FileChecked with the warm compiler's results
  3. It analyzes which symbols changed
  4. It looks up which test classes reference those symbols
  5. If testConfigs are provided, it runs only the affected tests
  6. It emits TestCompleted for 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

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                      // coverage args
        None                      // coverage args generator
        None                      // getCommitId for caching
)

Install

dotnet add package FsHotWatch.TestPrune
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.2.0-alpha.1 0 4/8/2026
0.1.0-alpha.1 43 4/3/2026