(t *testing.T)
| 296 | } |
| 297 | |
| 298 | func TestGetRecentCommits(t *testing.T) { |
| 299 | origin := newLocalGitRepo(t) |
| 300 | r := &SourceRepositoryReconciler{} |
| 301 | |
| 302 | commits, err := r.getRecentCommits(context.Background(), origin) |
| 303 | if err != nil { |
| 304 | t.Fatalf("getRecentCommits: %v", err) |
| 305 | } |
| 306 | if len(commits) != 1 { |
| 307 | t.Fatalf("expected 1 commit, got %d", len(commits)) |
| 308 | } |
| 309 | c := commits[0] |
| 310 | if len(c.SHA) != 40 { |
| 311 | t.Errorf("SHA length = %d, want 40", len(c.SHA)) |
| 312 | } |
| 313 | if c.Message != "feat: initial commit" || c.Author != "test" { |
| 314 | t.Errorf("unexpected commit metadata: %+v", c) |
| 315 | } |
| 316 | if c.Timestamp.IsZero() { |
| 317 | t.Error("commit timestamp was not parsed") |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | func TestPullRepo(t *testing.T) { |
| 322 | r := &SourceRepositoryReconciler{} |
nothing calls this directly
no test coverage detected