Skip to content

Commit b5b1c47

Browse files
committed
more TestIsStale fixing, run tests w/ -race
1 parent 80a0d17 commit b5b1c47

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ GIT_COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
1010
BUILD_DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
1111
LDFLAGS := -X main.version=$(GIT_VERSION) -X main.commit=$(GIT_COMMIT) -X main.date=$(BUILD_DATE)
1212

13-
.PHONY: all build clean deps run app-bundle install install-darwin install-unix install-windows
13+
.PHONY: all build clean deps run app-bundle install install-darwin install-unix install-windows test
14+
15+
test:
16+
go test -race ./...
1417

1518
# Default target
1619
all: build

cmd/goose/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func TestIsStale(t *testing.T) {
4747
// isStale was inlined - test the logic directly
4848
// Use the same 'now' for consistency
4949
threshold := now.Add(-stalePRThreshold)
50-
got := tt.time.Before(threshold)
50+
got := !tt.time.After(threshold) // time <= threshold means stale (>= 90 days old)
5151
if got != tt.expected {
5252
t.Logf("Test time: %v, Threshold: %v, Before: %v", tt.time, threshold, got)
5353
t.Errorf("stale check = %v, want %v", got, tt.expected)

0 commit comments

Comments
 (0)