-
Notifications
You must be signed in to change notification settings - Fork 346
Replace SettingsMigrator tool with a Copilot skill and remove all code #15537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,237 @@ | ||||||
| --- | ||||||
| name: settings-migration | ||||||
| description: Migrate legacy Visual Studio .testsettings files to .runsettings format. Use when users need to convert old test configuration files, understand the mapping between formats, or troubleshoot migration issues. Replaces the deprecated SettingsMigrator.exe tool. | ||||||
| --- | ||||||
|
|
||||||
| # Migrating .testsettings to .runsettings | ||||||
|
|
||||||
| This skill replaces the deprecated `SettingsMigrator.exe` tool. It covers migrating legacy `.testsettings` files (and `.runsettings` files with embedded `.testsettings` references) to the modern `.runsettings` format. | ||||||
|
|
||||||
| ## Background | ||||||
|
|
||||||
| Visual Studio historically used `.testsettings` files for test configuration. The modern format is `.runsettings`. The two formats differ in structure, and some `.testsettings` nodes map to `<LegacySettings>` wrappers in `.runsettings` to preserve backward compatibility. | ||||||
|
|
||||||
| See also: [RFC 0023 - TestSettings Deprecation](../../docs/RFCs/0023-TestSettings-Deprecation.md) | ||||||
|
|
||||||
| ## When to Use | ||||||
|
|
||||||
| - User has a `.testsettings` file and needs a `.runsettings` file | ||||||
| - User has a `.runsettings` with an `<MSTest><SettingsFile>path.testsettings</SettingsFile></MSTest>` embedded reference | ||||||
| - User asks about migrating test settings, test configuration formats, or legacy settings | ||||||
|
|
||||||
| ## Step-by-Step Migration | ||||||
|
|
||||||
| ### Step 1: Identify the Source File Type | ||||||
|
|
||||||
| Check the file extension: | ||||||
| - **`.testsettings`** → Go to [Migrate from .testsettings](#migrate-from-testsettings) | ||||||
| - **`.runsettings` with embedded settings** → Go to [Migrate embedded .testsettings](#migrate-embedded-testsettings-from-runsettings) | ||||||
|
|
||||||
| To check for embedded settings in a `.runsettings` file, look for: | ||||||
| ```xml | ||||||
| <RunSettings> | ||||||
| <MSTest> | ||||||
| <SettingsFile>path\to\file.testsettings</SettingsFile> | ||||||
| </MSTest> | ||||||
| </RunSettings> | ||||||
| ``` | ||||||
|
|
||||||
| ### Step 2: Read the .testsettings File | ||||||
|
|
||||||
| Parse the `.testsettings` XML and extract these nodes (all are optional): | ||||||
|
|
||||||
| | XPath in .testsettings | Node Name | Purpose | | ||||||
| |---|---|---| | ||||||
| | `/TestSettings/Deployment` | Deployment | File deployment settings | | ||||||
| | `/TestSettings/Scripts` | Scripts | Setup/cleanup scripts | | ||||||
| | `/TestSettings/Execution/TestTypeSpecific/WebTestRunConfiguration` | WebSettings | Web test configuration | | ||||||
| | `/TestSettings/Execution/AgentRule/DataCollectors/DataCollector` | DataCollectors | Data collector definitions | | ||||||
| | `/TestSettings/Execution/Timeouts` | Timeouts | Timeout attributes | | ||||||
| | `/TestSettings/Execution/TestTypeSpecific/UnitTestRunConfig` | UnitTestConfig | Unit test run configuration | | ||||||
| | `/TestSettings/Execution/Hosts` | Hosts | Host configuration | | ||||||
| | `/TestSettings/Execution` | Execution | Execution attributes (parallelTestCount, hostProcessPlatform) | | ||||||
|
Comment on lines
+43
to
+52
|
||||||
|
|
||||||
| ### Step 3: Build the .runsettings Output | ||||||
|
|
||||||
| Start with a minimal `.runsettings` skeleton: | ||||||
|
|
||||||
| ```xml | ||||||
| <?xml version="1.0" encoding="utf-8"?> | ||||||
| <RunSettings> | ||||||
| </RunSettings> | ||||||
| ``` | ||||||
|
|
||||||
| Then apply each mapping rule below. | ||||||
|
|
||||||
| #### 3a. WebTestRunConfiguration (top-level) | ||||||
|
|
||||||
| If the `.testsettings` has a `WebTestRunConfiguration` node, copy it directly as a child of `<RunSettings>`: | ||||||
|
|
||||||
| ```xml | ||||||
| <RunSettings> | ||||||
| <WebTestRunConfiguration> | ||||||
| <!-- copied from .testsettings as-is --> | ||||||
| </WebTestRunConfiguration> | ||||||
| </RunSettings> | ||||||
| ``` | ||||||
|
|
||||||
| #### 3b. LegacySettings Node | ||||||
|
|
||||||
| If **any** of these are present: `Deployment`, `Scripts`, `UnitTestConfig`, `Hosts`, `parallelTestCount`, `testTimeout`, or `hostProcessPlatform`, create a `<LegacySettings>` node and also set `<MSTest><ForcedLegacyMode>true</ForcedLegacyMode></MSTest>`: | ||||||
|
||||||
|
|
||||||
| ```xml | ||||||
| <RunSettings> | ||||||
| <LegacySettings> | ||||||
| <!-- Deployment node (copied as-is) --> | ||||||
| <Deployment ... /> | ||||||
|
|
||||||
| <!-- Scripts node (copied as-is) --> | ||||||
| <Scripts ... /> | ||||||
|
|
||||||
| <!-- Execution node (built from parts) --> | ||||||
| <Execution parallelTestCount="N" hostProcessPlatform="X"> | ||||||
| <Timeouts testTimeout="M" /> | ||||||
| <Hosts>...</Hosts> | ||||||
| <TestTypeSpecific> | ||||||
| <UnitTestRunConfig>...</UnitTestRunConfig> | ||||||
| </TestTypeSpecific> | ||||||
| </Execution> | ||||||
| </LegacySettings> | ||||||
|
|
||||||
| <MSTest> | ||||||
| <ForcedLegacyMode>true</ForcedLegacyMode> | ||||||
| </MSTest> | ||||||
| </RunSettings> | ||||||
| ``` | ||||||
|
|
||||||
| **Rules for the Execution sub-node:** | ||||||
| - Only create `<Execution>` if at least one of `UnitTestConfig`, `parallelTestCount`, `testTimeout`, `Hosts` is present | ||||||
|
||||||
| - Only create `<Execution>` if at least one of `UnitTestConfig`, `parallelTestCount`, `testTimeout`, `Hosts` is present | |
| - Only create `<Execution>` if at least one of `UnitTestConfig`, `parallelTestCount`, `testTimeout`, `Hosts`, or `hostProcessPlatform` is present |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The relative link likely points to
.github/docs/...rather than the repo-leveldocs/...because this file lives under.github/skills/settings-migration/. Update the relative path (e.g., one more..) so the RFC link resolves correctly on GitHub.