Migrate fdb-record-layer-core test bases to testFixtures#4297
Open
ScottDugas wants to merge 4 commits into
Open
Migrate fdb-record-layer-core test bases to testFixtures#4297ScottDugas wants to merge 4 commits into
ScottDugas wants to merge 4 commits into
Conversation
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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adopt the java-test-fixtures plugin on fdb-record-layer-core so that fdb-record-layer-{icu,lucene,spatial} can stop depending on its
testsclassifier configuration. Moves the minimum closure of test-helper classes (FDBRecordStoreTestBase,FDBRecordStoreConcurrentTestBase,FDBRecordStoreQueryTestBase,FDBDatabaseExtension,TestKeySpace*,TestHelpers,UnstoredRecord,FormatVersionTestUtils,TextIndexTestUtils,the
PlanMatcherspackage,DualPlannerTest/Extension, and a handful oftext/randomhelpers) plus their.protofiles intosrc/testFixtures/.Three abstract bases were misnamed
*Testdespite being inheritancebases for icu's concrete tests; rename them while moving:
CollateFunctionKeyExpressionTest->CollateFunctionKeyExpressionTestBaseTextCollatorTest->TextCollatorTestBaseFDBCollateQueryTest->FDBCollateQueryTestBaseTheir inner
*JRETestconcrete classes are extracted to their own files insrc/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'totestFixtures(project(...)). The unnecessarytestsdependency infdb-relational-cli(a stale reference to code that has since moved to:fdb-record-layer-debugger) is dropped entirely.gradle/proto.gradlegains explicitdependsOnwiring on the extract tasks plus the testFixtures include-dirs, both required by Gradle 9's implicit-dependency validation.Because these classes are now in
testFixturesand go through some static analysis, I had to address a couple other issues:FDBCollateQueryTestBase.NAMESwas apublic static final String[]which meant it was mutable. I changed this to aList.ofand updated the methods that needed itHolder<T>to the test class that used it, rather than leaving it in the moved test classpackage-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.