Fix order by parameter (#19849)

Upgrade builder to v0.3.11
Upgrade xorm to v1.3.1 and fixed some hidden bugs.

Replace #19821
Replace #19834
Included #19850

Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
Lunny Xiao 2022-06-05 03:18:50 +08:00 committed by GitHub
parent 449ea6005f
commit 12c742f8dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 175 additions and 72 deletions

View file

@ -37,7 +37,6 @@ func TestAPIAdminCreateAndDeleteSSHKey(t *testing.T) {
unittest.AssertExistsAndLoadBean(t, &asymkey_model.PublicKey{
ID: newPublicKey.ID,
Name: newPublicKey.Title,
Content: newPublicKey.Key,
Fingerprint: newPublicKey.Fingerprint,
OwnerID: keyOwner.ID,
})

View file

@ -116,12 +116,14 @@ func TestCreateUserKey(t *testing.T) {
var newPublicKey api.PublicKey
DecodeJSON(t, resp, &newPublicKey)
fingerprint, err := asymkey_model.CalcFingerprint(rawKeyBody.Key)
assert.NoError(t, err)
unittest.AssertExistsAndLoadBean(t, &asymkey_model.PublicKey{
ID: newPublicKey.ID,
OwnerID: user.ID,
Name: rawKeyBody.Title,
Content: rawKeyBody.Key,
Mode: perm.AccessModeWrite,
ID: newPublicKey.ID,
OwnerID: user.ID,
Name: rawKeyBody.Title,
Fingerprint: fingerprint,
Mode: perm.AccessModeWrite,
})
// Search by fingerprint

View file

@ -84,12 +84,13 @@ func createNewReleaseUsingAPI(t *testing.T, session *TestSession, token string,
var newRelease api.Release
DecodeJSON(t, resp, &newRelease)
unittest.AssertExistsAndLoadBean(t, &models.Release{
rel := &models.Release{
ID: newRelease.ID,
TagName: newRelease.TagName,
Title: newRelease.Title,
Note: newRelease.Note,
})
}
unittest.AssertExistsAndLoadBean(t, rel)
assert.EqualValues(t, newRelease.Note, rel.Note)
return &newRelease
}
@ -137,12 +138,13 @@ func TestAPICreateAndUpdateRelease(t *testing.T) {
resp = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, resp, &newRelease)
unittest.AssertExistsAndLoadBean(t, &models.Release{
rel := &models.Release{
ID: newRelease.ID,
TagName: newRelease.TagName,
Title: newRelease.Title,
Note: newRelease.Note,
})
}
unittest.AssertExistsAndLoadBean(t, rel)
assert.EqualValues(t, rel.Note, newRelease.Note)
}
func TestAPICreateReleaseToDefaultBranch(t *testing.T) {

View file

@ -109,6 +109,11 @@ func TestAPISearchRepo(t *testing.T) {
user2: {count: 7, repoName: "big_test_"},
},
},
{
name: "RepositoriesByName", requestURL: fmt.Sprintf("/api/v1/repos/search?q=%s&private=false", "user2/big_test_"), expectedResults: expectedResults{
user2: {count: 2, repoName: "big_test_"},
},
},
{
name: "RepositoriesAccessibleAndRelatedToUser", requestURL: fmt.Sprintf("/api/v1/repos/search?uid=%d", user.ID), expectedResults: expectedResults{
nil: {count: 5},