test: run the MCP client against the real API in CI

Aperta
#411 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
56/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp, github-actions, sqlite
Ambito
api, ci-cd, testing

Direzione di ricerca

Start by reading CLAUDE.md, the TaskFlow.Api and TaskFlow.Mcp projects, and the existing CI workflow to see how tests are run. The issue names WebApplicationFactory and a temporary SQLite database as the test harness; add coverage for the listed client operations and run the documented one-command check. Done means the acceptance criteria pass, including a CI run on every PR.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Part of nevridge/TaskFlow#397. Blocked by nevridge/TaskFlow#398. This replaces the earlier options (OpenAPI snapshot, throwaway container, process rule), because the API and client now share a repo.

Problem

ApiModels.cs and TaskFlowApiClient.cs are hand-written, and the tests use hand-written fixtures. They pass against a shape the API no longer has, which is how #238, #310 and #351 drifted unnoticed.

Scope

  • Add a test project that references TaskFlow.Api and TaskFlow.Mcp and hosts the real API in-process with WebApplicationFactory and a temporary SQLite database.
  • TaskFlow has no such harness today. It needs Microsoft.AspNetCore.Mvc.Testing, and Program must be made visible to the tests.
  • Point TaskFlowApiClient at the test server's HttpClient.
  • Exercise create, update, plan, complete, block and unblock, plus reading the journal, through the client.
  • Run it in CI on every PR, with no path filter, so API-only PRs run it too.
  • Keep TaskFlow.Mcp free of any reference to TaskFlow.Api. Only the test project references both.

Acceptance criteria

  1. Re-introducing the DateTime due date makes a test fail.
  2. Renaming or removing a response field the client reads makes a test fail.
  3. The check runs locally with one command, which is documented in CLAUDE.md.
  4. The API coverage threshold is unaffected.
Lingua principale
C#
Stelle
1
Fork
0
Merge medio
2h 2m
PR unite (30g)
98

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nevridge/TaskFlow

Tutte le issue di nevridge/TaskFlow

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.