fix: time-sensitive tests use savepoint pattern, avoid 48h auto-approval boundary
CI / Env docs check (push) Successful in 17s
CI / Docker compose check (push) Successful in 19s
CI / Nginx config check (push) Successful in 20s
CI / Frontend deps check (push) Successful in 27s
CI / Frontend major deps (push) Failing after 27s
CI / Secrets scan (push) Successful in 39s
CI / Go build (push) Successful in 40s
CI / Frontend build (push) Successful in 43s
CI / Knip (push) Successful in 41s
CI / Frontend a11y check (push) Successful in 1m37s
CI / Go vet (prod) (push) Successful in 1m53s
CI / go mod tidy (push) Successful in 31s
CI / Frontend QC (audit) (push) Successful in 51s
CI / Go vet (dev) (push) Successful in 2m50s
CI / Staticcheck (prod) (push) Successful in 2m57s
CI / Staticcheck (dev) (push) Successful in 3m19s
CI / Go vulnerabilities (push) Successful in 1m35s
CI / golangci-lint (push) Successful in 3m37s
CI / Frontend QC (typecheck) (push) Successful in 1m35s
CI / Security scan (prod) (push) Successful in 4m10s
CI / Security scan (dev) (push) Successful in 4m38s
CI / Frontend QC (lint) (push) Successful in 1m58s
CI / Svelte strict check (push) Successful in 1m12s
CI / Tests (prod) (push) Successful in 3m8s
CI / Tests (dev) (push) Failing after 4m8s
CI / Race (prod) (push) Successful in 7m34s
CI / Race (dev) (push) Failing after 7m40s

This commit is contained in:
2026-07-11 10:14:12 +01:00
parent ae2acc45c3
commit abd53baf35
3 changed files with 3 additions and 8 deletions
@@ -1577,7 +1577,7 @@ func TestAdminApproveEditRequestHandler_OverlapWithBooking(t *testing.T) {
// Create first booking at time T // Create first booking at time T
// Use a start time <48h away so auto-approval doesn't trigger at request- // Use a start time <48h away so auto-approval doesn't trigger at request-
// creation time, allowing us to test the approval-time overlap check. // creation time, allowing us to test the approval-time overlap check.
baseTime := clock.Now().Add(40 * time.Hour).Truncate(time.Second) baseTime := clock.Now().Add(24 * time.Hour).Truncate(time.Second)
baseTime = time.Date(baseTime.Year(), baseTime.Month(), baseTime.Day(), 9, 0, 0, 0, baseTime.Location()) baseTime = time.Date(baseTime.Year(), baseTime.Month(), baseTime.Day(), 9, 0, 0, 0, baseTime.Location())
booking1, err := fixtures.CreateTestBooking(tx, userID, serviceID) booking1, err := fixtures.CreateTestBooking(tx, userID, serviceID)
+1 -1
View File
@@ -1853,7 +1853,7 @@ func TestAdminApproveEditRequest_EvictsPendingRelease(t *testing.T) {
dur := durationMinutes(t, ctx, tx, serviceID) dur := durationMinutes(t, ctx, tx, serviceID)
// Use a booking <48h from now so RequestEdit does NOT auto-approve // Use a booking <48h from now so RequestEdit does NOT auto-approve
nearTime := clock.Now().Add(40 * time.Hour).Truncate(time.Second) nearTime := clock.Now().Add(24 * time.Hour).Truncate(time.Second)
nearTime = time.Date(nearTime.Year(), nearTime.Month(), nearTime.Day(), 10, 0, 0, 0, nearTime.Location()) nearTime = time.Date(nearTime.Year(), nearTime.Month(), nearTime.Day(), 10, 0, 0, 0, nearTime.Location())
bookingA, err := fixtures.CreateTestBookingAtTime(tx, userID, serviceID, nearTime) bookingA, err := fixtures.CreateTestBookingAtTime(tx, userID, serviceID, nearTime)
+1 -6
View File
@@ -731,13 +731,8 @@ func TestGetCurrentNext_WithMultipleDataPoints(t *testing.T) {
} }
addBookingService(t, ctx, tx, booking2ID, svcID) addBookingService(t, ctx, tx, booking2ID, svcID)
// Commit the transaction so the handler (which manages its own db.Conn tx) can see the data.
if err := tx.(interface{ Commit(context.Context) error }).Commit(context.Background()); err != nil {
t.Fatalf("failed to commit test data: %v", err)
}
req := httptest.NewRequest(http.MethodGet, "/api/admin/today/current-next", nil) req := httptest.NewRequest(http.MethodGet, "/api/admin/today/current-next", nil)
req = req.WithContext(context.Background()) req = req.WithContext(ctx)
rr := httptest.NewRecorder() rr := httptest.NewRecorder()
GetCurrentAndNextHandler(rr, req) GetCurrentAndNextHandler(rr, req)