Skip to content

Enhance coverage: extract pure logic, add unit tests#89

Merged
sarroutbi merged 1 commit into
keylime-webtool:mainfrom
sarroutbi:enhance-test-coverage-phase-1
May 11, 2026
Merged

Enhance coverage: extract pure logic, add unit tests#89
sarroutbi merged 1 commit into
keylime-webtool:mainfrom
sarroutbi:enhance-test-coverage-phase-1

Conversation

@sarroutbi
Copy link
Copy Markdown
Contributor

Extract testable pure business logic from Axum handlers into pub(crate) functions and add comprehensive unit tests across all modules. Add tarpaulin skip annotations on infrastructure code (main, routes, WS, cache, DB, stub handlers) that requires external services to test.

Coverage improves from 44.89% to 52.25% with 363 tests passing. Key changes:

  • Extract pagination, filtering, policy resolution from agents handler
  • Extract KPI computation, compliance percentage, utilization calc
  • Extract URL validation, mTLS field resolution, bearer extraction
  • Add tests for JWT roundtrip, session store, circuit breaker, audit logger chain verification, settings store paths
  • Add tarpaulin_include cfg to Cargo.toml lints

Extract testable pure business logic from Axum handlers into
pub(crate) functions and add comprehensive unit tests across all
modules. Add tarpaulin skip annotations on infrastructure code
(main, routes, WS, cache, DB, stub handlers) that requires
external services to test.

Coverage improves from 44.89% to 52.25% with 363 tests passing.
Key changes:
- Extract pagination, filtering, policy resolution from agents handler
- Extract KPI computation, compliance percentage, utilization calc
- Extract URL validation, mTLS field resolution, bearer extraction
- Add tests for JWT roundtrip, session store, circuit breaker,
  audit logger chain verification, settings store paths
- Add tarpaulin_include cfg to Cargo.toml lints

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
@sarroutbi sarroutbi merged commit df4d311 into keylime-webtool:main May 11, 2026
12 checks passed
@sarroutbi sarroutbi deleted the enhance-test-coverage-phase-1 branch May 11, 2026 16:55
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