Skip to content

[Phase 1] Add unit tests for single-namespace mode #4

@jeremyeder

Description

@jeremyeder

Epic: #1
Phase: 1 - Foundation & Code Changes
Dependencies: #2, #3
Estimate: 1 hour

Description

Add unit tests to verify single-namespace mode functionality works correctly.

Test Coverage

Operator Tests

  • Operator starts with SINGLE_NAMESPACE_MODE=true
  • Namespace watcher is NOT started in single-namespace mode
  • watchAgenticSessions uses namespace-scoped watch
  • watchProjectSettings uses namespace-scoped watch
  • PVC created with configured storage class
  • Pod security context included in Job template

Backend Tests

  • CreateProject returns 501 when SINGLE_NAMESPACE_MODE=true
  • CreateProject works normally when SINGLE_NAMESPACE_MODE=false
  • Error message format is correct

Acceptance Criteria

  • All tests pass
  • Code coverage maintained or improved
  • Tests run in CI pipeline

Files Changed

  • components/operator/main_test.go (create if needed)
  • components/backend/internal/handlers/projects_test.go

Branch

feature/mpp-single-namespace-mode

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions