The pkg/unikontainers/unikernels package sits at 9.5% statement coverage. mirage.go and mewz.go have test files, and the rest of the guest implementations have none.
Uncovered functions per file, from go tool cover -func:
| File |
Functions at 0.0% |
Test file |
linux.go |
13 |
none |
unikraft.go |
9 |
none (being addressed in #921) |
rumprun.go |
8 |
none |
hermit_rs.go |
8 |
none |
mewz.go |
7 |
partial |
mirage.go |
4 |
partial |
I would like to start with rumprun.go. It is the guest family I have been running while working through the Argo integration in #573, so the cases would come from behaviour I have watched in a cluster.
All eight of its functions are pure, with no I/O or syscalls, which makes them straightforward to cover in the table-driven style already used by mirage_test.go and mewz_test.go:
CommandString builds the JSON boot configuration
Init maps UnikernelParams onto the struct
SupportsFS gates ext2 against other filesystems, which matters because the block rootfs path in rootfs.go:233 depends on it
MonitorNetCli, MonitorBlockCli and MonitorCli build monitor arguments
SupportsBlock and newRumprun
Recent fixes in this area suggest the cases are worth pinning down. #823 was a subnet mask handled incorrectly in argument construction, and #747 was a redundant monitor branch. Both are the kind of thing a table test catches.
Happy to open a PR for rumprun.go if this is useful, and to follow with linux.go and hermit_rs.go if the approach looks right. Checking first in case the scope is not what you want.
The
pkg/unikontainers/unikernelspackage sits at 9.5% statement coverage.mirage.goandmewz.gohave test files, and the rest of the guest implementations have none.Uncovered functions per file, from
go tool cover -func:linux.gounikraft.gorumprun.gohermit_rs.gomewz.gomirage.goI would like to start with
rumprun.go. It is the guest family I have been running while working through the Argo integration in #573, so the cases would come from behaviour I have watched in a cluster.All eight of its functions are pure, with no I/O or syscalls, which makes them straightforward to cover in the table-driven style already used by
mirage_test.goandmewz_test.go:CommandStringbuilds the JSON boot configurationInitmapsUnikernelParamsonto the structSupportsFSgates ext2 against other filesystems, which matters because the block rootfs path inrootfs.go:233depends on itMonitorNetCli,MonitorBlockCliandMonitorClibuild monitor argumentsSupportsBlockandnewRumprunRecent fixes in this area suggest the cases are worth pinning down. #823 was a subnet mask handled incorrectly in argument construction, and #747 was a redundant monitor branch. Both are the kind of thing a table test catches.
Happy to open a PR for
rumprun.goif this is useful, and to follow withlinux.goandhermit_rs.goif the approach looks right. Checking first in case the scope is not what you want.