This page describes the internal architecture of theDocumentation 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.
hrtk-server plugin. Understanding this pipeline helps you debug unexpected behavior and contribute to HRTK’s development.
Pipeline Overview
Executor
SuiteExecutor and TestExecutor handle suite-level lifecycle, isolation, and individual test execution.Discovery
TheTestDiscoveryEngine is the entry point for finding tests. It uses the Hytale PluginManager to iterate loaded plugins and the standard JarFile API to scan their classes.
TestMethodInfo captures:
- The
Methodreference - Display name (from
@DisplayNameor@HytaleTestvalue) - Tags (from
@Tag+ implicit tags from@EcsTest/@WorldTest) - Order (from
@Order) - Disabled status (from
@Disabled) - World requirements, player requirements
- Timeout, benchmark config, repeat count, parameterization
Registry
PluginTestRegistry is a Map<String, List<TestClassInfo>> keyed by plugin name. It supports:
register(pluginName, testClassInfo)- add a discovered suitegetAllTestClasses()- get the full mapgetTestClasses(pluginName)- get suites for one pluginclearPlugin(pluginName)- remove a plugin’s suites (for re-scanning)clear()- remove everything
Filter
TestFilter is built from command-line arguments by HRTKCommand.parseFilter():
matchesSuite(TestClassInfo)- checks plugin and suite namematchesMethod(TestClassInfo, TestMethodInfo)- checks method name, tags, benchmark-only
Runner
TestRunner is the top-level orchestrator:
Suite Executor
SuiteExecutor handles the lifecycle of a single suite:
Apply Isolation
Based on
IsolationStrategy: create a dedicated world, take a snapshot, or do nothing.For each test method
Run
@BeforeEach -> execute test -> run @AfterEach. Handles benchmarks, parameterized tests, and repeated tests as special cases.Test Executor
TestExecutor handles a single test method:
- Skip check - if
@Disabled, return SKIPPED immediately - Plugin check - if
@RequiresPluginand plugin not loaded, return SKIPPED - Create context - build the appropriate
TestContextsubtype based on annotations - Inject parameters - resolve method parameters by type
- Execute with timeout - run on the world thread (world-bound) or background thread (standard)
- Catch errors - wrap all outcomes as
TestResult(PASSED, FAILED, ERRORED, TIMED_OUT)
Context Injection
Parameter resolution follows this precedence:- Interface assignability check (handles most cases)
- Simple name fallback (for cross-classloader scenarios)
Result Collection
ResultCollector
Accumulates
SuiteResult objects. Tracks the last run for /hrtk results.ResultFormatter
Produces the human-readable console output with
[PASS]/[FAIL]/[ERR ] prefixes.ResultExporter
Writes JSON files to
<data directory>/results/ with all suite and test data.Plugin Entry Point
HRTKPlugin extends JavaPlugin and wires everything together on onEnable():
- Creates
TestDiscoveryEngine - Creates
ResultCollector - Creates
TestRunner - Registers the
HRTKCommandtree - Calls
discovery.scanAll(this)to discover tests on startup
Next Steps
- How It Works - high-level architecture overview
- Commands - the command tree that triggers this pipeline
- File Export - JSON export format