Fix migrate-mstest-v1v2-to-v3 skill activation

The frontmatter description said DO NOT USE FOR: ... projects already on
MSTest v3+, which blocked the skill on every scenario where the packages had
already been bumped to 3.x and only the source or settings still needed the
v1/v2-to-v3 fixes (Assert object overloads, DataRow strict typing,
.testsettings -> .runsettings). It also gated the whole skill behind "the user
asks to upgrade MSTest", so a standalone .testsettings conversion never matched.

- Rewrite the description around both entry points (pre-upgrade migration and
  post-upgrade breaking-change fixes) and add the concrete trigger keywords
  those prompts contain: CS1501/CS1503/CS0121, MSTEST0014, LegacySettings,
  DeploymentEnabled, per-test TestTimeout, net5.0. Note that the current runner
  is preserved so "migrate to v3 but keep VSTest" isn't poached by
  migrate-vstest-to-mtp.
- Narrow migrate-mstest-v3-to-v4, which claimed the generic "tests don't
  compile after upgrading MSTest" phrasing and competed for the same prompts.
- Widen the Boundary Gate: a 3.x package version alone no longer ends the
  migration when v1/v2-era settings or errors remain, so the skill actually
  performs the requested edits instead of reporting "already migrated".
- Add a routing row to the test-migration agent for the same case.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ad6ff32a-d441-4a7b-b474-2bfaee764740
This commit is contained in:
Copilot App
2026-07-30 19:35:51 +02:00
parent 2c22b6c815
commit f9dc25daac
3 changed files with 35 additions and 29 deletions
@@ -46,7 +46,8 @@ Classify the user's request and route to the appropriate skill or agent:
| User Intent | Route To |
|---|---|
| "Upgrade MSTest" / "migrate MSTest" (v1/v2 detected) | `migrate-mstest-v1v2-to-v3` skill |
| "Upgrade MSTest" / "latest MSTest" (v3 detected) | `migrate-mstest-v3-to-v4` skill |
| "Upgrade MSTest" / "latest MSTest" (v3 detected, project otherwise clean) | `migrate-mstest-v3-to-v4` skill |
| Build/test errors or leftover `.testsettings` after a 2.x-to-3.x package bump (packages already read 3.x) | `migrate-mstest-v1v2-to-v3` skill |
| "Upgrade MSTest" (v1/v2 detected, user wants v4) | `migrate-mstest-v1v2-to-v3` first, then `migrate-mstest-v3-to-v4` |
| "Migrate to xUnit v3" / "upgrade xUnit" | `migrate-xunit-to-xunit-v3` skill |
| "Convert xUnit to MSTest" / "switch from xUnit to MSTest" / "port xUnit tests to MSTest" (xUnit v2 or v3 detected) | `migrate-xunit-to-mstest` skill |
@@ -1,21 +1,22 @@
---
name: migrate-mstest-v1v2-to-v3
description: >
Migrate MSTest v1 or v2 test projects to MSTest v3. Use when the user asks
to upgrade MSTest and the project has QualityTools assembly references,
MSTest.TestFramework/TestAdapter 1.x-2.x, .testsettings, or migration errors
after changing those packages to 3.x.
USE FOR: upgrading from MSTest v1 assembly references
(Microsoft.VisualStudio.QualityTools.UnitTestFramework) or MSTest v2 NuGet
(MSTest.TestFramework 1.x-2.x) to MSTest v3, fixing assertion overload
errors (AreEqual/AreNotEqual), updating DataRow constructors, replacing or
migrating .testsettings to .runsettings, timeout behavior changes, target framework
compatibility (.NET 5 dropped -- use .NET 6+; .NET Fx older than 4.6.2 dropped),
adopting MSTest.Sdk while moving from v1/v2.
First step toward MSTest v4 -- after this, use migrate-mstest-v3-to-v4.
DO NOT USE FOR: migrating to MSTest v4 (use migrate-mstest-v3-to-v4),
projects already on MSTest v3+, migrating between test frameworks, generic
test modernization, or .NET upgrades unrelated to MSTest.
Migrate MSTest v1/v2 projects to MSTest v3, and fix v1/v2-to-v3 breaking
changes that surface after the packages are already at 3.x.
USE FOR: removing v1
Microsoft.VisualStudio.QualityTools.UnitTestFramework assembly references;
moving MSTest.TestFramework/TestAdapter 1.x-2.x to 3.x, the MSTest
metapackage, or MSTest.Sdk; tests that stopped compiling after a 2.x-to-3.x
bump -- CS1501/CS1503/CS0121 on Assert.AreEqual/AreNotEqual/AreSame object
overloads, DataRow strict type matching (1L vs 1), MSTEST0014, 16+ DataRow
arguments; converting .testsettings/LegacySettings to .runsettings
(DeploymentEnabled, per-test MSTest TestTimeout); v3 timeout behavior; TFMs
v3 dropped (net5.0, .NET Fx below 4.6.2, netstandard1.0). Applies even when
the project already references MSTest 3.x, if a v1/v2-era setting or error
remains. Keeps the current runner.
DO NOT USE FOR: MSTest v4 (use migrate-mstest-v3-to-v4 next), clean v3
projects with no v1/v2 leftovers, converting between test frameworks, or
VSTest-to-MTP migration.
license: MIT
---
@@ -27,22 +28,25 @@ Migrate a test project from MSTest v1 (assembly references) or MSTest v2 (NuGet
- Project references `Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll` (MSTest v1)
- Project uses `MSTest.TestFramework` / `MSTest.TestAdapter` NuGet 1.x or 2.x
- Resolving build errors after updating MSTest packages from v1/v2 to v3
- Resolving build errors after updating MSTest packages from v1/v2 to v3 -- including when the packages already read 3.x and only the source or settings still need fixing
- Replacing `.testsettings` with `.runsettings`
- Adopting MSTest.Sdk or in-assembly parallel execution
## When Not to Use
- Project already on MSTest v3 with no migration-related build errors (fully migrated)
- Project already on MSTest v3 with no migration-related build errors and no leftover `.testsettings` / `<LegacySettings>` (fully migrated)
- Upgrading v3 to v4 -- use `migrate-mstest-v3-to-v4`
- Migrating between frameworks (MSTest to xUnit/NUnit)
## Boundary Gate
Check package versions before any edit. If all MSTest references are already 3.x
and no v1/v2-to-v3 error is reported, state that migration is complete and make
no changes. Do not consolidate working v3 packages into the metapackage. Run the
existing tests only if verification was requested. This overrides all steps below.
Check package versions before any edit. If all MSTest references are already 3.x,
no v1/v2-to-v3 error is reported, and no `.testsettings` or `<LegacySettings>`
remains, state that migration is complete and make no changes. A 3.x package
version alone does not end the migration -- leftover v1/v2-era settings files or
breaking-change errors are still in scope. Do not consolidate working v3 packages
into the metapackage. Run the existing tests only if verification was requested.
This overrides all steps below.
## Inputs
@@ -1,19 +1,20 @@
---
name: migrate-mstest-v3-to-v4
description: >
Fix build errors and breaking changes after upgrading MSTest from v3 to v4,
or plan a complete MSTest v3-to-v4 migration. Use when user says "upgrade to
Fix build errors and breaking changes after upgrading MSTest v3 to v4, or
plan a complete v3-to-v4 migration. Use when user says "upgrade to
MSTest v4", "MSTest 4 migration", "MSTest v4 breaking changes", "tests don't
compile after upgrading MSTest", or has errors CS0507, CS0103, CS1061, CS1615 after updating MSTest packages from 3.x to 4.x.
USE FOR: Execute to ExecuteAsync, CallerInfo constructor on TestMethodAttribute,
compile after upgrading MSTest 3.x to 4.x", or hits CS0507, CS0103, CS1061, CS1615 after updating MSTest packages to 4.x.
USE FOR: Execute to ExecuteAsync, CallerInfo ctor on TestMethodAttribute,
sealed custom attributes, ClassCleanupBehavior removal, TestContext.Properties
Contains to ContainsKey, Assert.ThrowsException to ThrowsExactly,
Assert.IsInstanceOfType out parameter removal, ExpectedExceptionAttribute
Assert.IsInstanceOfType out param removal, ExpectedExceptionAttribute
removal, TestTimeout enum removal, [TestMethod("name")] to DisplayName syntax,
TreatDiscoveryWarningsAsErrors, TestContext.TestName in ClassInitialize,
MSTest.Sdk MTP changes, dropped TFMs (net6.0/net7.0 to net8.0+).
DO NOT USE FOR: migrating from MSTest v1/v2 to v3 (use migrate-mstest-v1v2-to-v3
first), migrating between test frameworks, or general .NET upgrades.
DO NOT USE FOR: MSTest v1/v2 to v3, or errors left from a 2.x-to-3.x upgrade
(use migrate-mstest-v1v2-to-v3 first); test framework conversions; general
.NET upgrades.
license: MIT
---