Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.hrtk.frotty27.com/llms.txt

Use this file to discover all available pages before exploring further.

All HRTK operations use the /hrtk command. You can run these from the server console or in-game if you have the hrtk.admin permission.

Command Overview

CommandDescription
/hrtkShow available commands and which plugins have tests
/hrtk runRun tests and generate a report
/hrtk listShow all discovered tests
/hrtk benchRun benchmarks only
/hrtk resultsShow results from the last test run
/hrtk scanRe-discover tests from all loaded plugins
/hrtk watchAuto-rerun tests when a plugin reloads
/hrtk exportSave last results to JSON + HTML files

/hrtk

Shows available commands and lists which plugins have tests. Works both from the console and in-game.
> /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

Plugins with tests:
  Frotty27:MyMod  12 tests in 3 suites

/hrtk run

Runs your tests and shows the results. You can filter by plugin, tag, or specific test. Tests run in the background so the server stays responsive.
Only one test run can be active at a time. If you run /hrtk run while tests are already running, HRTK will tell you to wait for the current run to finish.

Syntax

/hrtk run [target] [--tag tags] [--fail-fast] [--verbose]

Target formats

The plugin name is the Group:Name from your mod’s manifest.json. Run /hrtk to see available plugin names.
FormatExampleWhat it runs
(none)/hrtk runAll tests from all plugins
Plugin name/hrtk run Frotty27:MyModAll tests from one plugin
Plugin.Suite/hrtk run Frotty27:MyMod.CombatTestsOne suite from a plugin
Plugin.Suite#method/hrtk run Frotty27:MyMod.CombatTests#testDamageOne specific test

Flags

FlagDescription
--tag tag1,tag2Only run tests with at least one of these tags
--fail-fastStop as soon as one test fails
--verboseShow each test result as it completes

Examples

/hrtk run

Output

--- HRTK --- Starting test run...

--- HRTK Test Run Complete ---
  2 passed  |  1 failed  |  0 skipped
  Duration: 10ms
  Report: plugins/hrtk-server/results/run_1712345678000.html

/hrtk list

Shows all discovered tests, grouped by plugin and suite.
> /hrtk list
Plugin: Frotty27:MyMod
  Combat Tests (3 tests)
  Utility Tests (2 tests)

Plugin: Frotty27:AnotherMod
  Config Tests [DISABLED] (1 tests)

Total: 6 tests in 3 suites across 2 plugins
Disabled suites and methods are shown with [DISABLED] markers. Benchmark methods are shown with [BENCH].

/hrtk bench

Runs only @Benchmark methods, skipping regular tests. Like /hrtk run, tests run in the background.
/hrtk bench                          # All benchmarks
/hrtk bench Frotty27:MyMod           # Benchmarks from one plugin
/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

Shows the pass/fail details from the most recent test run.
> /hrtk results

--- HRTK Last Run Results ---
Combat Tests (Frotty27:MyMod)
  [PASS] testSwordDamage (3ms)
  [FAIL] testArrowDamage (5ms)
         Expected health below <80.0> but was <95.0>

1 passed, 1 failed, 0 skipped (8ms)
If no tests have been run yet:
No previous run results. Use /hrtk run first.

/hrtk scan

Re-scans all loaded plugins for test classes. Run this after hot-reloading a plugin to pick up new or changed tests.
> /hrtk scan
--- HRTK Scan Complete ---
  Frotty27:MyMod  12 tests in 3 suites
  Total: 12 tests across 1 plugin

/hrtk watch

Toggles automatic test re-runs when a plugin reloads. When a watched plugin is reloaded, HRTK automatically re-scans and runs its tests. Run the same command again to stop watching.
/hrtk watch Frotty27:MyMod        # Start watching a plugin
/hrtk watch Frotty27:MyMod        # Stop watching (toggle)
/hrtk watch                       # Show currently watched plugins
> /hrtk watch Frotty27:MyMod
--- HRTK Watch ---
  Now watching Frotty27:MyMod - tests will re-run on reload

/hrtk export

Saves the last run’s results as JSON and HTML files. The HTML report is a self-contained page with color-coded results, filtering, and light/dark mode support.
> /hrtk export
--- HRTK Export Complete ---
  JSON: plugins/hrtk-server/results/run_1712345678000.json
  HTML: plugins/hrtk-server/results/run_1712345678000.html
See File Export for format details.

Permission

All commands require the hrtk.admin permission. Grant it to operators or specific players as needed.

Next Steps