All HRTK operations are triggered through the /hrtk command tree. Commands can be executed from the server console or in-game by players with the hrtk.admin permission.
Command Overview
Command Description /hrtkShow help text or open the UI dashboard (in-game) /hrtk runRun tests /hrtk listList discovered tests /hrtk benchRun benchmarks only /hrtk resultsShow last run results /hrtk scanRe-discover tests from loaded plugins /hrtk watchToggle auto-rerun on plugin reload /hrtk exportExport last run results to JSON
/hrtk
When run from the console, displays help text and discovery statistics. When run in-game by a player, opens the HRTK dashboard UI page.
> /hrtk
HRTK - Hytale Runtime Testing Kit
/hrtk run [plugin] [--tag tag] [--fail-fast] [--verbose]
/hrtk list [plugin]
/hrtk bench [plugin] [--tag tag]
/hrtk results
/hrtk scan
/hrtk watch [plugin]
/hrtk export
Discovered: 47 test(s) across 3 plugin(s)
/hrtk run
Run tests with optional filtering.
Syntax
/hrtk run [target] [--tag tags] [--fail-fast] [--verbose]
Format Example What it runs (none) /hrtk runAll tests from all plugins Plugin name /hrtk run MyModAll tests from MyMod Plugin.Suite /hrtk run MyMod.CombatTestsOne suite from MyMod Plugin.Suite#method /hrtk run MyMod.CombatTests#testDamageOne test method
Flags
Flag Description --tag tag1,tag2Only run tests with at least one matching tag --fail-fastStop on the first failure --verboseShow extra detail in output
Examples
Run all tests
Run one plugin
Run by tag
Run a single test
Fail fast with verbose output
Output
HRTK: Starting test run...
=== HRTK: MyMod ===
Combat Tests
[PASS] testSwordDamage (3ms)
[PASS] testShieldBlock (2ms)
[FAIL] testArrowDamage (5ms)
Expected health below <80.0> but was <95.0>
Results: 2 passed, 1 failed, 0 skipped (10ms total)
/hrtk list
List all discovered tests, grouped by plugin and suite.
> /hrtk list
Plugin: MyMod
Suite: Combat Tests (3 tests)
- testSwordDamage ["combat"]
- testShieldBlock ["combat", "defense"]
- testArrowDamage ["combat", "ranged"]
Suite: Utility Tests (2 tests)
- testClamp
- testLerp
Plugin: AnotherMod
Suite: Config Tests [DISABLED] (1 tests)
- testDefaults [DISABLED]
Disabled suites and methods are shown with [DISABLED] markers. Benchmark methods are shown with [BENCH].
/hrtk bench
Run only @Benchmark methods, skipping regular tests.
/hrtk bench # All benchmarks
/hrtk bench MyMod # Benchmarks from MyMod
/hrtk bench --tag serialization # Benchmarks tagged "serialization"
Output includes performance statistics:
HRTK [BENCH] Benchmark Examples.String concatenation baseline:
avg=0.45us, min=0.31us, max=2.12us (100 iterations, 5 warmup)
/hrtk results
Show the formatted results from the last test run.
> /hrtk results
=== HRTK: MyMod ===
Combat Tests
[PASS] testSwordDamage (3ms)
[FAIL] testArrowDamage (5ms)
Expected health below <80.0> but was <95.0>
Results: 1 passed, 1 failed, 0 skipped (8ms total)
If no tests have been run yet:
HRTK: No previous run results. Use /hrtk run first.
/hrtk scan
Re-scan all loaded plugins for test annotations. Useful after hot-reloading a plugin.
> /hrtk scan
HRTK: Scanning plugins...
HRTK: Found 47 test(s) in 12 suite(s) across 3 plugin(s)
/hrtk watch
Toggle automatic test re-runs when a plugin reloads. When a watched plugin is reloaded, HRTK automatically re-scans and runs its tests.
/hrtk watch MyMod # Start watching MyMod
/hrtk watch MyMod # Stop watching MyMod (toggle)
/hrtk watch # Show currently watched plugins
> /hrtk watch MyMod
HRTK: Now watching 'MyMod' -- tests will re-run on reload
/hrtk export
Export the last run’s results to a JSON file in the plugin’s data directory.
> /hrtk export
HRTK: Results exported to plugins/hrtk-server/results/run_1712345678000.json
See File Export for the JSON format details.
Permission
All commands require the hrtk.admin permission. Grant it to operators or specific players as needed.
Next Steps