Skip to content

Commit

Permalink
Add test to increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasgun committed Apr 11, 2022
1 parent f0cc55a commit 1f7fe7b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/serving/config_changes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,17 @@ func TestPinImageToDigestNilContainerStatus(t *testing.T) {
assert.NilError(t, err)
}

func TestPinImageToDigestNilContainerSpec(t *testing.T) {
template, _ := getRevisionTemplate()
template.Spec.Containers = nil
revision := &servingv1.Revision{}
revision.Spec = template.Spec
revision.ObjectMeta = template.ObjectMeta
revision.Status.ContainerStatuses = nil
err := PinImageToDigest(template, revision)
assert.ErrorContains(t, err, "no container given in current revision")
}

func TestUpdateTimestampAnnotation(t *testing.T) {
template, _ := getRevisionTemplate()
UpdateTimestampAnnotation(template)
Expand Down

0 comments on commit 1f7fe7b

Please sign in to comment.