MCPcopy Create free account
hub / github.com/conforma/cli / TestTrackGitReferences

Function TestTrackGitReferences

internal/tracker/tracker_test.go:598–622  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

596}
597
598func 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
624func TestTrackGitReferencesWithoutCommitId(t *testing.T) {
625 tracker := &Tracker{

Callers

nothing calls this directly

Calls 2

trackGitReferencesMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected