Skip to content

test(routes): cover remaining HTTP endpoints and switch to integration marker#125

Merged
x3ek merged 4 commits into
mainfrom
test/98-remaining-endpoint-coverage
Jul 3, 2026
Merged

test(routes): cover remaining HTTP endpoints and switch to integration marker#125
x3ek merged 4 commits into
mainfrom
test/98-remaining-endpoint-coverage

Conversation

@x3ek

@x3ek x3ek commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Closes #98

45 new integration tests (suite 365 to 410), written after auditing what already existed so nothing is duplicated:

  • New tests/test_routes_public.py (18): health, root redirect, feed end-to-end with draft exclusion, sitemap with hidden-page and draft exclusion, robots, favicon found and missing, user-static extension gating, theme-static real file, default fallback, invalid theme 400, traversal 400, missing 404
  • New tests/test_routes_auth.py (10): login redirect with OAuth params, unconfigured OAuth, dev bypass, callback error/missing-code/bad-state, logout, /auth/me anonymous vs seeded session (token-exchange happy path intentionally out, would need GitHub endpoint mocking, noted in the module docstring)
  • Extended tests/test_routes_admin.py (12): /admin/analytics auth and shape, full-stack notes CRUD over HTTP with CSRF, HTMX partials, 401/403/404/422 paths

Also resolves the deferred conftest decision from #91: module-name gating replaced with a registered @pytest.mark.integration marker (self-declaring per module, no conftest edit for future modules, strict-markers catches typos), plus a fake_github fixture for tests that mutate content mid-test.

No source changes; no bugs found. One note: /auth/login redirects 307 (FastAPI RedirectResponse default), the issue text said 302; tests assert the actual behavior.

🤖 Generated with Claude Code

x3ek and others added 2 commits July 3, 2026 11:36
- Add test_routes_public.py: /health, / redirect, feed.xml, sitemap.xml,
  robots.txt, favicon, /static/user and /static/{theme} serving
- Add test_routes_auth.py: login redirect/unconfigured/dev bypass,
  callback error paths, logout, /auth/me
- Extend test_routes_admin.py: /admin/analytics and full-stack notes CRUD
  with CSRF (JSON + HTMX partials, 404s)
- Replace conftest _INTEGRATION_MODULES gating with a
  @pytest.mark.integration marker; add fake_github fixture

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@x3ek x3ek added this to the SquishMark 1.0 milestone Jul 3, 2026
@x3ek x3ek requested a review from Copilot July 3, 2026 16:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds broad HTTP integration coverage for previously untested endpoint groups and updates the integration-test harness to opt in via a pytest marker instead of a hardcoded module allowlist.

Changes:

  • Added new integration test modules covering public utility endpoints and OAuth auth routes.
  • Extended admin integration tests to cover /admin/analytics and full-stack notes CRUD + HTMX partials.
  • Switched integration gating in tests/conftest.py from a module-name list to @pytest.mark.integration, and registered the marker in pytest config.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/conftest.py Switches env pinning + FakeGitHubService injection to marker-based opt-in; adds fake_github fixture.
pyproject.toml Registers the integration marker for pytest.
tests/test_routes_public.py New end-to-end coverage for health, root redirect, feed, sitemap/robots, favicon, and static routes.
tests/test_routes_auth.py New end-to-end coverage for OAuth login/callback/logout/me flows (excluding token exchange).
tests/test_routes_admin.py Adds integration coverage for analytics and notes CRUD + HTMX partial endpoints.
tests/test_routes_posts.py Marks existing integration module with pytestmark = pytest.mark.integration.
tests/test_routes_pages.py Marks existing integration module with pytestmark = pytest.mark.integration.
tests/test_routes_webhooks.py Marks existing integration module with pytestmark = pytest.mark.integration.
tests/test_routes_search.py Marks existing integration module with pytestmark = pytest.mark.integration.

Comment thread pyproject.toml
@x3ek x3ek merged commit 312baae into main Jul 3, 2026
@x3ek x3ek deleted the test/98-remaining-endpoint-coverage branch July 3, 2026 17:37
@x3ek x3ek mentioned this pull request Jul 3, 2026
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.

Add integration tests for remaining HTTP endpoints

2 participants