Skip to content

Add unit tests for httpfsgateway, insight, and managed-rocksdb modules#3

Open
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1782584419-add-unit-tests-coverage
Open

Add unit tests for httpfsgateway, insight, and managed-rocksdb modules#3
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1782584419-add-unit-tests-coverage

Conversation

@devin-ai-integration

Copy link
Copy Markdown

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:

Module Before (test/source ratio) Tests added
hadoop-ozone/httpfsgateway 1.58% (1 test / 63 source) +64 tests (3 new test classes)
hadoop-ozone/insight 13.79% (4 tests / 29 source) +36 tests (3 new test classes)
hadoop-hdds/managed-rocksdb 6.25% (2 tests / 32 source) +4 tests (1 new test class)

httpfsgateway tests:

  • TestParams (44 tests): covers the Param hierarchy — BooleanParam, IntegerParam, LongParam, ShortParam, EnumParam, EnumSetParam, StringParam (parsing, defaults, validation, domains) and the Parameters container (get, getValues, missing keys).
  • TestCheckUploadContentTypeFilter (10 tests): exercises doFilter for GET/DELETE/PUT/POST with correct and incorrect content types for CREATE/APPEND upload operations.
  • TestHttpFSExceptionProvider (10 tests): verifies exception-to-HTTP-status mapping (SecurityException → 401, FileNotFoundException → 404, IOException → 500, UnsupportedOperationException/IllegalArgumentException → 400), FileSystemAccessException unwrapping, and getOneLineMessage truncation.

insight tests:

  • TestComponent (16 tests): constructors, equals/hashCode, prefix() formatting, and Type enum coverage.
  • TestMetricDisplayClasses (9 tests): MetricDisplay, MetricGroupDisplay, and LoggerSource construction and accessors.
  • TestNodeManagerInsight (11 tests): loggers, metrics groups, verbose/non-verbose level selection, and filterLog with various filter combinations.

managed-rocksdb tests:

  • TestRocksDatabaseException (4 tests): verifies constructors and message formatting for both generic and RocksDBException causes.

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:

mvn -pl :ozone-httpfsgateway test → 64 tests, 0 failures
mvn -pl :ozone-insight test       → 36 tests, 0 failures
mvn -pl :hdds-managed-rocksdb test →  4 tests, 0 failures

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

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>
@marcuslin123 marcuslin123 self-assigned this Jun 27, 2026
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant