fix: misc fixes in pub/gpg/tests (#38809)

- The pub registry reported the oldest version as `latest`, because the
descriptor slice is sorted ascending but the first element was used.
- Verifying a GPG or SSH key flashed success and redirected after
already writing an error response, so a failure was reported as a
success with an empty key id.
- Test packages sharing redis could tear down each other's server.
`PrepareTestRedis` started its own on the well-known port, so a package
running in parallel borrowed it and lost it when the owner's cleanup
fired. It now listens on a socket of its own.
This commit is contained in:
silverwind
2026-08-07 13:49:23 +02:00
committed by GitHub
parent dd8ef9c888
commit ec869e3052
6 changed files with 54 additions and 67 deletions
+1 -1
View File
@@ -108,7 +108,7 @@ func EnumeratePackageVersions(ctx *context.Context) {
jsonResponse(ctx, http.StatusOK, &packageVersions{
Name: pds[0].Package.Name,
Latest: packageDescriptorToMetadata(baseURL, pds[0]),
Latest: versions[len(versions)-1], // versions mirrors pds, sorted ascending
Versions: versions,
})
}