一键导入
run-dotnet-tests
Run .NET tests correctly using the test-with-timeout.sh wrapper to handle .NET 10 dual test runner modes and prevent test hangs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run .NET tests correctly using the test-with-timeout.sh wrapper to handle .NET 10 dual test runner modes and prevent test hangs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Minimum-requirements checklist for any change — code or docs-only. Run this before every PR creation or push to avoid CI failures on the first attempt.
Generate PNG screenshots for release notes using the repository's HtmlRenderer and ScreenshotGenerator tools. Use when asked to add screenshots to release notes or documentation.
Determine the next available issue number across all change types (feature, fix, workflow) by checking both local docs and remote branches, then reserve it by pushing an empty branch.
Convert the mermaid diagram in docs/agents.md to a blueprint-styled SVG for the website. Use when the workflow diagram in agents.md is updated and needs to be reflected on the website.
Run a focused accessibility pass for website changes (WCAG 2.1 AA-oriented).
Create and update interactive examples for the Eleventy website using page entrypoints and src/examples fragments.
| name | run-dotnet-tests |
| description | Run .NET tests correctly using the test-with-timeout.sh wrapper to handle .NET 10 dual test runner modes and prevent test hangs. |
Provide standardized instructions for running .NET 10 tests correctly. Ensures agents use the scripts/test-with-timeout.sh wrapper instead of direct dotnet test calls, which fail due to .NET 10's dual test runner architecture.
scripts/test-with-timeout.sh wrapper - never call dotnet test directly--solution src/tfplan2md.slnx for full test suite runs--project with relative paths from src/ directory (e.g., --project tests/Oocx.TfPlan2Md.TUnit/)update-test-snapshots skill instead of manual editsdotnet test directly from command line - it will fail with MSB1001: Unknown switch errors from repo rootsrc/tests/Oocx.TfPlan2Md.TUnit/TestData/Snapshots/ - use the update-test-snapshots skill.NET 10 introduced two distinct test runners with incompatible CLI flags:
| Working Directory | Runner Mode | --solution | --project | --treenode-filter | Result |
|---|---|---|---|---|---|
Repo root (/) | VSTest | ❌ | ❌ | ❌ | MSBuild error MSB1001: Unknown switch |
src/ (where global.json lives) | Microsoft.Testing.Platform | ✅ | ✅ | ✅ | Works correctly |
The scripts/test-with-timeout.sh wrapper automatically:
src/ directory (where global.json with "runner": "Microsoft.Testing.Platform" exists)src/-prefixed paths in argumentsWhy direct dotnet test fails: Running from repo root activates VSTest mode (no global.json), which doesn't support --solution, --project, or --treenode-filter flags. The wrapper ensures tests run from src/ directory to activate Microsoft.Testing.Platform mode.
scripts/test-with-timeout.sh -- dotnet test --solution src/tfplan2md.slnx
scripts/test-with-timeout.sh -- dotnet test --solution src/tfplan2md.slnx --configuration Release --verbosity normal
scripts/test-with-timeout.sh -- dotnet test --solution src/tfplan2md.slnx --no-build
scripts/test-with-timeout.sh --timeout-seconds 300 -- dotnet test --solution src/tfplan2md.slnx
scripts/test-with-timeout.sh -- dotnet test --project tests/Oocx.TfPlan2Md.TUnit/
Important: This project uses TUnit (not xUnit). TUnit uses --treenode-filter instead of --filter. All TUnit-specific flags must come after -- in the wrapper command.
scripts/test-with-timeout.sh -- dotnet test --project tests/Oocx.TfPlan2Md.TUnit/ --treenode-filter /*/*/MarkdownRendererTests/*
scripts/test-with-timeout.sh -- dotnet test --project tests/Oocx.TfPlan2Md.TUnit/ --treenode-filter /*/*/*/Render_ValidPlan_ContainsSummarySection
TUnit uses hierarchical path patterns:
/*/*/*/TestMethodName - Match specific test method/*/*/ClassName/* - Match all tests in a class/*/Namespace.ClassName/* - Match by namespace and classDuring Development (after each meaningful change):
# Run targeted tests for the area you modified
scripts/test-with-timeout.sh -- dotnet test --project tests/Oocx.TfPlan2Md.TUnit/ --treenode-filter /*/*/YourTestClass/*
Before Committing (C# code changes only):
# Run full test suite to ensure no regressions
scripts/test-with-timeout.sh -- dotnet test --solution src/tfplan2md.slnx --no-build
Skip Tests When (documentation/agent instructions only):
.github/agents/, .github/skills/, .github/copilot-instructions.md, or docs/--treenode-filter to isolate itIf tests fail because snapshot files need updating (intentional output changes):
update-test-snapshots skill - Never manually edit snapshot filesSNAPSHOT_UPDATE_OK in commit message - Document the intentional change| Exit Code | Meaning | Action |
|---|---|---|
| 0 | All tests passed | Proceed with commit |
| 1-123 | Test failures | Fix failing tests before committing |
| 124 | Timeout | Increase timeout with --timeout-seconds or investigate hung tests |
| 125 | Wrapper error | Check command syntax |
Complete workflow for implementing a feature:
# 1. Build the project
dotnet build
# 2. Run targeted tests during development
scripts/test-with-timeout.sh -- dotnet test --project tests/Oocx.TfPlan2Md.TUnit/ --treenode-filter /*/*/MyFeatureTests/*
# 3. Make changes, run tests again
scripts/test-with-timeout.sh -- dotnet test --project tests/Oocx.TfPlan2Md.TUnit/ --treenode-filter /*/*/MyFeatureTests/*
# 4. Before committing, run full suite
scripts/test-with-timeout.sh -- dotnet test --solution src/tfplan2md.slnx --no-build
# 5. If all pass, commit changes
git add .
git commit -m "feat: implement my feature"
MSBuild error MSB1001: Unknown switchCause: Running dotnet test directly from repo root (VSTest mode doesn't support --solution/--project flags)
Solution: Use scripts/test-with-timeout.sh wrapper
Cause: Tests taking longer than default timeout
Solution: Increase timeout with --timeout-seconds 300 (or higher)
--treenode-filterCause: Incorrect filter pattern or test doesn't exist Solution:
scripts/test-with-timeout.sh -- dotnet test --list-testsCause: Intentional output format changes
Solution: Use update-test-snapshots skill to regenerate snapshots correctly