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

Function TestService_ProcessComponentVSA

internal/validate/vsa/service_test.go:144–175  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

142}
143
144func TestService_ProcessComponentVSA(t *testing.T) {
145 ctx := context.Background()
146 fs := afero.NewMemMapFs()
147
148 // Create test data
149 report := applicationsnapshot.Report{
150 Success: true,
151 Policy: ecc.EnterpriseContractPolicySpec{},
152 }
153
154 comp := applicationsnapshot.Component{
155 SnapshotComponent: app.SnapshotComponent{
156 Name: "test-component",
157 ContainerImage: "quay.io/test/image:tag",
158 },
159 Success: true,
160 Violations: []evaluator.Result{},
161 Warnings: []evaluator.Result{},
162 Successes: []evaluator.Result{{Message: "test success"}},
163 }
164
165 // Create test signer
166 signer := testSigner("/test.key", fs)
167 service := NewServiceWithFS(signer, fs, "https://github.com/test/policy", nil, "vsa-")
168
169 // Test successful processing
170 envelopePath, err := service.ProcessComponentVSA(ctx, report, comp, "https://github.com/test/repo", "sha256:testdigest")
171
172 assert.NoError(t, err)
173 assert.NotEmpty(t, envelopePath)
174 assert.Contains(t, envelopePath, ".intoto.jsonl")
175}
176
177func TestService_ProcessSnapshotVSA(t *testing.T) {
178 ctx := context.Background()

Callers

nothing calls this directly

Calls 3

testSignerFunction · 0.85
NewServiceWithFSFunction · 0.85
ProcessComponentVSAMethod · 0.80

Tested by

no test coverage detected