mcpbeat Sign in

Vstest Build Test Agent Skill

Build, test, and validate changes in the vstest repository. Use when building vstest projects, running unit tests, smoke tests, or acceptance tests, or when deploying locally built vstest.console for manual testing.

2k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
967
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/microsoft/vstest --skill vstest-build-test

The instruction itself

17 sections, as written by the author

Building and Testing vstest

Pre-Build: Environment Setup

Before building, verify the .dotnet toolchain matches the current OS. The repo bootstraps its own .NET SDK into .dotnet/.

Detect OS vs .dotnet Mismatch

Run this check before every first build in a session:

# Determine current OS
OS=$(uname -s)   # "Linux", "Darwin" (macOS), or contains "MINGW"/"MSYS" (Windows/Git Bash)

if [ -d ".dotnet" ]; then
  if [ "$OS" = "Linux" ] || [ "$OS" = "Darwin" ]; then
    # On Linux/macOS the dotnet binary must be an ELF/Mach-O executable, not .exe
    if [ -f ".dotnet/dotnet.exe" ] && [ ! -f ".dotnet/dotnet" ]; then
      echo "MISMATCH: .dotnet contains Windows binaries but OS is $OS"
      rm -rf .dotnet .packages artifacts
      echo "Cleaned .dotnet, .packages, and artifacts for fresh bootstrap"
    fi
  else
    # On Windows the dotnet binary should be dotnet.exe
    if [ -f ".dotnet/dotnet" ] && [ ! -f ".dotnet/dotnet.exe" ]; then
      echo "MISMATCH: .dotnet contains Linux/macOS binaries but OS is Windows"
      rm -rf .dotnet .packages artifacts
      echo "Cleaned .dotnet, .packages, and artifacts for fresh bootstrap"
    fi
  fi
fi

After cleanup (or if .dotnet doesn't exist), the build script automatically downloads the correct SDK version from global.json.

Build

Platform Commands

| Action | Windows | Linux / macOS |

|---|---|---|

| Restore + Build | ./build.cmd | ./build.sh |

| Restore only | ./restore.cmd | ./restore.sh |

| Build + Pack | ./build.cmd -pack | ./build.sh --pack |

| Release config | ./build.cmd -c Release -pack | ./build.sh -c Release --pack |

| Single project | ./build.cmd -project <csproj> | ./build.sh --projects <csproj> |

For projects with many cross-project dependencies (e.g., HtmlLogger, TrxLogger, vstest.console):

# Linux / macOS
./build.sh --pack

# Windows
./build.cmd -pack

This produces NuGet packages under artifacts/packages/Debug/Shipping/.

Single Project Build

For isolated projects with few dependencies:

# Linux / macOS
./build.sh --projects <path-to-csproj>

# Windows
./build.cmd -project <path-to-csproj>

> Warning: This does NOT work for projects like HtmlLogger that have many transitive dependencies. Use --pack / -pack instead.

Test

Unit Tests (Default)

# Linux / macOS
./test.sh

# Windows
./test.cmd

Specific Project(s)

-projects / --projects takes a resolvable path or glob — it is passed through

Resolve-Path, so a bare project nickname or category (e.g. smoke, htmllogger) fails with

Cannot find path. Point it at the csproj(s):

# Windows
./test.cmd -projects "test\**\*HtmlLogger*\*.csproj"

# Linux / macOS
./test.sh --projects "test/**/*HtmlLogger*/*.csproj"

For a single project you can also build+test its csproj directly with the bootstrapped SDK:

# Windows
./.dotnet/dotnet.exe test test/Microsoft.TestPlatform.Extensions.HtmlLogger.UnitTests/*.csproj -c Debug

# Linux / macOS
./.dotnet/dotnet test test/Microsoft.TestPlatform.Extensions.HtmlLogger.UnitTests/*.csproj -c Debug

Test Categories (smoke / integration / performance / compatibility)

These are switches handled by eng/build.ps1 — NOT -projects values:

# Windows
./test.cmd -smokeTest           # TestCategory=Smoke (a subset of integration tests)
./test.cmd -integrationTest     # full acceptance / integration suite
./test.cmd -performanceTest
./test.cmd -compatibilityTest

# Linux / macOS use the same switch names
./test.sh -smokeTest

> -smokeTest and -integrationTest are mutually exclusive (smoke is a subset); passing both throws.

Filter by Test Name

Use the -filter parameter. Do not pass --filter inside TestRunnerAdditionalArguments

eng/build.ps1 explicitly throws if you do.

# Windows
./test.cmd -integrationTest -filter "FullyQualifiedName~MyScenario"

# Linux / macOS
./test.sh -integrationTest -filter "FullyQualifiedName~MyScenario"

Running integration / smoke tests locally (DOTNET_ROOT gotcha)

Integration and smoke tests self-host: they launch test-asset apphosts built against the repo's

preview TFM (e.g. net11.0). An apphost resolves its shared runtime from DOTNET_ROOT, falling

back to the machine-wide install (C:\Program Files\dotnet), which usually lacks the preview

runtime — so it fails instantly with *"You must install or update .NET to run this application."*

  • test.sh (Linux/macOS) sets DOTNET_ROOT to the repo .dotnet automatically.
  • test.cmd (Windows) does not — set it yourself before running:
$env:DOTNET_ROOT = "$PWD\.dotnet"
${env:DOTNET_ROOT(x86)} = "$PWD\.dotnet\dotnet-sdk-x86"   # only if x86 test hosts run
$env:DOTNET_MULTILEVEL_LOOKUP = "0"
./test.cmd -smokeTest

Manual Validation with vstest.console

After building with --pack / -pack, validate vstest.console changes by unzipping the built package:

  • Locate the package: artifacts/packages/Debug/Shipping/Microsoft.TestPlatform.<version>-dev.nupkg
  • Unzip it (.nupkg files are ZIP archives)
  • Run the local vstest.console against a test project

Alternative: Direct Artifact Paths

  • xplat (netcoreapp): artifacts/<Configuration>/netcoreapp1.0/vstest.console.dll
  • Windows desktop: artifacts/<Configuration>/net46/win7-x64/vstest.console.exe

Test Categories

| Category | Speed | What it tests | How to run |

|---|---|---|---|

| Unit tests | Fast | Individual units | ./test.cmd / ./test.sh (default) |

| Smoke tests | Slow | P0 end-to-end scenarios | -smokeTest switch |

| Acceptance / integration | Slowest | Extensive coverage | -integrationTest switch |

Troubleshooting

  • OS mismatch errors: If you see SDK load failures, run the mismatch detection script above to clean and re-bootstrap.
  • Integration/smoke tests fail instantly on Windows with "You must install or update .NET to run this application": test.cmd does not set DOTNET_ROOT, so the self-hosted preview-TFM apphosts look in C:\Program Files\dotnet (which lacks the preview runtime). Set $env:DOTNET_ROOT = "$PWD\.dotnet" before running — see "Running integration / smoke tests locally".
  • If build fails asking for .NET 4.6 targeting pack, install it from Microsoft Downloads
  • Enable verbose diagnostics: see docs/diagnose.md
  • For debugging, add Debugger.Launch at process entry points (testhost.exe, vstest.console.exe)

Other skills for the same job

different authors, same section of the catalogue
Webapp Testing
by anthropics
vendor ×12

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

6k tokens scripts
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
Test Driven Development
by w95
×7

Use when implementing any feature or bugfix, before writing implementation code

2k tokens
Systematic Debugging
by ratacat
×7

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

10k tokens scripts
Verification Before Completion
by ZhanlinCui
×6

Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always

1k tokens
Backtest Expert
by BaggaT236
×3

Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.

15k tokens scripts
Adaptyv
by christophacham
×3

Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use for submitting experiments via API, tracking experiment status, downloading results, optimizing protein sequences for better expression using computational tools (NetSolP, SoluProt, SolubleMPNN, ESM), or managing protein design workflows with wet-lab validation.

16k tokens
Aeon
by christophacham
×3

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

19k tokens

How to use it

Copy the folder

Take microsoft/vstest-build-test from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.