Skip to content

test(unikraft/core): A: Add unit tests for core package - #2707

Closed
adity1raut wants to merge 1 commit into
unikraft:stagingfrom
adity1raut:unikraft/core/core_test.go
Closed

adity1raut wants to merge 1 commit into
unikraft:stagingfrom
adity1raut:unikraft/core/core_test.go

Conversation

@adity1raut

Copy link
Copy Markdown

Prerequisite checklist

Description of changes

Summary

  • Adds unit tests for unikraft/core package achieving 82% coverage
  • All options, accessors, path helpers, and schema transforms are fully covered

Functions tested (100%)

  • All UnikraftConfig accessors: Name, String, Source, Version, License,
    Compiler, CompileDate, CompiledBy, CompiledByAssoc, Type, Path
  • IsUnpacked — existing dir, non-existent, empty path
  • KConfig — nil map, populated map
  • All CONFIG_* path helpers
  • MarshalYAML — with and without kconfig
  • PrintInfo, KConfigTree error path
  • All options: WithVersion, WithSource, WithPath, WithKConfig,
    WithLicense, WithCompiler, WithCompileDate, WithCompiledBy, WithCompiledByAssoc
  • NewUnikraftFromOptions — with UK_BASE context, option returning error
  • TransformFromSchema — version string, URL source, local dir, kconfig, error paths
  • Libraries — non-existent path (nil), empty lib/plat dirs
  • Constants: MakeDelimeter, VerboseQuiet, VerboseBuild, VerboseExtra

Note

Libraries (43%) and KConfigTree (75%) happy paths require a real
Unikraft source tree with Config.uk files — not testable in isolation.

Related Issue

Closes #2706

…verage

Signed-off-by: adity1raut <araut7798@gmail.com>
@github-project-automation github-project-automation Bot moved this to 🧊 Icebox in KraftKit Roadmap Mar 9, 2026
@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(unikraft/core): Add unit tests for core package to achieve 100% coverage

2 participants