mirror of
https://github.com/slsa-framework/slsa-verifier.git
synced 2026-08-18 02:56:31 +00:00
replace unneeded t.Errorf
Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
This commit is contained in:
@@ -864,7 +864,7 @@ func Test_runVerifyGHAArtifactImage(t *testing.T) {
|
||||
|
||||
outBuilderID, err := cmd.Exec(context.Background(), []string{image})
|
||||
if !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
@@ -1332,7 +1332,7 @@ func Test_runVerifyGCBArtifactImage(t *testing.T) {
|
||||
outBuilderID, err := cmd.Exec(context.Background(), []string{image})
|
||||
|
||||
if !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
||||
@@ -215,7 +215,7 @@ func Test_VerifyBuilder(t *testing.T) {
|
||||
}
|
||||
outBuilderID, err := prov.VerifyBuilder(&builderOpts)
|
||||
if !cmp.Equal(err, tt.expected, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
@@ -313,7 +313,7 @@ func Test_validateBuildType(t *testing.T) {
|
||||
}
|
||||
err = validateBuildType(*builderID, tt.buildType)
|
||||
if !cmp.Equal(err, tt.expected, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -579,7 +579,7 @@ func Test_VerifySourceURI(t *testing.T) {
|
||||
}
|
||||
err = prov.VerifySourceURI(tt.source, *builderID)
|
||||
if !cmp.Equal(err, tt.expected, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -704,7 +704,7 @@ func Test_VerifySignature(t *testing.T) {
|
||||
|
||||
err = prov.VerifySignature()
|
||||
if !cmp.Equal(err, tt.expected, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -745,7 +745,7 @@ func Test_ProvenanceFromBytes(t *testing.T) {
|
||||
|
||||
_, err = ProvenanceFromBytes(content)
|
||||
if !cmp.Equal(err, tt.expected, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -810,7 +810,7 @@ func Test_VerifySubjectDigest(t *testing.T) {
|
||||
|
||||
err = prov.VerifySubjectDigest(tt.hash)
|
||||
if !cmp.Equal(err, tt.expected, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -889,7 +889,7 @@ func Test_VerifySummary(t *testing.T) {
|
||||
}
|
||||
err = prov.VerifySummary(&provenanceOpts)
|
||||
if !cmp.Equal(err, tt.expected, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -970,7 +970,7 @@ func Test_VerifyMetadata(t *testing.T) {
|
||||
}
|
||||
err = prov.VerifyMetadata(&provenanceOpts)
|
||||
if !cmp.Equal(err, tt.expected, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1038,7 +1038,7 @@ func Test_VerifyTextProvenance(t *testing.T) {
|
||||
if !tt.alter {
|
||||
err = prov.VerifyTextProvenance()
|
||||
if !cmp.Equal(err, tt.expected, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -1110,7 +1110,7 @@ func Test_VerifyTextProvenance(t *testing.T) {
|
||||
|
||||
err = prov.VerifyTextProvenance()
|
||||
if !cmp.Equal(err, tt.expected, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
}
|
||||
// Start with the original string value.
|
||||
patch = []byte(strings.Clone(string(cpy)))
|
||||
@@ -1184,7 +1184,7 @@ func Test_VerifyBranch(t *testing.T) {
|
||||
|
||||
err = prov.VerifyBranch(tt.branch)
|
||||
if !cmp.Equal(err, tt.expected, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1297,7 +1297,7 @@ func Test_VerifyTag(t *testing.T) {
|
||||
|
||||
err = prov.VerifyTag(tt.tag)
|
||||
if !cmp.Equal(err, tt.err, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1496,7 +1496,7 @@ func Test_VerifyVersionedTag(t *testing.T) {
|
||||
|
||||
err = prov.VerifyVersionedTag(tt.tag)
|
||||
if !cmp.Equal(err, tt.err, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ func Test_New(t *testing.T) {
|
||||
fmt.Println(string(content))
|
||||
_, err = New(content)
|
||||
if !cmp.Equal(err, tt.expected, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -107,10 +107,10 @@ func Test_getSubstitutionsField(t *testing.T) {
|
||||
|
||||
value, err := getSubstitutionsField(internalParemeters, tt.field)
|
||||
if !cmp.Equal(err, tt.err, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
|
||||
}
|
||||
if err == nil && !cmp.Equal(value, tt.value) {
|
||||
t.Errorf(cmp.Diff(value, tt.value))
|
||||
t.Error(cmp.Diff(value, tt.value))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -57,10 +57,10 @@ func Test_getSubstitutionsField(t *testing.T) {
|
||||
|
||||
value, err := getSubstitutionsField(internalParemeters, tt.field)
|
||||
if !cmp.Equal(err, tt.err, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
|
||||
}
|
||||
if err == nil && !cmp.Equal(value, tt.value) {
|
||||
t.Errorf(cmp.Diff(value, tt.value))
|
||||
t.Error(cmp.Diff(value, tt.value))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ func Test_isTrustedDelegatorBuilder(t *testing.T) {
|
||||
|
||||
res := isTrustedDelegatorBuilder(trustedBuilderID, tt.trustedBuilderIDs)
|
||||
if res != tt.result {
|
||||
t.Errorf(cmp.Diff(res, tt.result))
|
||||
t.Error(cmp.Diff(res, tt.result))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -442,7 +442,7 @@ func Test_VerifyCertficateSourceRepository(t *testing.T) {
|
||||
t.Parallel()
|
||||
err := VerifyCertficateSourceRepository(tt.workflow, tt.source)
|
||||
if !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -611,7 +611,7 @@ func Test_verifyTrustedBuilderID(t *testing.T) {
|
||||
t.Parallel()
|
||||
id, byob, err := verifyTrustedBuilderID(httpsGithubCom+tt.path, tt.tag, tt.id, tt.defaults)
|
||||
if byob != tt.byob {
|
||||
t.Errorf(cmp.Diff(byob, tt.byob))
|
||||
t.Error(cmp.Diff(byob, tt.byob))
|
||||
}
|
||||
if diff := cmp.Diff(tt.err, err, cmpopts.EquateErrors()); diff != "" {
|
||||
t.Fatalf("unexpected error (-want +got):\n%s", diff)
|
||||
@@ -817,7 +817,7 @@ func Test_verifyTrustedBuilderRef(t *testing.T) {
|
||||
|
||||
err := verifyTrustedBuilderRef(&wf, tt.builderRef)
|
||||
if !errCmp(err, tt.expected) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1267,14 +1267,14 @@ func Test_GetWorkflowInfoFromCertificate(t *testing.T) {
|
||||
t.Parallel()
|
||||
workflow, err := GetWorkflowInfoFromCertificate(&tt.cert)
|
||||
if !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
|
||||
}
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if !cmp.Equal(*workflow, tt.workflow) {
|
||||
t.Errorf(cmp.Diff(*workflow, tt.workflow))
|
||||
t.Error(cmp.Diff(*workflow, tt.workflow))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ func Test_verifyBundle(t *testing.T) {
|
||||
_, err = VerifyProvenanceBundle(ctx, content, trustedRoot)
|
||||
|
||||
if !errCmp(err, tt.expected) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected))
|
||||
t.Error(cmp.Diff(err, tt.expected))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ func Test_verifyName(t *testing.T) {
|
||||
err := verifyName(tt.actual, tt.expected)
|
||||
|
||||
if !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected))
|
||||
t.Error(cmp.Diff(err, tt.expected))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -425,7 +425,7 @@ func Test_verifyPublishSubjectName(t *testing.T) {
|
||||
err := verifyPublishSubjectName(tt.att, tt.subject)
|
||||
|
||||
if !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -491,7 +491,7 @@ func Test_verifyPublishPredicateName(t *testing.T) {
|
||||
err := verifyPublishPredicateName(tt.att, tt.subject)
|
||||
|
||||
if !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -568,7 +568,7 @@ func Test_verifyPublishPredicateVersion(t *testing.T) {
|
||||
err := verifyPublishPredicateVersion(tt.att, tt.version)
|
||||
|
||||
if !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -792,7 +792,7 @@ func Test_verifyPackageName(t *testing.T) {
|
||||
|
||||
err = npm.verifyPackageName(&tt.subject)
|
||||
if !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -869,7 +869,7 @@ func Test_verifyPublishAttestationSubjectDigest(t *testing.T) {
|
||||
|
||||
err = npm.verifyPublishAttestationSubjectDigest(tt.hash)
|
||||
if !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -951,7 +951,7 @@ func Test_verifyPackageVersion(t *testing.T) {
|
||||
|
||||
err = npm.verifyPackageVersion(&tt.version)
|
||||
if !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1060,7 +1060,7 @@ func Test_verifyIntotoTypes(t *testing.T) {
|
||||
|
||||
err := verifyIntotoTypes(tt.att, tt.predicateTypes, tt.payloadType, tt.prefix)
|
||||
if !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1148,7 +1148,7 @@ func Test_verifyIntotoHeaders(t *testing.T) {
|
||||
|
||||
err = npm.verifyIntotoHeaders()
|
||||
if !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ func Test_verifyPublishAttestationSubjectDigestName(t *testing.T) {
|
||||
subjects: tt.subject,
|
||||
}
|
||||
if err := verifyPublishAttestationSubjectDigestName(prov, tt.digestName); !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -109,7 +109,7 @@ func Test_verifyBuildConfig(t *testing.T) {
|
||||
buildTriggerPath: tt.path,
|
||||
}
|
||||
if err := verifyBuildConfig(prov, &tt.workflow); !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -146,7 +146,7 @@ func Test_verifyResolvedDependencies(t *testing.T) {
|
||||
noResolvedDeps: tt.n,
|
||||
}
|
||||
if err := verifyResolvedDependencies(prov); !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -245,7 +245,7 @@ func Test_verifyCommonMetadata(t *testing.T) {
|
||||
}
|
||||
|
||||
if err := verifyCommonMetadata(prov, &tt.workflow); !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -306,7 +306,7 @@ func Test_verifyV02Metadata(t *testing.T) {
|
||||
}
|
||||
}
|
||||
if err := verifyV02Metadata(prov02); !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -351,7 +351,7 @@ func Test_verifyV02Parameters(t *testing.T) {
|
||||
}
|
||||
err := verifyV02Parameters(prov02)
|
||||
if !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -396,7 +396,7 @@ func Test_verifyV02BuildConfig(t *testing.T) {
|
||||
}
|
||||
err := verifyV02BuildConfig(prov02)
|
||||
if !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -535,7 +535,7 @@ func Test_verifyMetadata(t *testing.T) {
|
||||
}
|
||||
|
||||
if err := verifyMetadata(prov02, &tt.workflow); !errCmp(err, tt.errV02) {
|
||||
t.Errorf(cmp.Diff(err, tt.errV02))
|
||||
t.Error(cmp.Diff(err, tt.errV02))
|
||||
}
|
||||
|
||||
prov1 := &testProvenanceV1{}
|
||||
@@ -550,7 +550,7 @@ func Test_verifyMetadata(t *testing.T) {
|
||||
}
|
||||
|
||||
if err := verifyMetadata(prov1, &tt.workflow); !errCmp(err, tt.errV01) {
|
||||
t.Errorf(cmp.Diff(err, tt.errV01))
|
||||
t.Error(cmp.Diff(err, tt.errV01))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -932,7 +932,7 @@ func Test_verifySystemParameters(t *testing.T) {
|
||||
}
|
||||
|
||||
if err := verifySystemParameters(prov, &tt.workflow); !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1084,7 +1084,7 @@ func Test_verifyProvenanceMatchesCertificate(t *testing.T) {
|
||||
}
|
||||
|
||||
if err := verifyProvenanceMatchesCertificate(prov, &tt.certificateIdentity); !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ func Test_VerifyDigest(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
if err := verifyDigest(tt.prov, tt.artifactHash); !errCmp(err, tt.expected) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected))
|
||||
t.Error(cmp.Diff(err, tt.expected))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -413,7 +413,7 @@ func Test_verifySourceURI(t *testing.T) {
|
||||
|
||||
err := verifySourceURI(prov02, tt.expectedSourceURI)
|
||||
if !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -493,7 +493,7 @@ func Test_isValidDelegatorBuilderID(t *testing.T) {
|
||||
|
||||
err := isValidDelegatorBuilderID(prov)
|
||||
if !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -553,7 +553,7 @@ func Test_verifyBuilderIDExactMatch(t *testing.T) {
|
||||
|
||||
err := verifyBuilderIDExactMatch(prov, tt.expectedID)
|
||||
if !errCmp(err, tt.err) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -619,7 +619,7 @@ func Test_VerifyBranch(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
if err := VerifyBranch(tt.prov, tt.branch); !errCmp(err, tt.expected) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected))
|
||||
t.Error(cmp.Diff(err, tt.expected))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -740,7 +740,7 @@ func Test_VerifyWorkflowInputs(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
if err := VerifyWorkflowInputs(tt.prov, tt.inputs); !errCmp(err, tt.expected) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected))
|
||||
t.Error(cmp.Diff(err, tt.expected))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -806,7 +806,7 @@ func Test_VerifyTag(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
if err := VerifyTag(tt.prov, tt.tag); !errCmp(err, tt.expected) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected))
|
||||
t.Error(cmp.Diff(err, tt.expected))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1223,7 +1223,7 @@ func Test_VerifyVersionedTag(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
if err := VerifyVersionedTag(tt.prov, tt.tag); !errCmp(err, tt.expected) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected))
|
||||
t.Error(cmp.Diff(err, tt.expected))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1309,7 +1309,7 @@ func Test_VerifyProvenance(t *testing.T) {
|
||||
}
|
||||
|
||||
if err := VerifyProvenance(env, tt.provenanceOpts, trustedBuilderID, tt.byob, tt.expectedID); !errCmp(err, tt.expected) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected))
|
||||
t.Error(cmp.Diff(err, tt.expected))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1362,7 +1362,7 @@ func Test_VerifyUntrustedProvenance(t *testing.T) {
|
||||
}
|
||||
|
||||
if err := VerifyProvenance(env, tt.provenanceOpts, trustedBuilderID, tt.byob, tt.expectedID); errCmp(err, tt.expected) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected))
|
||||
t.Error(cmp.Diff(err, tt.expected))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ func Test_GetRekorEntries(t *testing.T) {
|
||||
|
||||
_, err := getUUIDsByArtifactDigest(&mClient, tt.artifactHash)
|
||||
if !errCmp(err, tt.expected) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected))
|
||||
t.Error(cmp.Diff(err, tt.expected))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ func Test_ParseBuilderID(t *testing.T) {
|
||||
|
||||
name, version, err := ParseBuilderID(tt.builderID, tt.needVersion)
|
||||
if !cmp.Equal(err, tt.err, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
@@ -80,11 +80,11 @@ func Test_ParseBuilderID(t *testing.T) {
|
||||
}
|
||||
|
||||
if name != tt.builderName {
|
||||
t.Errorf(cmp.Diff(name, tt.builderName))
|
||||
t.Error(cmp.Diff(name, tt.builderName))
|
||||
}
|
||||
|
||||
if version != tt.builderVersion {
|
||||
t.Errorf(cmp.Diff(version, tt.builderVersion))
|
||||
t.Error(cmp.Diff(version, tt.builderVersion))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -170,7 +170,7 @@ func Test_BuilderIDNew(t *testing.T) {
|
||||
|
||||
trustedBuilderID, err := TrustedBuilderIDNew(tt.trustedBuilderID, tt.needVersion)
|
||||
if !cmp.Equal(err, tt.err, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
@@ -182,13 +182,13 @@ func Test_BuilderIDNew(t *testing.T) {
|
||||
full := trustedBuilderID.String()
|
||||
|
||||
if name != tt.builderName {
|
||||
t.Errorf(cmp.Diff(tt.builderName, name))
|
||||
t.Error(cmp.Diff(tt.builderName, name))
|
||||
}
|
||||
if version != tt.builderVersion {
|
||||
t.Errorf(cmp.Diff(tt.builderVersion, version))
|
||||
t.Error(cmp.Diff(tt.builderVersion, version))
|
||||
}
|
||||
if full != tt.trustedBuilderID {
|
||||
t.Errorf(cmp.Diff(tt.trustedBuilderID, full))
|
||||
t.Error(cmp.Diff(tt.trustedBuilderID, full))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -423,7 +423,7 @@ func Test_MatchesLoose(t *testing.T) {
|
||||
|
||||
err = trustedBuilderID.MatchesLoose(tt.match, tt.allowRef)
|
||||
if !cmp.Equal(err, tt.err, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -639,7 +639,7 @@ func Test_MatchesFull(t *testing.T) {
|
||||
|
||||
err = trustedBuilderID.MatchesFull(tt.match, tt.allowRef)
|
||||
if !cmp.Equal(err, tt.err, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -754,7 +754,7 @@ func Test_IsValidBuilderTag(t *testing.T) {
|
||||
t.Parallel()
|
||||
err := IsValidBuilderTag(tt.ref, tt.testing)
|
||||
if !cmp.Equal(err, tt.err, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -812,7 +812,7 @@ func Test_IsValidJreleaserBuilderTag(t *testing.T) {
|
||||
t.Parallel()
|
||||
err := IsValidJreleaserBuilderTag(tt.ref)
|
||||
if !cmp.Equal(err, tt.err, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.err))
|
||||
t.Error(cmp.Diff(err, tt.err))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -40,14 +40,14 @@ func Test_DecodeSignature(t *testing.T) {
|
||||
|
||||
c, err := DecodeSignature(tt.encoded)
|
||||
if !cmp.Equal(err, tt.expected, cmpopts.EquateErrors()) {
|
||||
t.Errorf(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
t.Error(cmp.Diff(err, tt.expected, cmpopts.EquateErrors()))
|
||||
}
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
cs := string(c)
|
||||
if cs != tt.decoded {
|
||||
t.Errorf(cmp.Diff(cs, tt.decoded))
|
||||
t.Error(cmp.Diff(cs, tt.decoded))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user