Skip to content

[Good First Issue] Add pytest tests for milestone CRUD endpoints #3

@jaytoone

Description

@jaytoone

What needs to be done

Add end-to-end tests for the core milestone CRUD endpoints in server.py.

Currently there is no test suite. We need at least:

  • POST /api/northstar/{proj}/milestones — create stone, verify default status=queued
  • PATCH /api/northstar/{proj}/milestones/{mid} — status update
  • DELETE /api/northstar/{proj}/milestones/{mid} — verify removal

Use pytest + httpx.AsyncClient (already in the dependency graph via FastAPI test client).

Why it matters

Every refactor is currently manual-tested. A basic test suite will catch regressions before they reach production (where this runs live 24/7).

Acceptance criteria

  • hub/tests/test_milestones.py exists and passes python -m pytest hub/tests/
  • Tests use an in-memory SQLite db (not production ns-events.db)
  • At least 3 CRUD test cases covered
  • CI-friendly (no tmux, no external services needed)

Estimated effort

2-4 hours for someone comfortable with FastAPI + pytest.

Helpful context

  • Main server: hub/hub/server.py
  • Endpoint prefix: /api/northstar/{proj}/milestones
  • See ARCHITECTURE.md for data model overview
  • Existing stub dir: hub/tests/ (currently empty)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions