(t *testing.T)
| 596 | } |
| 597 | |
| 598 | func TestTrackGitReferences(t *testing.T) { |
| 599 | tracker := &Tracker{ |
| 600 | TrustedTasks: make(map[string][]taskRecord), |
| 601 | } |
| 602 | |
| 603 | require.NoError(t, tracker.trackGitReferences(context.Background(), []string{ |
| 604 | "git+https://git.io/organization/repository//task1.yaml@rev1", |
| 605 | "git+ssh://got.io/organization/repository//dir/task2.yaml@rev2", |
| 606 | }, false)) |
| 607 | |
| 608 | expected := map[string][]taskRecord{ |
| 609 | "git+https://git.io/organization/repository//task1.yaml": {{ |
| 610 | Ref: "rev1", |
| 611 | Repository: "git+https://git.io/organization/repository//task1.yaml", |
| 612 | }}, |
| 613 | "git+ssh://got.io/organization/repository//dir/task2.yaml": {{ |
| 614 | Ref: "rev2", |
| 615 | Repository: "git+ssh://got.io/organization/repository//dir/task2.yaml", |
| 616 | }}, |
| 617 | } |
| 618 | |
| 619 | if !cmp.Equal(tracker.TrustedTasks, expected) { |
| 620 | t.Errorf("expected vs got: %s", cmp.Diff(tracker.TrustedTasks, expected)) |
| 621 | } |
| 622 | } |
| 623 | |
| 624 | func TestTrackGitReferencesWithoutCommitId(t *testing.T) { |
| 625 | tracker := &Tracker{ |
nothing calls this directly
no test coverage detected