Skip to content

Commit aed2184

Browse files
committed
fix tests
1 parent b8d7e14 commit aed2184

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

cmd/validate/vsa_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2061,12 +2061,12 @@ func TestShortenImageDigest(t *testing.T) {
20612061
{
20622062
name: "image without digest, long ref",
20632063
imageRef: "registry.com/very/long/repository/path/image:tag",
2064-
expected: "…e:tag",
2064+
expected: "…mage:tag", // Last 8 characters
20652065
},
20662066
{
20672067
name: "image without digest, short ref",
20682068
imageRef: "image:tag",
2069-
expected: "image:tag",
2069+
expected: "…mage:tag", // 9 chars, so last 8 with ellipsis
20702070
},
20712071
{
20722072
name: "image ref with exactly 8 chars",
@@ -2124,9 +2124,9 @@ func TestExtractFallbackReason(t *testing.T) {
21242124
expected: "no vsa",
21252125
},
21262126
{
2127-
name: "no vsa found lowercase",
2127+
name: "no vsa found lowercase with capital VSA",
21282128
result: &vsa.ValidationResult{
2129-
Message: "no vsa found for image",
2129+
Message: "no VSA found for image",
21302130
},
21312131
expected: "no vsa",
21322132
},

internal/validate/report_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,9 +555,10 @@ func TestCollectComponentResults(t *testing.T) {
555555
func TestWriteReport(t *testing.T) {
556556
ctx := context.Background()
557557

558-
// Create a minimal policy
558+
// Create a minimal policy with a public key to avoid keyless workflow validation
559559
testPolicy, err := policy.NewPolicy(ctx, policy.Options{
560560
EffectiveTime: "now",
561+
PublicKey: "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECBtqKHcvxYkGx7ZXqps3nrYS+ZSA\nmh3m1MZfTGlnr2oN0z+sBWEC23s4RkVSXkEydI6SLYatUtJK8OmiBRS+Xw==\n-----END PUBLIC KEY-----",
561562
})
562563
require.NoError(t, err)
563564

0 commit comments

Comments
 (0)