본문으로 건너뛰기
Skillpedia
테스트5.8k · #14633

mtp-hot-reload

하는 일

이 스킬은 Microsoft Testing Platform 프로젝트에서 오래 유지되는 테스트 호스트를 설정하고 실행합니다. 처음부터 다시 시작하지 않고 코드를 편집한 뒤 테스트를 다시 실행합니다. 코드를 반복해서 고치고 실패한 테스트를 다시 실행하려는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Microsoft Testing Platform 프로젝트에서 저장할 때마다 테스트가 자동으로 다시 실행되기를 원할 때.
  • ✓실패한 테스트를 고치면서 빠른 편집과 재실행 루프를 원할 때.
  • ✓Microsoft Testing Platform을 쓰는 테스트 프로젝트에 핫 리로드를 설정하고 싶을 때.

스킬 링크

https://github.com/dotnet/skills/blob/main/plugins/dotnet-test/skills/mtp-hot-reload/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/dotnet/skills/blob/main/plugins/dotnet-test/skills/mtp-hot-reload/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“저장할 때마다 실패한 테스트를 다시 실행하도록 제 테스트 프로젝트를 설정해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트가 프로젝트의 테스트 플랫폼을 확인하고, 핫 리로드를 위해 콘솔 호스트를 설정하며, 편집하는 동안 계속 실행되도록 하는 명령을 알려 줍니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

MTP Hot Reload for Iterative Test Fixing

Set up and use a long-lived Microsoft Testing Platform host that applies code edits and automatically reruns tests.

When to Use

  • User explicitly asks for test hot reload
  • User wants a host to stay running and automatically rerun after repeated edits
  • User needs to set up MTP hot reload in their project

When Not to Use

  • User needs to write new tests from scratch (use general coding assistance)
  • User needs to diagnose why a test is failing (use diagnostic skills)
  • User asks about Visual Studio or VS Code Test Explorer hot reload or an IDE-integrated rerun experience (different feature, not MTP console-host hot reload)
  • User asks whether the editor can auto-rerun affected tests after source edits without using an MTP console host
  • User wants one normal run without rebuilding (use run-tests)
  • User needs CI/CD pipeline configuration

Inputs

Input Required Description
Test project path No Path to the test project (.csproj). Defaults to current directory.
Failing test name or filter No Specific test(s) to iterate on

Response sizing

  • If setup is already complete and the user asks only which command to use, return one dotnet run --project <path> command and one sentence explaining that it starts the persistent host. Do not repeat package, launch profile, or rude-edit guidance.
  • If the package is already installed, show only the remaining enable-and-run steps. Do not suggest reinstalling it or add optional persistence/recovery paths unless requested.
  • For a named test, identify the framework and return one runnable command with that framework's filter syntax. Never substitute MSTest/NUnit --filter for xUnit v3 --filter-method or TUnit --treenode-filter.
  • A directly launched MTP host is itself the persistent watcher: dotnet run stays alive and the HotReload extension reacts to edits. Do not replace it with dotnet watch run for the normal MTP path; reserve dotnet watch for the explicit restart fallback below.

Workflow

Step 1: Detect the platform before changing anything

Hot reload requires MTP. It does not work with VSTest.

Follow the complete evaluated-property procedure in the platform-detection skill. Read imported props and package versions as well as the project file. Do this before installing packages, editing files, or returning an MTP launch command.

Hard stop for VSTest: report that MTP hot reload is unavailable for the project as configured and stop the MTP setup path. Do not install the extension, create launchSettings.json, set the environment variable, change runner properties/packages, or return a dotnet run hot-reload command. Never turn a setup request into an implicit VSTest-to-MTP migration.

Offer one valid non-MTP fallback that preserves the project:

dotnet watch --project <project-path> test

This rebuilds and reruns the existing VSTest project when files change; it is not MTP hot reload. Offer an explicit migration as a separate option, but do not perform it unless the user asks. Exact one-shot test commands remain owned by run-tests.

Step 2: Add the hot reload NuGet package

First inspect the effective package references. If Microsoft.Testing.Extensions.HotReload is already installed, preserve its version and skip this step. Otherwise install it:

dotnet add <project-path> package Microsoft.Testing.Extensions.HotReload

Note: When using Microsoft.Testing.Platform.MSBuild (included transitively by MSTest, NUnit, and xUnit runners), the extension is auto-registered when you install its NuGet package -- no code changes needed.

Step 3: Enable hot reload

Hot reload is activated by setting the TESTINGPLATFORM_HOTRELOAD_ENABLED environment variable to 1.

Option A -- Set it in the shell before running tests:

# PowerShell
$env:TESTINGPLATFORM_HOTRELOAD_ENABLED = "1"

# bash/zsh
export TESTINGPLATFORM_HOTRELOAD_ENABLED=1

Option B -- Add it to launchSettings.json (recommended for repeatable use):

Create or update Properties/launchSettings.json in the test project:

{
  "profiles": {
    "<ProjectName>": {
      "commandName": "Project",
      "environmentVariables": {
        "TESTINGPLATFORM_HOTRELOAD_ENABLED": "1"
      }
    }
  }
}

Step 4: Run the tests with hot reload

Run the test project directly (not through `dotnet t

자주 묻는 질문

Visual Studio 테스트 탐색기에서도 되나요?

아니요. 이 스킬은 콘솔 호스트 방식을 다루며, IDE의 테스트 탐색기 핫 리로드는 다른 기능입니다.

다시 실행할 테스트를 필터링할 수 있나요?

네. 필터를 다루므로 루프를 특정 테스트에만 집중시킬 수 있습니다.

프로젝트가 VSTest를 쓰면 어떻게 하나요?

핫 리로드를 지원하지 않을 때는 프로젝트를 바꾸지 않는 대체 방법을 설명합니다.

상세 정보

작성자의 원본 설명

Set up or recover MTP hot reload for a long-lived console-host edit/re-run loop in a Microsoft Testing Platform project. Use for explicit MTP console requests such as "enable hot reload", "dotnet run to rerun on edit", or unsupported/rude edits. Covers setup, run/watch, restarts, filters, and the VSTest no-mutation fallback. For one-time runs, exact commands, filter errors, TRX/dumps, or merely a failing test, use run-tests. Do not use when Test Explorer or an IDE should rerun tests without an MTP console host. Excludes editor integration, CI, and writing/debugging tests.

repo: dotnet/skills

인기도

GitHub 스타
5.8k
순위
#14633
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬