Skip to content

Test ownership and repository contents

Production Java belongs to its deployable core, connector or format module. Tests belong to the module whose contract they exercise. The parent POM aggregates the modules and has no root src/test tree. Test fixtures do not ship in deployable core or connector payloads.

Developer commands keep their stable bin/ names; Python implementations and tool tests live under dev/tools/. See the tool catalog for ownership, discovery and commands that download inputs, mutate a checkout or publish evidence.

Test owners and dependencies

Runtime implementation ownership follows Flink's functional families, with mode-specific helpers under operator.aggregate.stream, operator.join.stream, operator.window.stream, and the bounded execution protocol under operator.batch. Arrow transport and allocation are shared. dev/runtime-layout/operators.tsv records every core runtime class's family, lifecycle mode and identity contract. These ownership modes describe implementation responsibilities, not SQL admission; the operator coverage pages remain the support authority. For example, adaptive text Calc belongs to streaming execution even though it buffers Arrow batches.

SQL integration groups with closed fixture dependencies live in runtime.batch.sql and runtime.stream.sql beneath tech.streamfusion. Cross-mode contracts use runtime.common. The initial migration includes every root Batch* fixture and its LZ4 shuffle tests, and the independent streaming SQL group. Tests still coupled to package-private shared fixtures remain with those fixtures until their entire dependency group can move; filenames alone do not determine execution mode. Core harnesses that exercise package-private runtime contracts retain that package. Do not widen production access just to relocate a test or duplicate a fixture into each mode.

dev/runtime-layout/test-relocations.tsv maps previous binary names to current owners. Ordinary CI verifies each source has exactly one owner, discovers nested test classes, and applies the map when reading historical duration estimates. The measured duration files retain their original names and values. Existing canonical worker selectors and complete invocation audits remain active. Relocations apply to each estimate/measurement layer before combining them, so line-specific measurements and provisional floors keep their priority. Within a layer, an observation under the current name takes precedence over an older alias. The shared NativeParity assertion API lives in runtime.common; RecoveryExecutionMetrics exports its test-scoped cross-package contract from the core-neutral utility artifact. Bounded benchmarks reuse the general and fixed-type environments in BatchSqlTestSupport rather than reaching into a package-private test class.

Path Responsibility
streamfusion-core/src/test Core-internal Arrow, operator, planner and state unit tests; native resource accounting; frozen runtime compatibility and compact protocol inputs
streamfusion-*/src/test Tests owned by that deployment module, including Kafka, Parquet and ORC translator units
streamfusion-test-utils/src/main Core-neutral cluster lifecycle, metrics, sorted output and version-selected Flink test adapters
streamfusion-test-utils/src/test Tests of the shared test contract itself
streamfusion-runtime/src/test/java Cross-module SQL parity/recovery tests, integration fixtures and shared correctness/benchmark contracts
streamfusion-runtime/src/test/java-flink1.18 Integration fixtures compiled only for Flink 1.18
streamfusion-runtime/src/test/java-flink2.2 Integration fixtures compiled only for Flink 2.2
streamfusion-runtime/src/test/resources SQL/integration resources and fixed state/ordering inputs also consumed by Rust
streamfusion-runtime/src/test/proto Protobuf inputs generated by Maven for runtime tests
streamfusion-*/src/benchmark Performance-only Java programs, added explicitly by benchmarks

Deployment modules and runtime consume the utilities with test scope. The utility artifact has no dependency on a StreamFusion deployment module. Core owns the implementation of the TestResourceAudit test SPI and its JUnit registrations in the core test JAR. Runtime and optional integration suites consume that test JAR. The cluster calls the audit at initialization and after every test, preserving native handle, Arrow allocator and task reservation checks. Missing providers fail explicitly instead of silently disabling the leak audit. This direction keeps core, utilities and optional connectors acyclic.

Module-owned provider tests declare the format implementations they exercise with test scope. Kafka's translator tests install the JSON, raw, Avro and Avro Confluent Registry providers this way, retaining their original present/absent-provider assertions without adding formats to the deployable Kafka artifact. Run these units through the reactor (-pl streamfusion-kafka -am) so their format providers are built before the tests.

Ordinary Java and protobuf paths stay module-relative. A build-helper source set adds exactly one Flink line. Rust compatibility tests include the unchanged frozen state and ordering bytes from runtime resources. Legacy .sst and .bin fixtures retain their original bytes; regenerating them with the current writer would remove the old-format compatibility check.

mvn -pl streamfusion-runtime -am test
mvn -Pflink-1.18 -pl streamfusion-runtime -am clean test

Use clean outputs when switching Flink lines. The CI guide describes ordinary runtime shards, canonical restore inventories and native execution assertions. Core and deployment units execute in the first ordinary shard; runtime shards retain the cross-module invocation inventory. Canonical savepoint shards install dependencies with tests skipped, then execute their selected recovery cases through the workers. They do not repeat format-provider units using the narrower core/JSON/Kafka native payload. All module units still run for every ordinary Flink/JDK pair. Shared Java compilation archives include all owners and the utility artifact. A source move is not permission to remove an assertion, route check, recovery mode or parameterized invocation.

Performance source sets

The bench Maven profile selects optimized native libraries. The separate benchmarks profile adds src/benchmark/java and exactly one src/benchmark/java-flink${flink.line} tree. Ordinary tests, including CI using -Pbench, do not compile these performance-only programs. Local performance commands explicitly select both, for example:

SF_BENCHMARK=true mvn -Pbench,benchmarks -pl streamfusion-runtime -am \
  -Dtest=JvmAggregateBenchmark -Dsurefire.failIfNoSpecifiedTests=false test

Plan-only contracts keep their original explicit source sets, notably Paimon TPC-DS under tpcds. Shared correctness fixtures such as Nexmark SQL/protobuf definitions, table functions, nested scalar definitions and window-output ownership helpers remain available to ordinary tests even where their historical class name contains Benchmark. They retain their performance opt-ins; a filename alone does not define ownership or authorize execution in CI. Optional Delta, Fluss and Paimon performance harnesses consume runtime's test JAR only under benchmarks. Legacy Paimon copies only its two previously shared compatible performance programs. Core's slim Iceberg/Hudi Nexmark profiles consume utilities without recompiling them, while retaining core's audit provider and registrations.

Historical comparison tools resolve each current fixture from its actual runtime, benchmark or utility owner and copy unchanged bytes into the source layout used by the immutable target revision. Older targets use root src/test; subsequent targets use runtime-owned src/test; new targets retain the extracted owners. Missing or ambiguous fixtures fail before measurement. The recorded destination path and SHA-256 identify exactly what the historical build compiled.

Documentation and fixed inputs

Operator and connector pages describe current support. Benchmark reports describe their recorded revision, configuration and measurement boundary. Follow the evidence index for complete comparisons, component diagnostics, interrupted runs and rejected experiments.

The Calc and scalar benchmark indexes link topic pages and retain every published section anchor. dev/docs/published-anchors.json records their original destinations, including duplicate-heading suffixes. The anchor check validates both old bookmarks and new targets. Topic moves preserve all dated measurements, rejected results and relative evidence links.

Keep SQL inventory compressed snapshots, structured measurements, reproduction tools and rejected design decisions in Git. Generate inventory downloads during documentation publication. Historical logs and plans use the verified artifact workflow. Versioned report references remove embedded historical plan bodies while preserving byte-identical JSON downloads for existing public consumers.

#674 tracks this organization work. It changes test ownership and documentation packaging, without claiming SQL or throughput gains.