Skip to content

test: improve code coverage with unit tests#86

Merged
bug-ops merged 5 commits intomainfrom
feature/improve-test-coverage-phase3
Feb 2, 2026
Merged

test: improve code coverage with unit tests#86
bug-ops merged 5 commits intomainfrom
feature/improve-test-coverage-phase3

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 2, 2026

Summary

  • Add comprehensive unit tests for hdbconnect-mcp modules
  • Add CodSpeed performance badge to README
  • Increase test coverage from ~83% to ~87%

New tests added

  • config/builder.rs: Full coverage for all setter methods
  • config/runtime.rs: RuntimeConfig reload and diff tests
  • auth/config.rs: JWT config, tenant config, RBAC config tests
  • helpers.rs: hdb_value_to_json edge cases, cached_or_fetch tests
  • security/query_guard.rs: Comprehensive query validation tests
  • observability/metrics.rs: Record functions smoke tests
  • observability/mod.rs: Tracing initialization tests

Coverage analysis

Current coverage: 87.01% (was ~83%)
Target: 90%

Remaining uncovered code is primarily integration code requiring live HANA/HTTP connections:

  • server.rs (MCP server implementation)
  • pool.rs (connection pooling)
  • transport/*.rs (HTTP/stdio transport)
  • auth/oidc.rs, auth/jwks.rs (OIDC/JWKS integration)

Test plan

  • All 1107 tests pass
  • Coverage improved
  • No regressions in existing functionality

- Add ConfigBuilder tests for all setter methods
- Add RuntimeConfig reload and diff tests
- Add helpers module edge case tests
- Add QueryGuard comprehensive tests
- Increase coverage for hdbconnect-mcp config subsystem
@github-actions github-actions bot added tests size/XL documentation Improvements or additions to documentation rust Pull requests that update rust code arrow and removed tests size/XL labels Feb 2, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 2, 2026

CodSpeed Performance Report

Merging this PR will improve performance by 13.54%

Comparing feature/improve-test-coverage-phase3 (2387343) with main (56cc23d)

Summary

⚡ 1 improved benchmark
✅ 136 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
get_no_ttl_check 6.6 µs 5.8 µs +13.54%

@codecov-commenter
Copy link

codecov-commenter commented Feb 2, 2026

Codecov Report

❌ Patch coverage is 99.58960% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/hdbconnect-mcp/src/security/query_guard.rs 97.72% 2 Missing ⚠️
crates/hdbconnect-mcp/src/config/runtime.rs 98.66% 1 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #86      +/-   ##
==========================================
+ Coverage   84.09%   86.64%   +2.54%     
==========================================
  Files          63       63              
  Lines       12618    13349     +731     
==========================================
+ Hits        10611    11566     +955     
+ Misses       2007     1783     -224     
Flag Coverage Δ
hdbconnect-arrow 86.59% <99.58%> (+2.56%) ⬆️
hdbconnect-mcp 86.59% <99.58%> (+2.56%) ⬆️
python 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...rates/hdbconnect-arrow/src/conversion/processor.rs 97.49% <ø> (ø)
crates/hdbconnect-arrow/src/test_utils.rs 100.00% <100.00%> (+31.05%) ⬆️
crates/hdbconnect-mcp/src/auth/config.rs 100.00% <100.00%> (+23.44%) ⬆️
crates/hdbconnect-mcp/src/config/builder.rs 100.00% <100.00%> (+9.58%) ⬆️
crates/hdbconnect-mcp/src/config/mod.rs 95.12% <100.00%> (+37.22%) ⬆️
crates/hdbconnect-mcp/src/helpers.rs 84.91% <100.00%> (+10.58%) ⬆️
crates/hdbconnect-mcp/src/observability/metrics.rs 80.79% <100.00%> (+67.75%) ⬆️
crates/hdbconnect-mcp/src/observability/mod.rs 92.64% <100.00%> (+7.79%) ⬆️
crates/hdbconnect-mcp/src/config/runtime.rs 92.47% <98.66%> (+7.78%) ⬆️
crates/hdbconnect-mcp/src/security/query_guard.rs 97.71% <97.72%> (+28.74%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bug-ops bug-ops merged commit a893d2f into main Feb 2, 2026
38 checks passed
@bug-ops bug-ops deleted the feature/improve-test-coverage-phase3 branch February 2, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow documentation Improvements or additions to documentation rust Pull requests that update rust code size/XL tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants