Skip to content

test(volume): Add unit tests for volume/transform.go - #2699

Closed
adity1raut wants to merge 2 commits into
unikraft:stagingfrom
adity1raut:unikraft/app/volume/transform_test.go
Closed

adity1raut wants to merge 2 commits into
unikraft:stagingfrom
adity1raut:unikraft/app/volume/transform_test.go

Conversation

@adity1raut

Copy link
Copy Markdown

…ansform.go

Prerequisite checklist

Description of changes

Summary

  • Adds table-driven unit tests for TransformFromSchema in unikraft/app/volume/transform.go
  • Covers both string and map input formats for volume definitions

Cases tested

  • String with : sets source and destination
  • String without : defaults destination to /
  • String with more than one : returns error
  • Map with all fields (driver, source, destination, readonly)
  • Map with invalid field types (non-string driver/source/destination, non-bool readonly)
  • Empty map and empty string edge cases

Related Issue

Closes #2698

Test plan

  • Run go test ./unikraft/app/volume/... — all 12 tests pass

…ansform.go

Signed-off-by: adity1raut <araut7798@gmail.com>
@github-project-automation github-project-automation Bot moved this to 🧊 Icebox in KraftKit Roadmap Mar 9, 2026
@craciunoiuc craciunoiuc changed the title test(app/volume): add unit tests for volume/transform.go test(app/volume): Add unit tests for volume/transform.go Mar 9, 2026

@craciunoiuc craciunoiuc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good here. Thanks!

Reviewed-by: Cezar Craciunoiu cezar.craciunoiu@unikraft.com
Approved-by: Cezar Craciunoiu cezar.craciunoiu@unikraft.com

@craciunoiuc
craciunoiuc self-requested a review March 9, 2026 15:31
@craciunoiuc

Copy link
Copy Markdown
Member

static checks failing

@adity1raut

Copy link
Copy Markdown
Author

static checks failing

i will update

Signed-off-by: adity1raut <araut7798@gmail.com>
@nderjung nderjung closed this Mar 9, 2026
@github-project-automation github-project-automation Bot moved this from 🧊 Icebox to 🚀 Done in KraftKit Roadmap Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🚀 Done

Development

Successfully merging this pull request may close these issues.

test(app/volume): add unit tests for volume/transform.go

3 participants