Skip to content

[I-012] [Improvement]: Clean up and improve integration tests #368

Closed

Description

@indpurvesh

Priority: Medium
Phase: Phase 3 (Test Coverage)
Dependencies: #367


📝 User Story

As a developer,
I want to have well-organized, reliable integration tests,
So that API behaviour is verified end-to-end and tests are easy to maintain.


🎯 Scope & Requirements

  • Extract shared test setup/teardown into a common test fixture module
  • Add integration tests for the auth endpoints (/api/auth/login, profile endpoints)
  • Add integration tests for API key authentication (/api/v1/* routes)
  • Ensure all integration tests use the in-memory database (mem://) for speed and isolation
  • Add tests for error cases (invalid input, unauthorized access, not-found resources)
  • Add a test for the setup flow (/api/misc/setup)

✅ Acceptance Criteria

  • Given cargo test, When all integration tests run, Then they complete in under 60 seconds.
  • Given parallel test execution, When tests run concurrently, Then no test interference occurs (each test uses its own namespace).
  • Integration test count of at least 25 (currently 14 files).

📋 Task Checklist

  • Refactor shared test setup into a common module
  • Add missing integration tests
  • Verify parallel test safety
  • Run full test suite in CI

Metadata

Metadata

Assignees

Labels

improvementMaintenance and improvements to existing functionalitypriority: mediumMedium-priority worktestingTests and test infrastructure

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions