Skip to content

Commit

Permalink
tidy up tagscan tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aditditto authored and weyfonk committed Mar 12, 2024
1 parent 43e88a8 commit 6789fb9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/cmd/controller/imagescan/tagscan_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import (
fleet "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/v1alpha1"
)

var alphabeticalVersions = []string{"a", "b", "c"}

func TestLatestTag(t *testing.T) {
var alphabeticalVersions = []string{"a", "b", "c"}

tests := []struct{
name, want string
policy fleet.ImagePolicyChoice
Expand Down Expand Up @@ -47,7 +48,7 @@ func TestLatestTag(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
got, err := latestTag(tt.policy, alphabeticalVersions)
if err != nil {
t.Errorf("Error calling latestTag: %v", err)
t.Fatalf("Error calling latestTag: %v", err)
}

if got != tt.want {
Expand Down

0 comments on commit 6789fb9

Please sign in to comment.