Skip to main content
HRTK can export test results to JSON files for external tooling, CI integration, or historical tracking. Run /hrtk export after a test run to write the results to disk.

Generating an Export

/hrtk run
/hrtk export
Output:
HRTK: Results exported to plugins/hrtk-server/results/run_1712345678000.json
Files are written to <plugin data directory>/results/ with a timestamp-based filename.

JSON Format

{
  "timestamp": 1712345678000,
  "suites": [
    {
      "plugin": "MyMod",
      "suite": "Combat Tests",
      "durationMs": 45,
      "tests": [
        {
          "name": "testSwordDamage",
          "displayName": "Sword deals correct damage",
          "status": "PASSED",
          "durationMs": 3,
          "message": null,
          "tags": ["combat", "melee"]
        },
        {
          "name": "testArrowDamage",
          "displayName": "Arrow deals correct damage",
          "status": "FAILED",
          "durationMs": 5,
          "message": "Expected health below <80.0> but was <95.0>",
          "tags": ["combat", "ranged"]
        }
      ]
    }
  ]
}

Field Reference

Root Object

FieldTypeDescription
timestamplongUnix timestamp (milliseconds) when the export was generated
suitesarrayList of suite result objects

Suite Object

FieldTypeDescription
pluginstringName of the plugin that owns this suite
suitestringDisplay name of the suite
durationMslongTotal suite execution time in milliseconds
testsarrayList of test result objects

Test Object

FieldTypeDescription
namestringMethod name of the test
displayNamestringHuman-readable display name
statusstringOne of: PASSED, FAILED, ERRORED, SKIPPED, TIMED_OUT
durationMslongTest execution time in milliseconds
messagestring?Failure message, error message, or skip reason (null if passed)
tagsstring[]List of tags applied to this test

Status Values

StatusDescription
PASSEDTest completed successfully
FAILEDAssertion failure
ERROREDUnexpected exception
SKIPPEDTest was disabled or precondition not met
TIMED_OUTTest exceeded its timeout

Example: Parsing in Python

import json

with open("run_1712345678000.json") as f:
    data = json.load(f)

for suite in data["suites"]:
    print(f"\n{suite['plugin']} / {suite['suite']}")
    for test in suite["tests"]:
        status = test["status"]
        name = test["displayName"]
        ms = test["durationMs"]
        print(f"  [{status}] {name} ({ms}ms)")
        if test["message"]:
            print(f"    {test['message']}")

CI Integration

Export JSON results after each test run in your CI pipeline. Compare results across builds to detect regressions. The timestamp field lets you track when each run occurred.
You can automate export by combining commands:
/hrtk run
/hrtk export
The export file includes all suite results from the last run, making it a complete snapshot of test health.
HRTK does not automatically clean up old export files. If you run exports frequently, consider adding a cleanup step to your CI pipeline or server maintenance scripts.

Next Steps