Skip to content

Commit 39fae66

Browse files
authored
fix: pick-cherry for fix unit (#208)
* feat: fix upgradable app sort * fix ut
1 parent e9c73a1 commit 39fae66

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

pkg/docker/digest_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ func TestGetManifest2(t *testing.T) {
104104
runtime.GC()
105105
}()
106106

107-
manifest, contentType, err := docker.GetManifest(context.Background(), "wangxiaohu/brother-cups:latest")
107+
manifest, contentType, err := docker.GetManifest(context.Background(), "correctroad/logseq:latest")
108108
assert.NilError(t, err)
109-
assert.Equal(t, contentType, schema1.MediaTypeSignedManifest)
109+
assert.Equal(t, contentType, "application/vnd.docker.distribution.manifest.v2+json")
110110

111111
var signedManifest schema1.SignedManifest
112112
decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{Result: &signedManifest, Squash: true})
@@ -115,7 +115,6 @@ func TestGetManifest2(t *testing.T) {
115115
err = decoder.Decode(manifest)
116116
assert.NilError(t, err)
117117

118-
assert.Assert(t, len(signedManifest.Architecture) > 0)
119118
}
120119

121120
func TestGetManifest3(t *testing.T) {

route/v2/appstore.go

+6
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,12 @@ func (a *AppManagement) UpgradableAppList(ctx echo.Context) error {
473473
})
474474
}
475475
}
476+
477+
// sort upgradableAppList by title
478+
sort.Slice(upgradableAppList, func(i, j int) bool {
479+
return strings.Compare(upgradableAppList[i].Title, upgradableAppList[j].Title) < 0
480+
})
481+
476482
return ctx.JSON(http.StatusOK, codegen.UpgradableAppListOK{
477483
Data: &upgradableAppList,
478484
})

0 commit comments

Comments
 (0)