Infra, Ops & WorkflowSûr100100/100

Run Toolset Tests (.NET)

Run the razor-toolset-ci pipeline to validate the current branch against large third-party repositories (MudBlazor, OrchardCore, ASP.NET Core, etc.). Use when asked to run toolset tests, ecosystem tests, or third-party validation.

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 run-toolset-tests__dotnet-dotnet__src-roslyn-github-skills-6dbac8e049bb
.NET
dotnet/dotnet
Contenu à copier
---
name: run-toolset-tests
description: >-
  Run the razor-toolset-ci pipeline to validate the current branch against large
  third-party repositories (MudBlazor, OrchardCore, ASP.NET Core, etc.).
  Use when asked to run toolset tests, ecosystem tests, or third-party validation.
metadata:
  origin: .NET
---

# Run Razor Toolset Tests

Pushes the current branch to `dotnet/roslyn` on GitHub and triggers the
[`razor-toolset-ci`](https://dev.azure.com/dnceng/internal/_build?definitionId=1270)
Azure DevOps pipeline (definition 1270, project `internal`) to build the Razor
compiler toolset and validate it against large third-party projects.

## Background

The pipeline lives in the [`razor-toolset-tests`](https://dev.azure.com/dnceng/internal/_git/razor-toolset-tests)
repo in `dnceng/internal`. It:

1. Builds `Microsoft.Net.Compilers.Razor.Toolset` from the merged Roslyn repo
2. Injects it (plus the matching Roslyn toolset) into 11 third-party projects
3. Builds each project to verify compatibility

Projects tested: MudBlazor, Havit.Blazor, Telerik Blazor UI, OrchardCore,
GrandNode2, Damselfly, Hawaso, dotnet-podcasts, and ASP.NET Core
(MVC, Razor Pages, Blazor components).

**Important:** When manually triggered, the pipeline checks out from the
`RazorGitHubRepo` resource (`github.com/dotnet/roslyn`). The commit must be
pushed to `dotnet/roslyn` — commits on forks or the internal ADO mirror are
not accessible for manual runs.

## Steps

### 1. Verify prerequisites

- Confirm we're in the merged Roslyn repository (look for `src/Razor/src/Compiler` or check git remotes).
- Get the current commit SHA: `git rev-parse HEAD`
- Get the current branch name: `git branch --show-current`
  (if HEAD is detached, use `git rev-parse --short HEAD` as the name)

### 2. Find or configure a remote for `dotnet/roslyn`

- Run `git remote -v` and look for a remote whose URL contains `dotnet/roslyn`.
- Common remote names: `upstream`, `dotnet`.
- If no such remote exists, add one:
  ```
  git remote add dotnet https://github.com/dotnet/roslyn.git
  ```
- Store the remote name for subsequent steps.

### 3. Push to GitHub

Push current HEAD to a test branch on `dotnet/roslyn`:

```
git push <remote> HEAD:refs/heads/toolset-test/<branch-name> --force
```

If the branch name is empty (detached HEAD), use the short SHA instead.

If the push fails with a permission error, inform the user they need push access
to `dotnet/roslyn`.

### 4. Trigger the pipeline

Use the `ado-pipelines_run_pipeline` MCP tool:

- `project`: `"internal"`
- `pipelineId`: `1270`
- `resources`:
  ```json
  {
    "pipelines": {},
    "repositories": {
      "RazorGitHubRepo": {
        "refName": "refs/heads/toolset-test/<branch-name>",
        "version": "<commit-sha>"
      }
    }
  }
  ```

If the MCP tool fails, fall back to the REST API via PowerShell:

```powershell
$body = @{
    resources = @{
        repositories = @{
            RazorGitHubRepo = @{
                refName = "refs/heads/toolset-test/<branch-name>"
                version = "<commit-sha>"
            }
        }
    }
} | ConvertTo-Json -Depth 5

az devops configure --defaults organization=https://dev.azure.com/dnceng project=internal
$result = az rest --method post `
    --uri "https://dev.azure.com/dnceng/internal/_apis/pipelines/1270/runs?api-version=7.1" `
    --body "$body" `
    --resource "499b84ac-1321-427f-aa17-267ca6975798" | ConvertFrom-Json
Write-Output "Run URL: https://dev.azure.com/dnceng/internal/_build/results?buildId=$($result.id)"
```

### 5. Report results

Show the user:
- The pipeline run URL (from the response, or construct from the build ID)
- The commit SHA and branch that was pushed
- A reminder to clean up the remote branch when done:
  ```
  git push <remote> --delete toolset-test/<branch-name>
  ```

## Notes

- All 11 projects run as parallel jobs — individual jobs can fail independently.
- The pipeline uses the `windows.vs2026.amd64` agent image.
- Pipeline definition: https://dev.azure.com/dnceng/internal/_build?definitionId=1270
- Pipeline source repo: https://dev.azure.com/dnceng/internal/_git/razor-toolset-tests
Colle ce Markdown dans ton agent ou utilise les boutons ci-dessus pour l’écrire dans ton projet.

Ce que fait Run Toolset Tests (.NET)

Confirm we're in the merged Roslyn repository (look for `src/Razor/src/Compiler` or check git remotes).
Get the current commit SHA: `git rev-parse HEAD`
Get the current branch name: `git branch --show-current`
Run `git remote -v` and look for a remote whose URL contains `dotnet/roslyn`.

Comment utiliser Run Toolset Tests (.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 Run Toolset Tests (.NET)

Dis simplement à ton agent quelque chose comme :

Applique le skill run-toolset-tests__dotnet-dotnet__src-roslyn-github-skills-6dbac8e049bb à cette tâche
Utilise run-toolset-tests__dotnet-dotnet__src-roslyn-github-skills-6dbac8e049bb pour améliorer cette implémentation
Passe en revue ce sujet avec run-toolset-tests__dotnet-dotnet__src-roslyn-github-skills-6dbac8e049bb

Skills liés à Run Toolset Tests (.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).