Skip to content

Assert the avatar endpoints serve images rather than byte counts - #314

Closed
paskal wants to merge 1 commit into
go-pkgz:masterfrom
paskal:fix/go127-image-assertions
Closed

Assert the avatar endpoints serve images rather than byte counts#314
paskal wants to merge 1 commit into
go-pkgz:masterfrom
paskal:fix/go127-image-assertions

Conversation

@paskal

@paskal paskal commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Three tests pin the exact encoded size of a PNG produced by the standard library. Go 1.27 changed the encoder, so the same picture now comes out at a different size and all three fail on a clean checkout with nothing in the repository changed:

test expected actual on Go 1.27
TestIntegrationAvatar 569 507
TestAvatar_PutIdenticon 999 1633
TestAvatar_PutFailed 992 1617

What the avatar path owes its caller is a decodable image within the resize limit, so that is what these check now: decode the bytes, confirm the format, and confirm the dimensions are inside AvatarResizeLimit. The byte count belongs to whichever encoder the Go release happens to ship, and pinning it means the suite breaks on a toolchain bump rather than on a defect.

Mirrored in the root module and v2/ per the project rule for shared behaviour.

Two failures in provider/ (TestCustomProvider, TestDevProvider) are also present on a clean checkout but are unrelated: they are a port collision on 8084 and a hostname that resolves only in some environments. Left alone here.

Three tests pinned the exact encoded size of a PNG the standard library
produces. Go 1.27 changed the encoder, so the same picture now comes out
507 bytes where the test wanted 569, and 1633 and 1617 where it wanted
999 and 992. Nothing in this repository changed and all three fail.

What the avatar path owes its caller is a decodable image within the
resize limit, so that is what they check now. The byte count belongs to
whichever encoder the Go release happens to ship.
@coveralls

coveralls commented Aug 22, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 32584129790

Coverage remained the same at 86.05%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 3699
Covered Lines: 3183
Line Coverage: 86.05%
Coverage Strength: 9.5 hits per line

💛 - Coveralls

@paskal

paskal commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator Author

Folding this into #315 rather than carrying a test-only PR: the same two commits are there, and the Partitioned change needs the fix to have a green CI anyway. Nothing is lost, and there is one PR to review instead of two.

@paskal paskal closed this Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants