Commit 188bb4b
Backfill test coverage to 80%+ per-file and improve test quality (#203)
* Backfill tests to reach 80% coverage goal
* imports
* cleanup various inspection problems
* Some cleanup, consolidation, and missing files
* Kill surviving PiTest mutations in kafka, venice, and mysql modules
Added 78 targeted tests across 13 test files to kill mutations that
survived the previous backfill:
- hoptimator-kafka (+15 tests): createTopic retention config branching,
restore cleanup, update-partitions boundary, validate boundary cases,
provider type-guard, driver autocommit/schema registration, and
ClusterSchema description content
- hoptimator-venice (+19 tests): validate() null/empty/error branches,
createControllerClient SSL vs non-SSL paths, ClusterSchema loadAllTables
content and getSslFactory, Provider instanceof guard, Driver autocommit
and catalog assignment
- hoptimator-mysql (+44 tests): exact MySQL DDL type strings per SQL type,
VARCHAR precision boundary, buildCreateTableSql nullable/PK/length DDL,
alterTable ADD/MODIFY/DROP COLUMN, escapeIdentifier backtick output,
ensureDatabaseExists DDL, validate schema mismatch detection, Provider
instanceof guard, Driver autocommit, MySqlTable nullability branching,
TableSchema description content
All 286 tests pass (kafka: 64, venice: 88, mysql: 134).
Coverage: 85.95% line / 82.07% branch overall.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* Remove 17 redundant tests made obsolete by mutation-killing backfill
Semantic and structural audit across all test files identified tests that
are strict subsets of newer, more specific mutation-killing tests:
- SourceTest: testSchemaReturnsNullForSingleElementPath (→ ExactlyOneElement version)
- DeployerUtilsTest: testParseIntOptionReturnsDefault/CustomValue,
testParseLongOptionReturnsCustomValue (→ KeyAbsent/KeyPresent variants)
- HoptimatorDatabaseMetaDataTest: testGetSchemasReturnsResultSet (→ NoArgs),
testGetSchemasWithSchemaPattern (→ WithNonNullSchemaPatternUsingRegex)
- KafkaDeployerTest: testCreateNewTopicWithRetention (→ PassesRetentionToNewTopic,
which also asserts exact RETENTION_MS_CONFIG value via ArgumentCaptor)
- KafkaDriverTest: connectAutoCommitIsSetToTrue, connectAddsKafkaSchemaToRootSchema
(assertions already present in connectWithCorrectPrefixReturnsConnection/
connectRegistersKafkaSchema)
- VeniceDeployerValidationTest: testSpecifyReturnsEmptyList (exact duplicate in
VeniceDeployerTest)
- VeniceDriverTest: testConnectSetsAutoCommitTrue, testConnectSetsCatalogToVenice
(already asserted in connectWithCorrectPrefixReturnsConnection)
- MySqlDeployerTest: testValidatePassesForNewTable (→ testValidatePassesWhenAllConditionsGood
with fuller setup)
- MySqlDeployerValidationTest: testValidateFailsWhenKeyFieldTypeMismatch (weaker than
testValidateFailsWhenKeyFieldTypeChanges which also checks field name and types);
testToMySqlTypeMappings (→ testToMySqlTypeExactSqlString with ArgumentCaptor)
- MySqlDeployerProviderTest: testDeployersReturnsExactlyOneMySqlDeployer (identical
to testReturnsDeployerForMySqlSchema)
- MySqlDriverTest: testConnectSetsAutoCommitToTrue (already in correctPrefixReturnsConnection)
- MySqlTableTest: testGetRowTypeWithEmptyTableReturnsZeroColumns (exact duplicate of
testGetRowTypeWithEmptyTable)
Build and all tests still pass.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* Refactor test structure: extract, consolidate, and clean up
CheckResponseMutationTests → K8sApiErrorResponseTest:
The nested class had fully independent @mock fields and @beforeeach
setup; extracted to its own top-level file K8sApiErrorResponseTest.java.
All 7 error-response tests now live at the proper scope.
TableTriggerReconcilerMockTest + TestTableTriggerReconciler → TableTriggerReconcilerTest:
Two files testing the same class merged into one. State-based tests
(ex-TestTableTriggerReconciler) are top-level; interaction/spy-based
tests (ex-TableTriggerReconcilerMockTest) live in a @nested static
InteractionTests class. Both old files deleted.
FakeK8sApi: removed System.out.println noise from create/delete/update.
java.lang.reflect removed:
Added PipelineRel.Implementor.hasSink() package accessor; replaced
three-line reflection block in HoptimatorDdlUtilsTest with
assertTrue(plan.hasSink()).
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* Fix test compilation and stubbing issues after rebase
- AvroConverterTypeMappingTest: update null-type assertion from
SqlTypeName.UNKNOWN to SqlTypeName.NULL to match production code
added in the main-branch AvroConverter null-guard commit
- K8sPipelineElementStatusEstimatorTest: add setUpPipelineMocks()
to tests that need pipeline/context stubs after setUp() was
refactored to not include them; remove unused lenient import;
replace setUpPipelineMocks() with minimal stubs in
testEstimateStatusesWithEmptyYamlSpec to avoid
UnnecessaryStubbingException
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* Normalize test class naming: Test* → *Test where a source class exists
Renamed (git tracks as moves):
- TestValidatorProvider → ValidatorProviderTest (corresponds to ValidatorProvider interface)
- TestControllerProvider → ControllerProviderTest (corresponds to ControllerProvider interface)
Updated ServiceLoader registrations and references in ValidationServiceTest,
ControllerServiceTest accordingly.
Test* prefix kept for TestSqlScripts and TestBasicSql — these are integration-
style SQL script runners with no corresponding source class, so Test* is
appropriate for them.
Merged unique tests from old Test* files into existing *Test counterparts,
then deleted the old files:
- TestK8sSnapshot (2 tests) → merged into K8sSnapshotTest
- TestDataTypeUtils (3 tests) → merged into DataTypeUtilsTest
- TestTemplate (4 unique tests) → merged into TemplateTest
Deleted as fully superseded:
- TestK8sConnector (covered by K8sConnectorTest)
- TestViewReconciler (covered by ViewReconcilerTest)
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* Test owner reference logic added in PR 204
Two new tests in TableTriggerReconcilerTest.InteractionTests cover both
branches of the owner reference selection added in Spawn Trigger Jobs
With Owner Reference:
- jobCreatedWithSyntheticOwnerReferenceWhenTriggerHasNone: trigger has
no ownerReferences, createWithMetadata receives a synthetic ref built
from the trigger own apiVersion, kind, name, and uid
- jobCreatedWithExistingOwnerReferencesWhenTriggerHasThem: trigger has
existing ownerReferences, they are passed through unchanged
Previously all createWithMetadata verifications used any() for the owner
reference argument and did not exercise this logic.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>1 parent 51f1ba0 commit 188bb4b
317 files changed
Lines changed: 32802 additions & 2053 deletions
File tree
- .github/workflows
- hoptimator-api/src/test/java/com/linkedin/hoptimator
- hoptimator-avro/src
- main/java/com/linkedin/hoptimator/avro
- test/java/com/linkedin/hoptimator/avro
- hoptimator-catalog/src
- main/java/com/linkedin/hoptimator/catalog
- builtin
- test/java/com/linkedin/hoptimator/catalog
- builtin
- hoptimator-cli/src/main/java/sqlline
- hoptimator-demodb/src
- main/java/com/linkedin/hoptimator/demodb
- test/java/com/linkedin/hoptimator/demodb
- hoptimator-flink-adapter/src/main/java/com/linkedin/hoptimator/operator/flink
- hoptimator-jdbc
- src
- main/java/com/linkedin/hoptimator/jdbc
- schema
- testFixtures/java/com/linkedin/hoptimator/jdbc
- test
- java/com/linkedin/hoptimator/jdbc
- schema
- resources/META-INF/services
- hoptimator-k8s
- src
- main/java/com/linkedin/hoptimator/k8s
- status
- testFixtures/java/com/linkedin/hoptimator/k8s
- test/java/com/linkedin/hoptimator/k8s
- status
- hoptimator-kafka-controller/src
- main/java/com/linkedin/hoptimator/operator/kafka
- test/java/com/linkedin/hoptimator/operator/kafka
- hoptimator-kafka/src
- main/java/com/linkedin/hoptimator/kafka
- test/java/com/linkedin/hoptimator/kafka
- hoptimator-mcp-server-app/src/test/java/com/linkedin/hoptimator/mcp/server
- hoptimator-mcp-server
- src
- main/java/com/linkedin/hoptimator/mcp/server
- test/java/com/linkedin/hoptimator/mcp/server
- hoptimator-mysql/src
- main/java/com/linkedin/hoptimator/mysql
- test/java/com/linkedin/hoptimator/mysql
- hoptimator-operator/src
- main/java/com/linkedin/hoptimator/operator
- pipeline
- subscription
- trigger
- test
- java/com/linkedin/hoptimator/operator
- pipeline
- subscription
- trigger
- resources/META-INF/services
- hoptimator-planner/src
- main/java/com/linkedin/hoptimator/planner
- test/java/com/linkedin/hoptimator/planner
- hoptimator-util
- src
- main/java/com/linkedin/hoptimator/util
- planner
- test
- java/com/linkedin/hoptimator/util
- planner
- resources/META-INF/services
- hoptimator-venice
- src
- main/java/com/linkedin/hoptimator/venice
- test/java/com/linkedin/hoptimator/venice
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
26 | 38 | | |
27 | 39 | | |
28 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | | - | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
149 | 153 | | |
150 | 154 | | |
151 | 155 | | |
152 | | - | |
| 156 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
5 | 56 | | |
6 | 57 | | |
7 | 58 | | |
| |||
18 | 69 | | |
19 | 70 | | |
20 | 71 | | |
21 | | - | |
| 72 | + | |
22 | 73 | | |
23 | 74 | | |
24 | 75 | | |
25 | 76 | | |
26 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
27 | 84 | | |
28 | 85 | | |
29 | 86 | | |
| |||
Lines changed: 66 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
Lines changed: 84 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
0 commit comments