DELETE: IssueForge.RepliesAfter and its Reply type had no production caller -- the waiting_human status exists and is reachable, but automatic detection of a human reply never landed, so the intended poller was never built. Neither implementation paginated either (both read one page of 50), so the method would have been wrong if wired as-is. The manual path is untouched: waiting_human remains reachable and an operator requeues through the existing task-action flow. Removing the interface method also removes seven test fakes that existed only to satisfy it. No behavioural test accompanies this: a pure deletion has no assertion to make fail, and the compiler enforces completeness across every implementation.
67 lines
1.7 KiB
Go
67 lines
1.7 KiB
Go
package forge
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
)
|
|
|
|
func TestNewNoopDefaultsLogger(t *testing.T) {
|
|
f := NewNoop(nil)
|
|
if f == nil {
|
|
t.Fatal("NewNoop(nil) = nil, want non-nil Forge")
|
|
}
|
|
}
|
|
|
|
func TestNoopForgeIsAllZeroValue(t *testing.T) {
|
|
ctx := context.Background()
|
|
f := NewNoop(nil)
|
|
|
|
issues, err := f.AssignedIssues(ctx, "o", "r", "a")
|
|
if issues != nil || err != nil {
|
|
t.Errorf("AssignedIssues() = (%v, %v), want (nil, nil)", issues, err)
|
|
}
|
|
|
|
issues, err = f.IssuesWithLabel(ctx, "o", "r", "label")
|
|
if issues != nil || err != nil {
|
|
t.Errorf("IssuesWithLabel() = (%v, %v), want (nil, nil)", issues, err)
|
|
}
|
|
|
|
id, err := f.Comment(ctx, "o", "r", 1, "body")
|
|
if id != 0 || err != nil {
|
|
t.Errorf("Comment() = (%d, %v), want (0, nil)", id, err)
|
|
}
|
|
|
|
if err := f.CloseIssue(ctx, "o", "r", 1, "comment"); err != nil {
|
|
t.Errorf("CloseIssue() = %v, want nil", err)
|
|
}
|
|
|
|
if err := f.React(ctx, "o", "r", 1, "+1"); err != nil {
|
|
t.Errorf("React() = %v, want nil", err)
|
|
}
|
|
|
|
// SetStateLabel has no return value; just confirm it does not panic.
|
|
f.SetStateLabel(ctx, "o", "r", 1, "label", nil)
|
|
|
|
prNum, err := f.CreatePR(ctx, "o", "r", "title", "head", "base", "body")
|
|
if prNum != 0 || err != nil {
|
|
t.Errorf("CreatePR() = (%d, %v), want (0, nil)", prNum, err)
|
|
}
|
|
|
|
state, err := f.PRState(ctx, "o", "r", 1)
|
|
if state != "closed" || err != nil {
|
|
t.Errorf("PRState() = (%q, %v), want (\"closed\", nil)", state, err)
|
|
}
|
|
|
|
if err := f.AcceptInvitations(ctx); err != nil {
|
|
t.Errorf("AcceptInvitations() = %v, want nil", err)
|
|
}
|
|
|
|
if err := f.VerifyPush(ctx, "o", "r"); err != nil {
|
|
t.Errorf("VerifyPush() = %v, want nil", err)
|
|
}
|
|
|
|
if err := f.LinkBranch(ctx, "o", "r", 1, "branch"); err != nil {
|
|
t.Errorf("LinkBranch() = %v, want nil", err)
|
|
}
|
|
}
|