standalone-test-repro

Converts CoreCLR managed tests into standalone console applications runnable with corerun.

18.2k|5.6k|Updated Sep 24, 2019
One-click install
npx skills add https://github.com/dotnet/runtime --skill standalone-test-repro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: standalone-test-repro
Source: https://github.com/dotnet/runtime/tree/main/.github/skills/standalone-test-repro
Command: npx skills add https://github.com/dotnet/runtime --skill standalone-test-repro

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Debugging a failing .NET runtime test normally requires the full test harness, merged xUnit assemblies, and CI infrastructure. This Skill extracts a single managed test from src/tests into an isolated console application under artifacts/tmp that runs directly with corerun, making failures reproducible and editable outside the test framework.

Core Features & Use Cases

  • Test Extraction: Resolves a test from a wrapper path (JIT/.../TestName.cmd) or a fully qualified xUnit method name, then copies the relevant source and helper types into a standalone project.
  • Environment Fidelity: Captures CLRTestEnvironmentVariable values, RuntimeHostConfigurationOption settings, pre/post commands, and CI scenarios (e.g., jitstress1) into a .env file consumed by corerun.
  • Validation Workflow: Builds with the repository's bootstrapped SDK, runs via corerun, and verifies the exit code (normally 100) and behavior against the original test contract.
  • Use Case: A CI leg reports a JIT failure under jitstress1 for a specific test method. Use this Skill to generate a local repro directory, build it, and run it with corerun to confirm the crash without the full test harness.

Quick Start

Ask the AI to create a standalone repro for the runtime test at the given wrapper path or fully qualified test method name, optionally specifying the CI scenario such as jitstress1.

Frequently Asked Questions about standalone-test-repro

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a standalone repro for a failing CoreCLR runtime test?

Provide the test's wrapper path (ending in .cmd or .sh) or its fully qualified xUnit method name. The Skill resolves the source method and owning project, copies the test logic into artifacts/tmp/standalone-test-repro, builds it with the repo SDK, and runs it with corerun.

How do I reproduce a CI jitstress test failure locally?

Pass the test identifier along with the scenario name such as jitstress1. The Skill evaluates the scenario environment from src/tests/Common/testenvironment.proj, writes the variables to a .env file, and applies them via corerun -e when running the repro.

Can this convert library tests or NativeAOT tests into console apps?

No. It only supports managed CoreCLR tests under src/tests that execute through corerun. Library tests under src/libraries, NativeAOT-only tests, and tests requiring browser, mobile, or multi-process harnesses are explicitly out of scope.

What exit code should a standalone runtime test repro return?

Runtime tests conventionally return exit code 100 on success, and the generated console entry point preserves that contract. A CI failure repro may intentionally crash or return a different value, which the Skill records and compares against the reported failure.

Why does the repro need a .env file for corerun?

Many runtime tests depend on CLRTestEnvironmentVariable and scenario-specific settings that alter JIT or GC behavior. The Skill writes these evaluated values as NAME=VALUE lines in dotenv format, which corerun loads with the -e flag to match the original test environment.

Does the standalone repro reference the original test assembly?

No. The Skill copies and adapts the test source and required helpers into a new project, replacing xUnit assertions with local checks. It never references the original test project or its built output assembly.