Skip to content

Add comprehensive test and CI coverage#159

Open
xusheng6 wants to merge 1 commit into
mainfrom
agent/comprehensive-test-coverage
Open

Add comprehensive test and CI coverage#159
xusheng6 wants to merge 1 commit into
mainfrom
agent/comprehensive-test-coverage

Conversation

@xusheng6

Copy link
Copy Markdown
Contributor

What changed

  • add isolated Flask and MongoDB test fixtures with synthetic authenticated users
  • cover onsite Markdown writeup submission, serving, attachment, and moderation workflows
  • cover reviewer authentication, CSRF, approvals, rejections, administration, logging, deletion, and site archives
  • expand route, model, service, validation, failure, rollback, and security coverage across the site
  • add GitHub Actions jobs for every push and pull request using both mongomock and MongoDB 7
  • enforce a 75% branch-coverage floor in CI
  • make application configuration and MongoDB clients injectable for deterministic tests
  • isolate reviewer authentication and CSRF helpers in review/auth.py

Why

The previous tests were stale in several places, accepted ambiguous outcomes, and could not reliably exercise authenticated workflows without production users or configuration. Reviewer and onsite-writeup paths also lacked sufficient integration coverage.

These changes give CI disposable users and databases, exact behavioral assertions, real-MongoDB validation, and broad coverage of important success, authorization, validation, rollback, and failure paths without browser automation.

Additional fix

The expanded tests found that a malformed None password hash raised AttributeError. Password matching now fails closed and returns False for that case.

Validation

  • 194 passed
  • approximately 82% statement coverage
  • 78% branch coverage
  • Python syntax compilation passes
  • git diff --check passes

@xusheng6 xusheng6 marked this pull request as ready for review July 10, 2026 16:48
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