Skip to content

test: add BuildFlavorVersion unit tests - #503

Merged
freggy merged 4 commits into
spacechunks:mainfrom
ktrubilo9:test/build-flavor-version
Sep 22, 2026
Merged

freggy merged 4 commits into
spacechunks:mainfrom
ktrubilo9:test/build-flavor-version

Conversation

@ktrubilo9

Copy link
Copy Markdown
Contributor

Summary

Adds unit tests for BuildFlavorVersion.
The test verify that:

  • file hashes are computed from the uploaded changeset and passed to the repository,
  • required repository calls are executed,
  • missing uploaded files return ErrFlavorFilesNotUploaded,
  • hash computation is skipped when files are already marked as uploaded.

Also adds a small test helper for creating in-memory tar.gz changeset used by the hash computation path.

Testing

go test ./controlplane/chunk -run TestBuildFlavorVersion -count=1 -v

Closes #487

@ktrubilo9
ktrubilo9 requested a review from freggy as a code owner September 22, 2026 15:43
Comment thread controlplane/chunk/flavor_test.go Outdated
Comment thread controlplane/chunk/flavor_test.go Outdated
@freggy

freggy commented Sep 22, 2026

Copy link
Copy Markdown
Member

thank you very much for your contribution @ktrubilo9! :) I reviewed your PR and left some comments.

@ktrubilo9

Copy link
Copy Markdown
Contributor Author

Thanks for review, I've addressed both comments, replaced the helper with test.CreateTarGz and added comparisions againts xxh3 hashes of the file contents. Also fixed the lint issue.

@freggy

freggy commented Sep 22, 2026

Copy link
Copy Markdown
Member

great, thanks! i'll merge once ci passes

@freggy
freggy merged commit 809b6d7 into spacechunks:main Sep 22, 2026
7 of 8 checks passed
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.

Add unit test for BuildFlavorVersion endpoint

2 participants