Skip to content

test: add unit tests for middleware, routers, cache and error handlers#2620

Merged
crivetimihai merged 1 commit intomainfrom
improve-coverage-part-3
Jan 31, 2026
Merged

test: add unit tests for middleware, routers, cache and error handlers#2620
crivetimihai merged 1 commit intomainfrom
improve-coverage-part-3

Conversation

@crivetimihai
Copy link
Copy Markdown
Member

Summary

  • Add tests for RegistryCache (cache entry expiry, stats, invalidation)
  • Add tests for SecurityHeadersMiddleware (HSTS, CORS, CSP, X-Frame-Options)
  • Add tests for ValidationMiddleware (path traversal, parameter validation)
  • Add tests for auth router (login, get_db, LoginRequest model)
  • Expand metrics_maintenance router tests (cleanup, rollup, stats endpoints)
  • Add tests for admin error handlers (server add/edit error paths)
  • Add tests for main.py gateway error handlers (connection, conflict, validation)

Test plan

  • All new tests pass locally
  • No module name collisions with existing tests
  • Run make coverage to verify coverage improvement

- Add tests for RegistryCache (cache entry expiry, stats, invalidation)
- Add tests for SecurityHeadersMiddleware (HSTS, CORS, CSP, X-Frame-Options)
- Add tests for ValidationMiddleware (path traversal, parameter validation)
- Add tests for auth router (login, get_db, LoginRequest model)
- Expand metrics_maintenance router tests (cleanup, rollup, stats endpoints)
- Add tests for admin error handlers (server add/edit error paths)
- Add tests for main.py gateway error handlers (connection, conflict, validation)

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai crivetimihai merged commit 61475b6 into main Jan 31, 2026
36 checks passed
@crivetimihai crivetimihai deleted the improve-coverage-part-3 branch January 31, 2026 18:32
hughhennelly pushed a commit to hughhennelly/mcp-context-forge that referenced this pull request Feb 8, 2026
IBM#2620)

- Add tests for RegistryCache (cache entry expiry, stats, invalidation)
- Add tests for SecurityHeadersMiddleware (HSTS, CORS, CSP, X-Frame-Options)
- Add tests for ValidationMiddleware (path traversal, parameter validation)
- Add tests for auth router (login, get_db, LoginRequest model)
- Expand metrics_maintenance router tests (cleanup, rollup, stats endpoints)
- Add tests for admin error handlers (server add/edit error paths)
- Add tests for main.py gateway error handlers (connection, conflict, validation)

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: hughhennnelly <hughhennelly06@gmail.com>
kcostell06 pushed a commit to kcostell06/mcp-context-forge that referenced this pull request Feb 24, 2026
IBM#2620)

- Add tests for RegistryCache (cache entry expiry, stats, invalidation)
- Add tests for SecurityHeadersMiddleware (HSTS, CORS, CSP, X-Frame-Options)
- Add tests for ValidationMiddleware (path traversal, parameter validation)
- Add tests for auth router (login, get_db, LoginRequest model)
- Expand metrics_maintenance router tests (cleanup, rollup, stats endpoints)
- Add tests for admin error handlers (server add/edit error paths)
- Add tests for main.py gateway error handlers (connection, conflict, validation)

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
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