-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests cleanup/improvements #543
Comments
It's probably self-evident but I will throw it out anyway. I think it would be great too if the testing can be equally easy run locally as it is in the GH runners/testingfarm so that the barrier for new contributors is low. So being able to e.g. run in qemu too, ideally via a single command (once the right test dependencies are installed). |
@henrywang says that packit is the main flow here that builds RPMs and has code to inject them into the test environment. But surely other projects have a flow for this?
Related to this, today the existing tmt code basically implements its own provisioning; it can talk to AWS or libvirt. But tmt's provisioner can do that too! As can podman-bootc. So in theory I could run The containerfile we use for development has incremental builds set up which is really useful. I wouldn't be opposed to giving that up in the short term to gain better tmt integration though. Another related thing here is I'd like to try to move some of the implementation of testing to one where the guest is driving it, not being driven by the host. This is how we do things in coreos-assembler/kola - the host just polls a systemd unit. Notably, there's good support for having the test do reboots because we implement the debian autopkgtest https://manpages.debian.org/bookworm/autopkgtest/autopkgtest.1.en.html API to allow the testbed to reboot. This is super useful for bootc. |
For example, In this case building rpm, bootc install-to-disk, runing disk image with virt-install are all run in local machine. All test required package will be install into local machine by tmt plan. |
Packit can be one of solutions for bootc testing. There're some benefits we can get from Packit solution:
Downsides:
|
The This is a super complex topic of course...how to handle registries in a generic way especially that works locally is messy. One really nice thing about Prow (as used by Kube) is that each CI job runs by default in its own Kubernetes namespace and gets the free ability to push to the internal registry in a nicely scoped/safe way. We don't have that by default with GHA or Testing Farm. We should probably make the registry usage in the tmt tests parameterized, so one can use ghcr.io or whatever too, and probably default to auto-synthesizing tags. Also btw when pushing to quay.io one can use tag expiration to get reliable GC of images. Anyways, it's quite important of course to have coverage with "real" registry pushes, but I think we can do a lot of testing in a fully hermetic/local way with a VMs that don't even have networking, or at least not Internet routing (we do this in coreos-assembler/kola; see e.g. https://github.com/coreos/coreos-assembler/blob/main/docs/kola/external-tests.md#kolajson which includes the In the short term...man, I really want to reuse TMT (or more generally, something someone else has written and maintained) but...argh. I'm still looking at this problem domain; in the short term I did #576 to just clean up that whole framework, but it doesn't cover the "local hermetic VM testing" that I'm getting at here. |
I'm working on test update to add localhost scenario (no push to registry required) with an argv controlled. |
These are things that https://tmt.readthedocs.io/en/stable/ wants, and the goal is to support running under tmt more directly. Part of containers#543 Signed-off-by: Colin Walters <[email protected]>
These are things that https://tmt.readthedocs.io/en/stable/ wants, and the goal is to support running under tmt more directly. Part of containers#543 With this I can run: ``` provision: how: virtual image: /home/walters/src/github/containers/bootc/target/testbootc-cloud.qcow2 summary: Basic smoke test execute: how: tmt script: bootc status ``` Signed-off-by: Colin Walters <[email protected]>
OK #590 pushes things forward here a bit, getting to the point where we have a container image that can be turned into a disk image, that works directly with a simple tmt test. However, the workflow of "build a disk image to pass to tmt" needs automating. I still don't largely understand how the expected workflow of "build code locally to pass to tmt" is expected to generally work. The way e.g. bib builds the container as part of the tests feels...wrong. |
These are things that https://tmt.readthedocs.io/en/stable/ wants, and the goal is to support running under tmt more directly. Part of containers#543 Signed-off-by: Colin Walters <[email protected]>
Part of containers#543 I'm not totally happy with this, but it does demonstrate the basic wiring flow of: - `cargo xtask test-tmt` That will do a container build, make a disk image from it, and run a "hello world" tmt test. A lot more to do here including wiring up our existing tests into this, and deduplicating with the other integration tests. A key aspect too will be exploring workflows that e.g. expose a registry locally. Signed-off-by: Colin Walters <[email protected]>
Part of containers#543 I'm not totally happy with this, but it does demonstrate the basic wiring flow of: - `cargo xtask test-tmt` That will do a container build, make a disk image from it, and run a "hello world" tmt test. A lot more to do here including wiring up our existing tests into this, and deduplicating with the other integration tests. A key aspect too will be exploring workflows that e.g. expose a registry locally. Signed-off-by: Colin Walters <[email protected]>
Part of containers#543 I'm not totally happy with this, but it does demonstrate the basic wiring flow of: - `cargo xtask test-tmt` That will do a container build, make a disk image from it, and run a "hello world" tmt test. A lot more to do here including wiring up our existing tests into this, and deduplicating with the other integration tests. A key aspect too will be exploring workflows that e.g. expose a registry locally. Signed-off-by: Colin Walters <[email protected]>
|
Note, I'm @martinpitt; Another approach which we discussed would be to design this "human/local first" (always good): build an OCI container locally with the modified code, turn that into a qcow, and boot that with qemu (or However, that's hard to deploy to GitHub workflows and standard TF machines, but: @thrix mentioned last week that they offer /dev/kvm support in TF machines now, and even real-iron (I don't have details). Another option is Cirrus CI, they also offer /dev/kvm. Our starter-kit project uses this, mostly as a demo -- but it does boot our standard cockpit bots VM images and runs stuff in them just fine. TF is obviously preferable both in terms of "use our standard tools" and also rate limiting, but maybe it's useful for something. |
teemtee/tmt#3037 makes running tmt locally for me actually bearable. I was really surprised to run out of disk space on this workstation with 2T of local storage. Also auditing this stack, I did https://pagure.io/testcloud/pull-request/174 |
According to @cgwalters and @martinpitt (Hi, long time no see 😊) chatting, we can move integration test (shell + ansible) part to packit but with some changes:
What do you think @cgwalters? Thanks. |
That sounds pretty good to me! |
These are things that https://tmt.readthedocs.io/en/stable/ wants, and the goal is to support running under tmt more directly. Part of containers#543 With this I can run: ``` provision: how: virtual image: /home/walters/src/github/containers/bootc/target/testbootc-cloud.qcow2 summary: Basic smoke test execute: how: tmt script: bootc status ``` Signed-off-by: Colin Walters <[email protected]>
…-simpler Add support for installing static grub configs
man: Add ostree-container-auth
Our testing story is of course scattered. It's time to improve that.
Right now we have important tests being run via github actions bridging to testing farm, which itself is mainly an executor for tmt.
Then there's some github actions usage, plus some tests maintained in the rust sources.
(We also have rust unit tests, but not much can be unit tested in an interesting way here)
The most important thing here is:
Create a streamlined workflow for "build bootc and run key tests locally"
And we have a few avenues to pursue for this. I'd like to make this viable with tmt. We have the hack/Containerfile which builds a bootc-based container image. I'd like to streamline a flow where tmt can do something like run podman-bootc automatically and make a disk image, and then run tests against it with the "classic" model of puppeting over ssh.
The text was updated successfully, but these errors were encountered: