Skip to content

Migrate fdb-record-layer-core test bases to testFixtures#4297

Open
ScottDugas wants to merge 4 commits into
FoundationDB:mainfrom
ScottDugas:rl-core-test-fixtures
Open

Migrate fdb-record-layer-core test bases to testFixtures#4297
ScottDugas wants to merge 4 commits into
FoundationDB:mainfrom
ScottDugas:rl-core-test-fixtures

Conversation

@ScottDugas

@ScottDugas ScottDugas commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Adopt the java-test-fixtures plugin on fdb-record-layer-core so that fdb-record-layer-{icu,lucene,spatial} can stop depending on its tests classifier configuration. Moves the minimum closure of test-helper classes (FDBRecordStoreTestBase, FDBRecordStoreConcurrentTestBase,
FDBRecordStoreQueryTestBase, FDBDatabaseExtension, TestKeySpace*,
TestHelpers, UnstoredRecord, FormatVersionTestUtils, TextIndexTestUtils,
the PlanMatchers package, DualPlannerTest/Extension, and a handful of
text/random helpers) plus their .proto files into src/testFixtures/.

Three abstract bases were misnamed *Test despite being inheritance
bases for icu's concrete tests; rename them while moving:

  • CollateFunctionKeyExpressionTest -> CollateFunctionKeyExpressionTestBase
  • TextCollatorTest -> TextCollatorTestBase
  • FDBCollateQueryTest -> FDBCollateQueryTestBase

Their inner *JRETest concrete classes are extracted to their own files in src/test/java/ so JUnit Platform still discovers them in core's CI (testFixtures output is not scanned for test classes).

Consumer modules switch from configuration: 'tests' to testFixtures(project(...)). The unnecessary tests dependency in fdb-relational-cli (a stale reference to code that has since moved to :fdb-record-layer-debugger) is dropped entirely. gradle/proto.gradle gains explicit dependsOn wiring on the extract tasks plus the testFixtures include-dirs, both required by Gradle 9's implicit-dependency validation.

Because these classes are now in testFixtures and go through some static analysis, I had to address a couple other issues:

  • FDBCollateQueryTestBase.NAMES was a public static final String[] which meant it was mutable. I changed this to a List.of and updated the methods that needed it
  • I moved Holder<T> to the test class that used it, rather than leaving it in the moved test class
  • All the packages needed package-info.java. I'm not super happy with their javadoc, but it's a starting point. At some point in the future we may want to reconsider these packages, but I wanted to keep this change simple.

Adopt the java-test-fixtures plugin on fdb-record-layer-core so that
fdb-record-layer-{icu,lucene,spatial} can stop depending on its `tests`
classifier configuration. Moves the minimum closure of test-helper
classes (FDBRecordStoreTestBase, FDBRecordStoreConcurrentTestBase,
FDBRecordStoreQueryTestBase, FDBDatabaseExtension, TestKeySpace*,
TestHelpers, UnstoredRecord, FormatVersionTestUtils, TextIndexTestUtils,
the PlanMatchers package, DualPlannerTest/Extension, and a handful of
text/random helpers) plus their .proto files into src/testFixtures/.

Three abstract bases were misnamed `*Test` despite being inheritance
bases for icu's concrete tests; rename them while moving:

- CollateFunctionKeyExpressionTest -> CollateFunctionKeyExpressionTestBase
- TextCollatorTest                  -> TextCollatorTestBase
- FDBCollateQueryTest               -> FDBCollateQueryTestBase

Their inner `*JRETest` concrete classes are extracted to their own files
in src/test/java/ so JUnit Platform still discovers them in core's CI
(testFixtures output is not scanned for test classes).

Consumer modules switch from `configuration: 'tests'` to
`testFixtures(project(...))`. The unnecessary `tests` dependency in
fdb-relational-cli (a stale reference to code that has since moved to
:fdb-record-layer-debugger) is dropped entirely. gradle/proto.gradle
gains explicit dependsOn wiring on the extract tasks plus the testFixtures
include-dirs, both required by Gradle 9's implicit-dependency validation.
@ScottDugas ScottDugas added the build improvement Improvement to the build system label Jun 24, 2026
Notably, FDBCollateQueryTestBase.NAMES is now a List, so that it is
immutable, rather than exposing a public, mutable field. Some methods
had to respond.
Also move Holder to the test class
@ScottDugas ScottDugas marked this pull request as ready for review June 25, 2026 14:56
@ScottDugas ScottDugas requested a review from alecgrieser June 25, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build improvement Improvement to the build system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant