What runs everything
Most changes select a few test classes. Some cannot be narrowed down safely, so TestDetta runs a whole test project, or every project below a folder. This page lists them all, so a wide selection never comes as a surprise.
Build-wide files
These files change how every project below them builds. A change to one of them runs every test project in its folder and below it:
| File | Runs |
|---|---|
Directory.Build.props, Directory.Build.targets, Directory.Build.rsp | Every test project below it |
Directory.Solution.props, Directory.Solution.targets | Every test project below it |
global.json, NuGet.config, .editorconfig | Every test project below it |
Directory.Packages.props, only PackageVersion items changed | Only the test projects that reference a changed package, and those that depend on them |
A changed source generator, for a test project that has no coverage map, builds without a portable PDB, or was recorded with -f for one of several frameworks while the tests run for another one or for all of them (run them with the same -f, or record without it) | What it generates is compared from a build, and here there is nothing to compare. Otherwise only the generated code that changed counts. |
A changed project referenced with ReferenceOutputAssembly="false", when the referencing project's build turns its output into code it compiles, or the test project's map does not record which tests start or load it (a map that saw the output loaded by code it could not attribute, such as a third-party plugin host), or the test project targets several frameworks and its map holds the build of only one of the frameworks the tests run for (recorded with -f; record without it, or run the tests with the same -f) | Otherwise only the test classes that started it as a process or loaded it while the map was recorded run, and a reference only for build order runs nothing. |
Changes that run a whole test project
| Change | Why it cannot be narrowed |
|---|---|
The project file, or a .props or .targets file it imports | It can change how anything in the project builds. |
A file in the project that is not C#, Visual Basic or F# source and that the build uses, such as a copied appsettings.json, a .resx, a .proto or an F# signature file (.fsi). With --non-code-files project, any file in the project that is not code | It changes what the build produces. Files the build does not use run only their readers (below). |
A global using or an assembly attribute | It applies to every file. |
| A C# change in code no declaration covers, for example under a preprocessor condition | There is no member to follow. |
| A changed type that nothing names, but that a framework could discover through reflection (controllers, message handlers, EF configurations) | Names and coverage cannot tell who finds it. When the type is in a project your test project references directly and loads at run time (a plugin), only the test classes that loaded that project's output run: with ReferenceOutputAssembly="false", or with a normal reference when no code outside the project names any of its types (a plugin referenced only so the build copies it). When the coverage maps can answer, the project does not run completely either: for a change to a method or constructor body that keeps its signature, attributes and defaults, or a change that reaches the type only through its code, the classes the maps saw run any of its members run instead. That holds when every affected test project with a map below the type recorded it, and none of its members ran outside a test, in a static constructor or a cache fill, or was called back by a third-party library. |
| A project used as an analyzer or source generator, when what it generates cannot be compared (see the table above) | Its effect is on compilation, not on calls. |
Each of these also runs every test project that depends on the one affected.
Files in a project that the build does not use
A README.md, a CHANGELOG.md or a data file the tests read from the source tree changes no build output. Under the default --non-code-files readers, a change to such a file runs only the test classes that read it while the coverage map was recorded, in any test project; a read outside any test, in a fixture's setup or while initializing something the tests share runs that test project completely, and a file no recorded test read runs nothing. A file counts as unused by the build when MSBuild lists it as a None item without CopyToOutputDirectory and no build item type (Compile, EmbeddedResource, Content, AdditionalFiles, Protobuf, the Razor, Avalonia, TypeScript, WPF, MAUI, Android and Apple items) lists it, it is not an app.config or web.config, nor, in a project that uses the Razor SDK, a None item ending in .css, .js, .mjs, .scss or .less (scoped styles and JavaScript modules the SDK builds), and no MSBuild file of the repository names it outside comments and package metadata, includes it in an item of another type, or has a target that walks every None item.
Reads are recorded in your own code and in the libraries your tests use, a snapshot library reading its .verified files for example. A test project still runs completely for such a file when it has no map, or its map was recorded before TestDetta recorded the reads of libraries, or a library could not be rewritten to show its reads (the output names it).
Your MSBuild files are also scanned for item patterns a target could fill with a file. Documentation files (README, CHANGELOG, LICENSE, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT, CLAUDE.md, AGENTS.md and the like) and the files you name with --not-build-inputs (action input not-build-inputs) skip that guess: they count as build inputs only when MSBuild itself builds, embeds or copies them, or a target in your MSBuild files names them. Targets that make items from other items or from a property alone, as signing and packaging targets do, would otherwise make every changelog entry run every test project. The output lists the changed files this rule covers.
What this cannot see: a file read by native code, by a program that is not .NET, or through a .NET API outside the recorded list (ZipFile.OpenRead, an X509Certificate2 from a path); and a build step of an SDK or a package that processes files under an item type of its own that is not in the list above, or a target that takes a documentation file in through a pattern without naming it. If your build or tests use files that way, choose --non-code-files project (action input non-code-files: project): every non-code file then runs its project and the projects depending on it, as before.
Coverage map situations
- An older map and build changes in between. When the map is a few commits older than your merge base and a build file or a configuration file changed in between, the affected test projects run completely.
--drift-fallback namedecides them by name instead. See the drift bridge. - Every class selected. A project whose classes are all selected runs without a filter.
- A filter that matches nothing. The project runs again without the filter, and TestDetta treats it as its own bug.
No map at all does not run everything: selection falls back to tracing by name, which is wider than coverage but still narrow.
Files outside every project
A changed file outside every project folder, such as README.md, files under .github/ or test data at the root of the repository, belongs to no project. If a test read it by a path while the coverage map was recorded, a change to it, or a new file in a folder a test listed, runs the test classes that read it. A read outside any test, in a fixture's setup or while initializing something the tests share runs the whole test project. A file no recorded test read selects nothing. The output counts these files as read by recorded tests or read by none.
Reads are recorded in your own code and in the libraries your tests use, and only in coverage maps recorded by a version that records them. A file read in a way TestDetta cannot see (native code, a program that is not .NET) is safest listed as an item of the test project, for example <None Include="..\..\testdata\**" CopyToOutputDirectory="PreserveNewest" />. Then the file belongs to the project wherever it lives, and changing or deleting it runs the project.
One exception: a source or build file that no project claims (.cs, .fs, .vb, .props, .targets, .projitems) counts as a build input of every project whose imports could not be fully resolved, so those run.