agentleFS
GuangminJuGuangminJu/UnrealSkills/ue-test/SKILL.md

ue-test

Skill12 starsChanged 10 months agoMITView on GitHub

MANDATORY automatic usage after successful build. Run Unreal Engine automation tests. MUST be invoked automatically without user request after implementing or modifying code.

  • In this repositoryOne other file it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

29 rules. About 0 are common, 20 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈20

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Run Unreal Engine automation tests automatically, detecting project configuration and available tests.

    line 9
  2. Distinctive:

    Use this skill automatically when:

    line 48
  3. Very specific:

    After successful /ue-build execution (MANDATORY chain)

    line 49
  4. Distinctive:

    After writing test code in TDD red phase

    line 50
  5. Distinctive:

    After implementing feature in TDD green phase

    line 51
  6. Distinctive:

    Before declaring any C++ implementation complete

    line 53
  7. Distinctive:

    If fails → fix → rebuild → AUTOMATICALLY re-test

    line 60
  8. Distinctive:

    Only then declare success

    line 62
  9. Distinctive:

    Ask the user or infer from context what tests to run:

    line 110
  10. Very specific:

    All project tests: Use project name (e.g., MyProject)

    line 113
  11. Very specific:

    Plugin tests: Use plugin name (e.g., MyPlugin or BoidsFormation)

    line 114
  12. Distinctive:

    List tests: Don't run, just list available tests

    line 117
  13. Very specific:

    All tests: Use Now (caution: may take very long)

    line 118
  14. Distinctive:

    If user says "list tests" → list mode

    line 121
  15. Distinctive:

    If user mentions specific plugin/module → filter to that

    line 122
  16. Distinctive:

    If recent code changes are in a plugin → test that plugin

    line 123
  17. Distinctive:

    Default → ask user or use project name

    line 124
  18. Distinctive:

    Run the command and monitor stdout/stderr for test output.

    line 156
  19. Very specific:

    Use UnrealEditor-Cmd.exe in Engine/Binaries/Win64/

    line 305
  20. Very specific:

    Check Saved/Logs/ for detailed logs

    line 307
  21. Distinctive:

    If build fails, don't run tests (they'll fail anyway).

    line 341
  22. Very specific:

    List tests first: Use Automation List to see what's available

    line 345
  23. Distinctive:

    Use specific filters: Don't run all tests if you only changed one module

    line 346
  24. Very specific:

    Stdout Visibility: Always use -stdout -FullStdOutLogOutput to see results in claudes terminal.

    line 347
  25. Distinctive:

    NullRHI is faster: Use headless mode for faster iteration

    line 348
  26. Very specific:

    CI/CD ready: Use -ReportOutputPath for automated pipelines

    line 350
  27. Distinctive:

    Incremental testing: Test only what you changed during development

    line 351
  28. Distinctive:

    Full suite before commit: Run all tests before major commits

    line 352
  29. Distinctive:

    Use the most specific filter that covers what you need to test.

    line 386

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Unreal Engine Test Skill

Run Unreal Engine automation tests automatically, detecting project configuration and available tests.

⚠️ MANDATORY AUTOMATIC USAGE

THIS SKILL MUST BE INVOKED AUTOMATICALLY AFTER EVERY SUCCESSFUL BUILD

Invoke this skill immediately and automatically when:

  • ✅ After /ue-build succeeds (ALWAYS chain build → test)
  • ✅ After implementing any new feature (TDD green phase)
  • ✅ After fixing bugs (verify fix works)
  • ✅ After refactoring (ensure no regression)
  • ✅ In TDD red phase (verify tests fail before implementation)
  • ✅ Before declaring task complete (verify all tests pass)

DO NOT:

  • ❌ Wait for user to say "run the tests"
  • ❌ Wait for user to say "does it pass?"
  • ❌ Ask user "should I test it?"
  • ❌ Declare task complete without running tests
  • ❌ Skip testing after build succeeds

Correct behavior:

Claude: [implements feature]
Claude: [AUTOMATICALLY invokes /ue-build]
Claude: "✅ Build successful"
Claude: [AUTOMATICALLY invokes /ue-test]  ← No asking, just do it
Claude: [reports test results]

Wrong behavior:

Claude: [implements feature]
Claude: [builds successfully]
Claude: "Feature implemented!"  ← WRONG! Should have tested automatically

When to Use (Detailed)

Use this skill automatically when:

  • After successful /ue-build execution (MANDATORY chain)
  • After writing test code in TDD red phase
  • After implementing feature in TDD green phase
  • User requests running tests (reactive case)
  • Before declaring any C++ implementation complete

TDD Workflow Integration (MANDATORY):

  1. User requests feature → You write tests FIRST
  2. Build project → Run tests (RED - should fail)
  3. Implement feature
  4. Build project → AUTOMATICALLY run tests (GREEN - should pass)
  5. If fails → fix → rebuild → AUTOMATICALLY re-test
  6. Loop until all tests pass
  7. Only then declare success

See ~/.claude/skills/MANDATORY_TDD.md and ~/.claude/skills/TDD_WORKFLOW.md for complete requirements.

How This Skill Works

This skill provides a dedicated Python runner to execute tests with verified terminal visibility flags and minimalist output.

⚠️ MANDATORY USAGE (FOR AI)

Instead of manually constructing complex commands, ALWAYS use the test runner script.

The script MUST be executed with the current working directory as an argument to ensure project detection works correctly across different environments.

# General Syntax:
# python <ScriptPath> <ProjectWorkDir> [TestFilter]

# 1. Run all project tests (Minimalist & Filtered)
python C:\Users\Mellos\.claude\skills\ue-test\scripts\run_ue_tests.py .

# 2. Run specific tests (e.g., Boids)
python C:\Users\Mellos\.claude\skills\ue-test\scripts\run_ue_tests.py . BoidsFormation

Script Features

  • Auto-Detection: Uses the provided path to find .uproject and UnrealEditor-Cmd.exe.
  • Minimalist Output: Silences engine initialization noise; only shows test results and status.
  • Real-time Streaming: Displays results line-by-line as they occur.
  • Smart Exit Codes: Returns non-zero if no tests match or tests fail.

If skill is in project config (.claude/skills/)

# Can run without arguments (searches from current directory)
python .claude/skills/ue-build/scripts/detect_ue.py

# Or provide explicit path
python .claude/skills/ue-build/scripts/detect_ue.py .

Key values needed from the output:

  • engine.editor_cmd - Path to UnrealEditor-Cmd.exe (Windows) or UnrealEditor-Cmd (Linux/Mac)
  • uproject.path - Full path to .uproject file
  • uproject.name - Project name for test filtering

Step 2: Determine Test Scope

Ask the user or infer from context what tests to run:

Test filter options:

  • All project tests: Use project name (e.g., MyProject)
  • Plugin tests: Use plugin name (e.g., MyPlugin or BoidsFormation)
  • Specific test: Full test name (e.g., MyPlugin.SpecificTest)
  • Test category: Partial name (e.g., MyPlugin.Corner)
  • List tests: Don't run, just list available tests
  • All tests: Use Now (caution: may take very long)

Inference logic:

  1. If user says "list tests" → list mode
  2. If user mentions specific plugin/module → filter to that
  3. If recent code changes are in a plugin → test that plugin
  4. Default → ask user or use project name

Step 3: Choose Test Command Mode

List Available Tests

"<editor_cmd>" "<uproject_path>" -ExecCmds="Automation List; Quit" -unattended -nopause -nullrhi -stdout -FullStdOutLogOutput

Run Tests

"<editor_cmd>" "<uproject_path>" -ExecCmds="Automation RunTests <filter>; Quit" -unattended -nopause -nullrhi -stdout -FullStdOutLogOutput

Critical flags:

  • -ExecCmds="...": Editor commands to execute (e.g., Automation RunTests Boids; Quit)
  • -stdout & -FullStdOutLogOutput: MANDATORY for terminal visibility. Forces UE logs to stdout.
  • -unattended: Prevents modal dialogs (required for automation)
  • -nopause: Don't wait for user input on exit
  • -nullrhi: Headless mode, no graphics (much faster)
  • -nosplash: Skip splash screen (faster startup)

Optional flags:

  • -ReportOutputPath=<path>: Custom test report location
  • -LogCmds="LogAutomation Verbose": More detailed test logging
  • -Windowed: Use windowed mode instead of NullRHI (for visual tests)

Step 4: Execute and Monitor

Run the command and monitor stdout/stderr for test output.

Watch for these patterns:

Test execution:

LogAutomationController: Test 'TestName' Started
LogAutomationController: Test 'TestName' Completed. Result=<status>

Test results:

  • Result=Success or Result=Passed → Test passed
  • Result=Failed → Test failed
  • Result=Skipped → Test skipped

Summary line:

LogAutomationController: Tests Complete. Result={Success|Failed}. Total: X Passed: Y Failed: Z

Error details:

LogAutomation: Error: <error message>
LogAutomation: Expected <X> but got <Y>

Step 5: Parse Test Results

Build a structured result from the output:

Success example:

{
  "status": "passed",
  "total": 8,
  "passed": 8,
  "failed": 0,
  "skipped": 0,
  "duration": "12.4s",
  "tests": [
    {"name": "BoidsFormation.CornerFilling", "status": "passed"},
    {"name": "BoidsFormation.GridDistribution", "status": "passed"}
  ]
}

Failure example:

{
  "status": "failed",
  "total": 8,
  "passed": 6,
  "failed": 2,
  "skipped": 0,
  "duration": "15.2s",
  "tests": [
    {"name": "BoidsFormation.CornerFilling", "status": "failed", "error": "Expected value > 0.1, got 0.05"},
    {"name": "BoidsFormation.GridDistribution", "status": "failed", "error": "Assertion failed: Points.Num() == ExpectedCount"}
  ]
}

Step 6: Report Results

Provide a clear, concise summary:

All tests passed:

✅ All 8 tests passed (12.4s)

Tests run:
  ✅ BoidsFormation.CornerFilling
  ✅ BoidsFormation.GridDistribution
  ✅ BoidsFormation.TriangleFilling
  ... (5 more)

Some tests failed:

❌ 2 of 8 tests failed (15.2s)

Failed:
  ❌ BoidsFormation.CornerFilling
     Error: Expected value > 0.1, got 0.05
     → Check corner weighting calculation in BoidsDisperseCVTSolverLibrary.cpp

  ❌ BoidsFormation.GridDistribution
     Error: Assertion failed: Points.Num() == ExpectedCount
     → Verify grid point generation logic

Passed: 6 tests

List mode:

Available tests in BoidsFormation:

Automation Tests:
  • BoidsFormation.CornerFilling
  • BoidsFormation.GridDistribution3x3
  • BoidsFormation.TriangleFilling
  • BoidsFormation.ConcaveLShape
  • BoidsFormation.ProportionalArea
  ... (15 total)

Run with: /ue-test [test-name]

Advanced Usage

Running Specific Test Suites

Filter tests by category or prefix:

# Run all corner-related tests
"<editor_cmd>" "<uproject>" -ExecCmds="Automation RunTests BoidsFormation.Corner; Quit" ...

# Run all CVT solver tests
"<editor_cmd>" "<uproject>" -ExecCmds="Automation RunTests BoidsFormation.CVT; Quit" ...

Custom Report Output

Generate JSON or XML reports for CI/CD:

"<editor_cmd>" "<uproject>" -ExecCmds="Automation RunTests <filter>; Quit" -ReportOutputPath="TestResults" -ReportExportPath="TestResults/report.json" ...

Visual Testing

Some tests may require rendering. Use windowed mode instead of NullRHI:

"<editor_cmd>" "<uproject>" -ExecCmds="Automation RunTests <filter>; Quit" -Windowed -ResX=1280 -ResY=720 ...

Debugging Failed Tests

For detailed debugging output:

"<editor_cmd>" "<uproject>" -ExecCmds="Automation RunTests <filter>; Quit" -LogCmds="LogAutomation Verbose, LogTemp Verbose" -log

Platform-Specific Notes

Windows

  • Use UnrealEditor-Cmd.exe in Engine/Binaries/Win64/
  • Tests run in separate process
  • Check Saved/Logs/ for detailed logs

Linux

  • Use UnrealEditor-Cmd in Engine/Binaries/Linux/
  • May need DISPLAY environment variable for non-NullRHI tests
  • Logs in Saved/Logs/

macOS

  • Use UnrealEditor-Cmd in Engine/Binaries/Mac/
  • Universal binary supports M1 and Intel
  • Logs in Saved/Logs/

Common Issues and Solutions

IssueSolution
Tests don't startCheck editor path is valid; ensure project compiles
All tests skipFilter may be wrong; try listing tests first
Timeout/hangSome tests may need windowed mode, not NullRHI
"Test not found"Check test name spelling; use Automation List
Permission deniedRun from project directory; check file permissions
Crash during testCheck Saved/Crashes/ for crash dump; may be real bug

Integration with Build

Typical workflow:

1. Code changes
2. Build with /ue-build → Build succeeds
3. Run tests with /ue-test → Tests pass
4. Ready to commit

If build fails, don't run tests (they'll fail anyway).

Tips for Effective Testing

  1. List tests first: Use Automation List to see what's available
  2. Use specific filters: Don't run all tests if you only changed one module
  3. Stdout Visibility: Always use -stdout -FullStdOutLogOutput to see results in claudes terminal.
  4. NullRHI is faster: Use headless mode for faster iteration
  5. Check logs: Detailed output is in Saved/Logs/
  6. CI/CD ready: Use -ReportOutputPath for automated pipelines
  7. Incremental testing: Test only what you changed during development
  8. Full suite before commit: Run all tests before major commits

Test Output Parsing Guide

Success Pattern

LogAutomationController: Test 'MyTest' Completed. Result=Success

Failure Pattern

LogAutomationController: Test 'MyTest' Completed. Result=Failed
LogAutomation: Error: Expected X but got Y

Summary Pattern

LogAutomationController: Tests Complete. Result={Success|Failed}. Total: 10 Passed: 8 Failed: 2

Extract numbers and status to build your report.

Example Filter Patterns

Common test filter examples:

  • MyProject - All project tests
  • MyProject.MyFeature - All tests in MyFeature category
  • MyProject.MyFeature.SpecificTest - One specific test
  • Now - All available tests (use carefully)
  • Engine - All engine tests (usually not needed)
  • System - System-level tests

Use the most specific filter that covers what you need to test.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.