voonhous opened a new pull request, #19876:
URL: https://github.com/apache/hudi/pull/19876

   ### Describe the issue this Pull Request addresses
   
   `AWSGlueCatalogSyncClient` is the largest coverage gap in hudi-aws (292 of 
665 lines uncovered on Codecov, master 56eae7b4), and `DynamoTableUtils` (45 
lines) and most of the `HoodieAWSConfig` builder (42 lines) have no tests. Part 
of the effort to bring repository coverage from 79.31% to 80%.
   
   ### Summary and Changelog
   
   Test-only change, all with Mockito and no AWS access. The Glue client tests 
assert the request sent to Glue through an `ArgumentCaptor`, not only the 
return value. One shared fixture had to change: `GlueTestUtil` wrote its commit 
as raw JSON to `.hoodie/101.commit`, which the 1.x timeline layout never reads, 
so the fixture table had an empty timeline and no schema; it now writes through 
`DefaultCommitMetadataSerDe` into `.hoodie/timeline/` and records the schema. 
All pre-existing tests pass unchanged.
   
   <details>
   <summary>Tests added, by class</summary>
   
   - `TestAWSGlueSyncClient`: 39 new tests on the existing mocked 
`GlueAsyncClient` fixture. They cover partition-index management end to end 
(enable flag, stale-index drop, missing-index create, the three-index cap), 
`updateLastCommitTimeSynced` including the swallowed partition-index failures 
and the empty-timeline branch, `updateSerdeProperties` (all four exits), 
`getMetastoreSchema`, `getStorageFieldSchemas`, `getPartitionsFromList`, the 
endpoint/region branches of `buildAsyncClient` (static-mocked SDK builder), and 
the failure-wrapping branches of create/drop/exists/update/addPartitions. Each 
asserts the request sent to Glue through an `ArgumentCaptor`, not only the 
return value.
   - `TestDynamoTableUtils` (new, 13 tests): `waitUntilExists` / 
`waitUntilActive` with short explicit timeouts (first-poll success, 
not-found-then-found, timeout into `TableNeverTransitionedToStateException`, 
argument guards), `createTableIfNotExists` and `deleteTableIfExists` on both 
exits.
   - `TestHoodieAWSConfig` (new, 4 tests): every builder method, `build()` 
defaults, `fromProperties`, `fromFile`.
   - `TestS3StorageLockClient`: two branches of the upsert error handling.
   - `GlueTestUtil`: the fixture wrote its commit as raw JSON to 
`.hoodie/101.commit`, which the 1.x timeline layout does not read, so the 
fixture table had an empty timeline and no schema. It now writes through 
`DefaultCommitMetadataSerDe` into `.hoodie/timeline/` with a completion time 
and records the table schema (with docs), and gains 
`createTableWithoutCommits()` for the empty-timeline cases. All pre-existing 
tests still pass unchanged.
   
   </details>
   
   Left alone on purpose: `updateTableComments` / `setComments` (being fixed in 
#19488; a test here would pin the behaviour that PR changes), the 
`AlreadyExistsException` handlers that the async client cannot reach 
(`CompletableFuture.get()` always wraps them in `ExecutionException`), 
`S3StorageLockClient`'s real-client constructors (region lookup and 
`getBucketLocation` need the network), and `AwsGlueCatalogSyncTool.main` 
(`System.exit`).
   
   ### Impact
   
   No production change. About 10 s of additional test time in the catch-all 
job.
   
   ### Risk Level
   
   none
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] Adequate tests were added if applicable
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to