Infra, Ops & WorkflowSûr100100/100
Incremental Test (.NET)
Run dotnet.Tests incrementally without a full build.cmd rebuild. Use after modifying source code in SDK projects to quickly build only changed projects, deploy their outputs into the redist SDK layout, and run tests against them.
ou envoie-le directement à ton agent.
Installer dans ton projet
$ curl -fsSL https://arboristhree.xyz/cli/install-skill.mjs -o /tmp/arboris-install-skill.mjs && node /tmp/arboris-install-skill.mjs incremental-test__dotnet-dotnet__src-sdk-github-skills-693badb47dc3.NET
dotnet/dotnet
Contenu à copier
--- name: incremental-test description: >- Run dotnet.Tests incrementally without a full build.cmd rebuild. Use after modifying source code in SDK projects to quickly build only changed projects, deploy their outputs into the redist SDK layout, and run tests against them. metadata: origin: .NET --- # Incremental Test Runner for dotnet.Tests ## Prerequisites - A full build must have been completed at least once (via `build.cmd` or `build.sh`) so that the redist SDK layout exists at `artifacts\bin\redist\Debug\dotnet\sdk\<version>\`. - The repo-local `.dotnet` SDK must match the version expected by the test projects. If the runtime or SDK version is out of date (e.g., test build fails with a missing framework error), run `.\restore.cmd` (or `./restore.sh` on macOS/Linux) to download the correct SDK into `.dotnet`. - This workflow uses Windows/PowerShell commands and paths. On macOS/Linux, substitute forward slashes and use `cp` instead of `Copy-Item`. ## Workflow ### Step 1: Identify modified projects Determine which projects have been modified. Use context from: - The files you just edited in this session. - Or `git status`/`git diff` to find changed `.cs` files and map them to their `.csproj` projects. ### Step 2: Build modified projects Build each modified project individually using the repo-local dotnet: ``` .\.dotnet\dotnet build <path-to-project.csproj> -c Debug ``` For example: ``` .\.dotnet\dotnet build src\Cli\Microsoft.DotNet.Cli.Utils\Microsoft.DotNet.Cli.Utils.csproj -c Debug ``` If the `dotnet` CLI project itself was modified, build it: ``` .\.dotnet\dotnet build src\Cli\dotnet\dotnet.csproj -c Debug ``` ### Step 3: Copy output DLLs to the redist SDK layout Discover the SDK version directory name: ```powershell $sdkVersion = (Get-ChildItem artifacts\bin\redist\Debug\dotnet\sdk -Directory | Sort-Object LastWriteTime -Descending | Select-Object -First 1).Name ``` For each modified project, copy its output DLL (and any satellite assemblies) from the project's build output to the redist SDK directory: ``` Source: artifacts\bin\<ProjectName>\Debug\net10.0\<AssemblyName>.dll Target: artifacts\bin\redist\Debug\dotnet\sdk\<version>\ ``` For example: ```powershell Copy-Item artifacts\bin\Microsoft.DotNet.ProjectTools\Debug\net10.0\Microsoft.DotNet.ProjectTools.dll artifacts\bin\redist\Debug\dotnet\sdk\$sdkVersion\ Copy-Item artifacts\bin\Microsoft.DotNet.Cli.Utils\Debug\net10.0\Microsoft.DotNet.Cli.Utils.dll artifacts\bin\redist\Debug\dotnet\sdk\$sdkVersion\ ``` The `dotnet` project is special — it builds into `artifacts\bin\dotnet\Debug\net10.0\` and its `dotnet.dll` must be copied to the SDK directory: ```powershell Copy-Item artifacts\bin\dotnet\Debug\net10.0\dotnet.dll artifacts\bin\redist\Debug\dotnet\sdk\$sdkVersion\ ``` **Important notes:** - For typical incremental edits, only copy DLLs that are **already present** in the target directory. If your change introduces a new shipped assembly or moves assemblies, you will need a full `build.cmd`/`build.sh` to update the layout correctly. - Some projects multi-target (e.g., `net10.0` and `net472`). Always use the `net10.0` output. - If localization resource DLLs were changed (in subdirectories like `cs\`, `de\`, etc.), copy those too. ### Step 4: Run the tests Invoke the [`run-tests`](../run-tests/SKILL.md) skill for `test/dotnet.Tests/dotnet.Tests.csproj` with a filter for the affected tests. It builds the test project incrementally and retains detailed output, a TRX, and a binlog. ## Common project paths | Assembly | Project Path | |---|---| | `dotnet.dll` | `src\Cli\dotnet\dotnet.csproj` | | `Microsoft.DotNet.Cli.Utils.dll` | `src\Cli\Microsoft.DotNet.Cli.Utils\Microsoft.DotNet.Cli.Utils.csproj` | | `Microsoft.DotNet.Cli.Definitions.dll` | `src\Cli\Microsoft.DotNet.Cli.Definitions\Microsoft.DotNet.Cli.Definitions.csproj` | | `Microsoft.DotNet.Cli.CoreUtils.dll` | `src\Cli\Microsoft.DotNet.Cli.CoreUtils\Microsoft.DotNet.Cli.CoreUtils.csproj` | | `Microsoft.DotNet.Configurer.dll` | `src\Cli\Microsoft.DotNet.Configurer\Microsoft.DotNet.Configurer.csproj` | | `Microsoft.DotNet.ProjectTools.dll` | `src\Microsoft.DotNet.ProjectTools\Microsoft.DotNet.ProjectTools.csproj` | | `Microsoft.DotNet.NativeWrapper.dll` | `src\Resolvers\Microsoft.DotNet.NativeWrapper\Microsoft.DotNet.NativeWrapper.csproj` | | `Microsoft.DotNet.TemplateLocator.dll` | `src\Microsoft.DotNet.TemplateLocator\Microsoft.DotNet.TemplateLocator.csproj` | | `Microsoft.DotNet.InternalAbstractions.dll` | `src\Cli\Microsoft.DotNet.InternalAbstractions\Microsoft.DotNet.InternalAbstractions.csproj` | | `dotnet.Tests.dll` | `test\dotnet.Tests\dotnet.Tests.csproj` |
Colle ce Markdown dans ton agent ou utilise les boutons ci-dessus pour l’écrire dans ton projet.
Ce que fait Incremental Test (.NET)
A full build must have been completed at least once (via `build.cmd` or `build.sh`) so that the redist SDK layout exists at `artifacts\bin\redist\Debug\dotnet\sdk\<version>\`.
The repo-local `.dotnet` SDK must match the version expected by the test projects. If the runtime or SDK version is out of date (e.g., test build fails with a missing framework error), run `.\restore.cmd` (or `./restore.sh` on macOS/Linux) to download the correct SDK into `.dotnet`.
This workflow uses Windows/PowerShell commands and paths. On macOS/Linux, substitute forward slashes and use `cp` instead of `Copy-Item`.
The files you just edited in this session.
Comment utiliser Incremental Test (.NET)
1
Copie le prompt
Un clic copie le prompt packagé (ou l'envoie à ton agent).
2
L'agent installe le skill
Il ajoute le SKILL.md et ses ressources à ton projet.
3
Activation automatique
Le skill s'active dès que le contexte correspond.
Déclencheurs pour Incremental Test (.NET)
Dis simplement à ton agent quelque chose comme :
Applique le skill incremental-test__dotnet-dotnet__src-sdk-github-skills-693badb47dc3 à cette tâche
Utilise incremental-test__dotnet-dotnet__src-sdk-github-skills-693badb47dc3 pour améliorer cette implémentation
Passe en revue ce sujet avec incremental-test__dotnet-dotnet__src-sdk-github-skills-693badb47dc3
Skills liés à Incremental Test (.NET)
Add CLI Command (.NET)
Add or change a dotnet CLI command, subcommand, or option across the relevant CLI projects. USE FOR: adding or changing a dotnet CLI command/subcommand, adding a new Option<T> or Argument<T>, registering a subcommand in the command tree, changing an option's help description or a command's runtime message, wiring a command parser, or updating --help output.Add Dotnet Aot Command (.NET)
Add, enable, or review a dotnet CLI command or feature in the Native AOT CLI (src/Cli/dotnet-aot) and prove its compatibility. USE FOR: migrating a command or option to AOT, reviewing an AOT migration PR, defining conservative eligibility and managed fallback, changing AotSourceFiles.props or AotDependencies.props, validating AOT/managed parity, NativeAOT-publishing tests, checking binary-size impact, or using the dn harness and separated SDK layout. DO NOT USE FOR: resolving IL trim/AOT analyzer warnings alone (use dotnet-aot-compat), running dotnet.Tests incrementally (use incremental-test), or pure managed CLI work.Add Net Analyzer (.NET)
Add, port, or change a .NET code analysis rule (CA####) under src/Microsoft.CodeAnalysis.NetAnalyzers. USE FOR: implementing a new CA analyzer and its code fixer, porting a rule or PR from the retired dotnet/roslyn-analyzers repo, allocating a diagnostic ID from DiagnosticCategoryAndIdRanges.txt, choosing RuleLevel/severity/category, wiring resx + xlf strings, recording the rule in AnalyzerReleases.Unshipped.md, regenerating the analyzer documentation/sarif files, and writing MSTest analyzer/code-fix tests with the VerifyCS/VerifyVB harness. DO NOT USE FOR: NETSDK#### MSBuild diagnostics (src/Tasks), CS####/BC#### compiler diagnostics or IDE#### analyzers (dotnet/roslyn), or CONTAINER#### diagnostics (src/Containers).