Add unit tests for httpfsgateway, insight, and managed-rocksdb modules#3
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Add unit tests for httpfsgateway, insight, and managed-rocksdb modules#3devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Added 104 unit tests across the three least-covered modules: httpfsgateway (1.58% -> improved): - TestParams: 44 tests for Param hierarchy (BooleanParam, IntegerParam, LongParam, ShortParam, EnumParam, EnumSetParam, StringParam) and Parameters container - TestCheckUploadContentTypeFilter: 10 tests for content-type filter - TestHttpFSExceptionProvider: 10 tests for exception-to-HTTP-status mapping insight (13.79% -> improved): - TestComponent: 16 tests for Component data class (constructors, equals, hashCode, prefix) - TestMetricDisplayClasses: 9 tests for MetricDisplay, MetricGroupDisplay, and LoggerSource - TestNodeManagerInsight: 11 tests for NodeManagerInsight (loggers, metrics, filterLog) managed-rocksdb (6.25% -> improved): - TestRocksDatabaseException: 4 tests for RocksDatabaseException Generated-by: Devin (Claude) Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
What changes were proposed in this pull request?
Add 104 unit tests across the three modules with the lowest test-to-source ratio in the repository:
hadoop-ozone/httpfsgatewayhadoop-ozone/insighthadoop-hdds/managed-rocksdbhttpfsgateway tests:
TestParams(44 tests): covers theParamhierarchy —BooleanParam,IntegerParam,LongParam,ShortParam,EnumParam,EnumSetParam,StringParam(parsing, defaults, validation, domains) and theParameterscontainer (get,getValues, missing keys).TestCheckUploadContentTypeFilter(10 tests): exercisesdoFilterfor GET/DELETE/PUT/POST with correct and incorrect content types forCREATE/APPENDupload operations.TestHttpFSExceptionProvider(10 tests): verifies exception-to-HTTP-status mapping (SecurityException→ 401,FileNotFoundException→ 404,IOException→ 500,UnsupportedOperationException/IllegalArgumentException→ 400),FileSystemAccessExceptionunwrapping, andgetOneLineMessagetruncation.insight tests:
TestComponent(16 tests): constructors,equals/hashCode,prefix()formatting, andTypeenum coverage.TestMetricDisplayClasses(9 tests):MetricDisplay,MetricGroupDisplay, andLoggerSourceconstruction and accessors.TestNodeManagerInsight(11 tests): loggers, metrics groups, verbose/non-verbose level selection, andfilterLogwith various filter combinations.managed-rocksdb tests:
TestRocksDatabaseException(4 tests): verifies constructors and message formatting for both generic andRocksDBExceptioncauses.What is the link to the Apache JIRA
N/A — test-only change to improve unit test coverage.
How was this patch tested?
All 104 new tests run and pass:
Checkstyle (
checkstyle:check) and RAT (apache-rat-plugin:check) pass with 0 violations across all three modules.Generated-by: Devin (Claude)
Link to Devin session: https://app.devin.ai/sessions/e89718663af44b7aabfb200565fc6146
Requested by: @marcuslin123