1
0
mirror of https://github.com/openshift/image-registry.git synced 2026-02-05 09:45:55 +01:00

chore: address vet after bumping library-go

when we bump library-go the function diff.ObjectGoPrintDiff vanished. we
need to replace it with diff.ObjectGoPrintSideBySide on all test files.
This commit is contained in:
Ricardo Maraschini
2026-01-15 17:49:49 +01:00
parent fcb7f1f970
commit 94dae5f64f
5 changed files with 13 additions and 13 deletions

View File

@@ -137,15 +137,15 @@ func TestUnmarshalManifestSchema1(t *testing.T) {
}
if sm.Name != tc.expectedName {
t.Errorf("got unexpected image name: %s", diff.ObjectGoPrintDiff(sm.Name, tc.expectedName))
t.Errorf("got unexpected image name: %s", diff.ObjectGoPrintSideBySide(sm.Name, tc.expectedName))
}
if sm.Tag != tc.expectedTag {
t.Errorf("got unexpected image tag: %s", diff.ObjectGoPrintDiff(sm.Tag, tc.expectedTag))
t.Errorf("got unexpected image tag: %s", diff.ObjectGoPrintSideBySide(sm.Tag, tc.expectedTag))
}
refs := manifest.References()
if !reflect.DeepEqual(refs, tc.expectedReferences) {
t.Errorf("got unexpected image references: %s", diff.ObjectGoPrintDiff(refs, tc.expectedReferences))
t.Errorf("got unexpected image references: %s", diff.ObjectGoPrintSideBySide(refs, tc.expectedReferences))
}
signatures, err := sm.Signatures()
@@ -153,7 +153,7 @@ func TestUnmarshalManifestSchema1(t *testing.T) {
t.Fatalf("failed to get manifest signatures: %v", err)
}
if !reflect.DeepEqual(signatures, tc.expectedSignatures) {
t.Errorf("got unexpected image signatures: %s", diff.ObjectGoPrintDiff(signatures, tc.expectedSignatures))
t.Errorf("got unexpected image signatures: %s", diff.ObjectGoPrintSideBySide(signatures, tc.expectedSignatures))
for i, sig := range signatures {
t.Logf("signature #%d: %#v", i, string(sig))

View File

@@ -65,12 +65,12 @@ func TestUnmarshalManifestSchema2(t *testing.T) {
}
if !reflect.DeepEqual(dm.Config, tc.expectedConfig) {
t.Errorf("got unexpected image config descriptor: %s", diff.ObjectGoPrintDiff(dm.Config, tc.expectedConfig))
t.Errorf("got unexpected image config descriptor: %s", diff.ObjectGoPrintSideBySide(dm.Config, tc.expectedConfig))
}
refs := dm.References()
if !reflect.DeepEqual(refs, tc.expectedReferences) {
t.Errorf("got unexpected image references: %s", diff.ObjectGoPrintDiff(refs, tc.expectedReferences))
t.Errorf("got unexpected image references: %s", diff.ObjectGoPrintSideBySide(refs, tc.expectedReferences))
}
})
}

View File

@@ -337,10 +337,10 @@ func TestRepositoryBlobStat(t *testing.T) {
t.Fatalf("got unexpected non-error")
}
if !reflect.DeepEqual(err, tc.expectedError) {
t.Fatalf("got unexpected error: %s", diff.ObjectGoPrintDiff(err, tc.expectedError))
t.Fatalf("got unexpected error: %s", diff.ObjectGoPrintSideBySide(err, tc.expectedError))
}
if tc.expectedError == nil && !reflect.DeepEqual(desc, tc.expectedDescriptor) {
t.Fatalf("got unexpected descriptor: %s", diff.ObjectGoPrintDiff(desc, tc.expectedDescriptor))
t.Fatalf("got unexpected descriptor: %s", diff.ObjectGoPrintSideBySide(desc, tc.expectedDescriptor))
}
compareActions(t, tc.name, imageClient.Actions(), tc.expectedActions)

View File

@@ -222,7 +222,7 @@ func TestIdentifyCandidateRepositories(t *testing.T) {
if !reflect.DeepEqual(repositories, tc.expectedRepositories) {
if len(repositories) != 0 || len(tc.expectedRepositories) != 0 {
t.Errorf("[%s] got unexpected repositories: %s", tc.name, diff.ObjectGoPrintDiff(repositories, tc.expectedRepositories))
t.Errorf("[%s] got unexpected repositories: %s", tc.name, diff.ObjectGoPrintSideBySide(repositories, tc.expectedRepositories))
}
}
@@ -230,7 +230,7 @@ func TestIdentifyCandidateRepositories(t *testing.T) {
if expSpec, exists := tc.expectedSearch[repo]; !exists {
t.Errorf("[%s] got unexpected repository among results: %q: %#+v", tc.name, repo, spec)
} else if !reflect.DeepEqual(spec, expSpec) {
t.Errorf("[%s] got unexpected pull spec for repo %q: %s", tc.name, repo, diff.ObjectGoPrintDiff(spec, expSpec))
t.Errorf("[%s] got unexpected pull spec for repo %q: %s", tc.name, repo, diff.ObjectGoPrintSideBySide(spec, expSpec))
}
}
for expRepo, expSpec := range tc.expectedSearch {

View File

@@ -264,7 +264,7 @@ func AssertManifestsEqual(t *testing.T, description string, ma distribution.Mani
}
if !reflect.DeepEqual(va, vb) {
t.Fatalf("[%s] manifests are of different version: %s", description, diff.ObjectGoPrintDiff(va, vb))
t.Fatalf("[%s] manifests are of different version: %s", description, diff.ObjectGoPrintSideBySide(va, vb))
}
switch va.SchemaVersion {
@@ -278,12 +278,12 @@ func AssertManifestsEqual(t *testing.T, description string, ma distribution.Mani
t.Fatalf("[%s] failed to convert first manifest (%T) to schema1.SignedManifest", description, mb)
}
if !reflect.DeepEqual(ms1a.Manifest, ms1b.Manifest) {
t.Fatalf("[%s] manifests don't match: %s", description, diff.ObjectGoPrintDiff(ms1a.Manifest, ms1b.Manifest))
t.Fatalf("[%s] manifests don't match: %s", description, diff.ObjectGoPrintSideBySide(ms1a.Manifest, ms1b.Manifest))
}
case 2:
if !reflect.DeepEqual(ma, mb) {
t.Fatalf("[%s] manifests don't match: %s", description, diff.ObjectGoPrintDiff(ma, mb))
t.Fatalf("[%s] manifests don't match: %s", description, diff.ObjectGoPrintSideBySide(ma, mb))
}
default: