Repository navigation
Conversation
Builds a minimal helloworld Unikraft project and checks the ELF artifact, then covers build help and two flag-validation errors. Signed-off-by: srinivasr <sriniv4sreddy@gmail.com>
Member
|
hmm, not sure if this test should be added here we already have a test like this building helloworld using kraft in the To justify this, I think it makes sense to add a bit more tests related to how the flags work, not necessarily that the image produced is good |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisite checklist
Description of changes
Ref: #810
Adds e2e tests for
kraft buildintest/e2e/cli/build_test.go, with a small fixture app undertest/e2e/cli/fixtures/helloworld/(Kraftfile,Makefile.uk,helloworld.c). No production code changed.The building context runs
kraft build --plat qemu --arch x86_64once on the fixture, then checks that the kernel image exists and parses as an ELF (ET_EXEC,ELFCLASS32,EM_386), that it contains "Hello world!", and that the.configfile was written. There are also--helpoutput specs and two error cases (nonexistent project dir, invalid--rootfs-type). Five specs in total.The fixture
Kraftfilepins unikraft toba13cc8(unikraft 0.20.0) so the test doesn't change when the stable channel moves. A full commit SHA can't be used because kraft resolvescore/unikraftthrough themanifests.kraftkit.shindex, which only lists 7-character gitshas and channels.This spec compiles a unikernel, so the build specs are slower than the other cli specs and are skipped when not on
linux/amd64, with a 20-minute timeout on the build step.Testing
go test ./test/e2e/cli/ -run TestCli -count=1 -args -ginkgo.focus="kraft build"- 5 passed, 0 failed, 1 pending (pre-existing), 88 skipped.golangci-lint run test/e2e/cli/...- 0 issues.Note: on GCC 15+ hosts the pinned unikraft may fail to build (C23 makes the unprototyped
uk_ctor_func_tcall a hard error);UK_CFLAGS=-std=gnu11works around it locally. CI onubuntu-24.04is unaffected.