incremental-test

Builds modified .NET SDK projects incrementally and runs dotnet.Tests against updated redist outputs.

1.2k|337|Updated Oct 13, 2022
One-click install
npx skills add https://github.com/dotnet/dotnet --skill incremental-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: incremental-test
Source: https://github.com/dotnet/dotnet/tree/main/src/sdk/.github/skills/incremental-test
Command: npx skills add https://github.com/dotnet/dotnet --skill incremental-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Running the full build.cmd rebuild after every small source change in the .NET SDK is slow. This Skill lets you rebuild only the modified projects, copy their output DLLs into the existing redist SDK layout, and run the affected dotnet.Tests immediately.

Core Features & Use Cases

  • Incremental Project Builds: Builds only the modified .csproj projects using the repo-local .dotnet SDK instead of a full product rebuild.
  • Redist Layout Deployment: Copies updated DLLs (including dotnet.dll and localization satellite assemblies) into artifacts\bin\redist\Debug\dotnet\sdk<version>\ so tests run against your changes.
  • Targeted Test Execution: Delegates to the run-tests skill to execute filtered tests from test\dotnet.Tests\dotnet.Tests.csproj with TRX and binlog output.
  • Use Case: After editing Microsoft.DotNet.Cli.Utils, rebuild just that project, copy its DLL into the redist SDK directory, and run only the affected dotnet.Tests filter to verify the fix in minutes.

Quick Start

Rebuild my modified SDK projects incrementally and run the affected dotnet.Tests without a full build.

Frequently Asked Questions about incremental-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run dotnet.Tests without a full SDK rebuild?

Build only the modified projects with the repo-local .dotnet\dotnet build command, copy the output DLLs into artifacts\bin\redist\Debug\dotnet\sdk\<version>\, then run the test project with a filter. This avoids the full build.cmd rebuild cycle.

How to test changes to the dotnet CLI project quickly?

Build src\Cli\dotnet\dotnet.csproj with the repo-local SDK, then copy artifacts\bin\dotnet\Debug\net10.0\dotnet.dll into the redist SDK directory. After that, run the relevant dotnet.Tests filter to validate your change.

Does incremental testing work on macOS or Linux?

Yes, but the documented commands use Windows PowerShell paths. On macOS or Linux, substitute forward slashes and use cp instead of Copy-Item, and run ./restore.sh instead of restore.cmd if the SDK is out of date.

Why does the incremental test build fail with a missing framework error?

This happens when the repo-local .dotnet SDK version does not match what the test projects expect. Run restore.cmd on Windows or ./restore.sh on macOS/Linux to download the correct SDK into the .dotnet directory.

When is a full build required instead of incremental testing?

A full build.cmd or build.sh is required when your change introduces a new shipped assembly, moves assemblies between locations, or when no prior full build exists to create the redist SDK layout. Incremental copying only works for DLLs already present in the target directory.