hub v0.137.0 source + burn-down round 2 in felhom.eu: R-277 R-581 R-600 R-544 R-855 R-134 R-92 R-292 R-599 R-725 R-728 (hub), R-819 R-857 R-555 R-364 R-587 (gates/tools), R-571 R-129 R-124-runbook (docs); 28 rows closed incl. catalog + agent v0.147.0 rows, R-350 merged into R-132, R-888 opened, R-887 mechanism (249 -> 222)
gates / gates (push) Successful in 2m3s
gates / gates (push) Successful in 2m3s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -18,6 +18,7 @@ package web
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
@@ -621,3 +622,46 @@ func TestR688_PreviewNamesCloudflareByHand(t *testing.T) {
|
||||
t.Fatal("the dialog does not render the manual-removal list")
|
||||
}
|
||||
}
|
||||
|
||||
// ── R-600: the cascade asks for the WG peer push at once, and its COMPLETE line says it is pending ───
|
||||
|
||||
func TestDeleteCascade_TriggersWGPeerPushAndSaysSo(t *testing.T) {
|
||||
s, st := newTestServer(t)
|
||||
seedDeletable(t, st, "acme")
|
||||
s.SetTenantSync(&orderTenancy{})
|
||||
var logBuf strings.Builder
|
||||
s.logger = log.New(&logBuf, "", 0)
|
||||
triggers := 0
|
||||
s.SetWGPeerSync(func() { triggers++ })
|
||||
|
||||
rr := postDelete(t, s, "acme", cascadeForm("acme", 1))
|
||||
if rr.Code != http.StatusSeeOther {
|
||||
t.Fatalf("status = %d, want 303: %s", rr.Code, rr.Body.String())
|
||||
}
|
||||
if triggers != 1 {
|
||||
t.Fatalf("WG peer-sync triggers = %d, want exactly 1 (the endpoint must drop the peer now, not on the next tick)", triggers)
|
||||
}
|
||||
out := logBuf.String()
|
||||
if strings.Contains(out, "full teardown") {
|
||||
t.Errorf("COMPLETE line still claims a full teardown while the endpoint push is pending:\n%s", out)
|
||||
}
|
||||
if !strings.Contains(out, "WG peer removal push requested") {
|
||||
t.Errorf("COMPLETE line must name the pending peer push:\n%s", out)
|
||||
}
|
||||
}
|
||||
|
||||
// Without peer-sync configured, the line says the endpoint was NOT updated (never "full teardown").
|
||||
func TestDeleteCascade_NoWGPeerSyncSaysEndpointNotUpdated(t *testing.T) {
|
||||
s, st := newTestServer(t)
|
||||
seedDeletable(t, st, "acme")
|
||||
s.SetTenantSync(&orderTenancy{})
|
||||
var logBuf strings.Builder
|
||||
s.logger = log.New(&logBuf, "", 0)
|
||||
|
||||
if rr := postDelete(t, s, "acme", cascadeForm("acme", 1)); rr.Code != http.StatusSeeOther {
|
||||
t.Fatalf("status = %d, want 303", rr.Code)
|
||||
}
|
||||
if out := logBuf.String(); !strings.Contains(out, "endpoint's peer list was NOT updated") || strings.Contains(out, "full teardown") {
|
||||
t.Errorf("unwired peer-sync must be named in the COMPLETE line:\n%s", out)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user