Skip to content

test(volume): Add unit tests for volume/volumes.go - #2701

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

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

Conversation

@adity1raut

Copy link
Copy Markdown

Prerequisite checklist

Description of changes

Summary

  • Adds table-driven unit tests for VolumeConfig in unikraft/app/volume/volumes.go
  • Achieves 100% coverage across the entire unikraft/app/volume package

Cases tested

  • All accessor methods: Driver, Source, Destination, Mode, ReadOnly
  • Zero value accessors return correct defaults
  • MarshalYAML with all fields populated
  • MarshalYAML with only source, destination, or driver set
  • MarshalYAML with fully empty config returns nil
  • MarshalYAML with readonly=true/false

Related Issue

Closes #2700

Test plan

  • Run go test ./unikraft/app/volume/... -cover — 100% coverage

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/volumes.go test(app/volume): Add unit tests for volume/volumes.go Mar 9, 2026
@craciunoiuc

Copy link
Copy Markdown
Member

static checks failing

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/volumes.go

3 participants