chore: fix unchecked errors in test setup and assertions

Aperta
#73 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à
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
go
Ambito
testing

Direzione di ricerca

Start by reading internal/agentkit/agentkit_test.go for the error-checking pattern, then review the listed test files and run their Go tests. Check every listed setup and assertion error, strengthen TestRunInit_ForceOverwrites to assert the expected content, and add coverage for WorktreeCleanup with cleanupAll=true; done means those cases are checked and the affected tests pass.

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

Descrizione

cleanup

Context

Review council on PR #61 flagged systematic unchecked errors in test setup and assertion code across multiple test files. These are pre-existing issues, not regressions from #61.

Files

  • cmd/replicator/init_test.go — os.MkdirAll, os.WriteFile, os.ReadFile errors discarded
  • cmd/replicator/serve_test.go — os.MkdirAll, os.WriteFile errors discarded
  • internal/gitutil/git_test.go — WorktreeAdd, os.WriteFile, Run errors discarded
  • internal/forge/worktree_test.go — WorktreeCreate, os.WriteFile, Run errors discarded
  • internal/forge/init_test.go, spawn_test.go, review_test.go, progress_test.go, insights_test.go — DB.Exec, DB.QueryRow().Scan() errors discarded
  • internal/mcp/server_test.go — json.Unmarshal errors discarded in assertions
  • test/parity/parity_test.go — json.Unmarshal errors discarded in setup

Pattern

Replace os.WriteFile(path, data, 0o644) with:

if err := os.WriteFile(path, data, 0o644); err != nil {
    t.Fatalf("setup WriteFile: %v", err)
}

The fix in internal/agentkit/agentkit_test.go (PR #61) shows the correct pattern.

Additional items

  • cmd/replicator/init_test.go:TestRunInit_ForceOverwrites uses a negative-only assertion (checks content is different but not what it should be). Should assert equality with embedded content.
  • internal/forge/worktree_test.go has no test for the cleanupAll=true branch of WorktreeCleanup, contributing to CRAP score 65.9.
Lingua principale
Go
Stelle
0
Fork
9
Merge medio
1g 14h
PR unite (30g)
18

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 unbound-force/replicator

Tutte le issue di unbound-force/replicator

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.