test-scenario-env

Generates CoreRun-compatible dotenv files for CoreCLR test scenarios from testenvironment.proj.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reproducing a CoreCLR test failure under a specific stress scenario (such as jitstress1 or gcstress0xc) requires the exact environment variables defined in src/tests/Common/testenvironment.proj, and manually translating MSBuild scenario definitions into a CoreRun-consumable .env file is error-prone.

Core Features & Use Cases

  • Scenario Resolution: Matches a requested scenario name against TestEnvironment items in testenvironment.proj and evaluates it via the repository's bootstrapped dotnet and the CreateTestEnvFile MSBuild target.
  • Shell-to-Dotenv Conversion: Converts generated set/export assignments into CoreRun dotenv syntax, normalizing variable references, quoting, and duplicate names.
  • Test Project Merging: Optionally merges a test .csproj's effective CLRTestEnvironmentVariable and target-specific batch/bash environment items in runtime-wrapper precedence order.
  • Use Case: A developer investigating a JIT stress failure asks for the environment of a test under gcstress0xc and receives a validated .env file runnable with corerun -e <file> test.dll.

Quick Start

Create an env file for the jitstress1 scenario so I can run my failing CoreCLR test with corerun.

Frequently Asked Questions about test-scenario-env

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

FAQPage Schema
How do I create an env file for a CoreCLR test scenario like jitstress1?

Provide the scenario name from testenvironment.proj and the skill evaluates the CreateTestEnvFile MSBuild target using the repository's bootstrapped dotnet. The output is a dotenv file you can pass to corerun with the -e flag.

How to reproduce a CoreCLR test failure under gcstress locally?

Generate a scenario .env file for the gcstress variant, optionally merging the failing test project's CLRTestEnvironmentVariable items. Then run corerun -e <env-file> <test.dll> to reproduce the failure with the exact scenario environment.

Can I merge a specific test project's environment variables into the scenario file?

Yes, supply a test .csproj under src/tests and its effective CLRTestEnvironmentVariable plus target-specific batch or bash environment items are merged. Merging follows runtime-wrapper order, with common project variables overriding scenario values.

Does this work for Mono, NativeAOT, browser, or mobile test scenarios?

No, the skill only supports managed desktop CoreCLR scenarios and rejects others. It is not intended for library test scenarios, arbitrary user-defined env files, or mobile, browser, WASI, Mono, and NativeAOT test hosting.

What happens if the scenario name I request does not exist?

The skill asks you to choose from the closest concrete scenario names instead of silently emitting an empty environment. Target-dependent duplicates are selected by target OS using the project's conditions.