Skip to content

Feature/tests and quality gates#18

Merged
Howard-nolan merged 2 commits intomainfrom
feature/tests_and_quality_gates
Dec 18, 2025
Merged

Feature/tests and quality gates#18
Howard-nolan merged 2 commits intomainfrom
feature/tests_and_quality_gates

Conversation

@Howard-nolan
Copy link
Owner

@Howard-nolan Howard-nolan commented Dec 18, 2025

Change Summary:

  • Expanded coverage with table-driven handler unit tests (sqlmock) and an integration-tagged black-box test that exercises real HTTP on an in-memory DB.
  • Wired server to new middleware/logger/cache-aware handler signature and recorded supporting dependencies (prometheus, hashicorp/golang-lru, sqlmock).

How It Works:

  • Unit tests in internal/http/handlers/handlers_test.go drive handlers through table cases with sqlmock; integration_test.go (build tag integration) spins up httptest.NewServer with in-memory SQLite to hit /v1/shorten then /v1/r/{code} end-to-end.

Additional Notes (optional):

  • Run integration suite with go test -tags=integration ./...; it’s skipped in default runs.

@Howard-nolan Howard-nolan merged commit 7b7f0e9 into main Dec 18, 2025
github-actions bot added a commit that referenced this pull request Dec 18, 2025
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