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
Automatically testing cross-compiled code with this qemu approach #35
Comments
You should be able to run commands and check their return code inside the VM via SSH. |
Thanks for the hint @lukechilds!! A few things I noticed in case somebody wants to do similar things:
Anyway, thanks for all the work you put into building this nice project @lukechilds! |
Thanks for the update @MartinLoeper! |
Thanks for sharing @MartinLoeper! Could you expand a little bit more how you did this? Looking at the workflow I'm not too sure I 100% understand the process: https://github.com/nesto-software/ProxySuite/blob/dc48fd5e0e4b26982d5dc96129e85c79da468957/.github/workflows/proxy-suite-tests.yml Are all the tests contained in the https://github.com/nesto-software/dockerpi repository? And these are basically jest spec files accessing the serviced RPi docker image via SSH? |
Hi @carlosperate! Sure, let me elaborate on this:
|
Ahhh, I see now, thank you so much for the additional explanation! I went a very similar route (also creating custom images and hosting containers on GH) but I end up running the test steps in the workflow via an SSH Action: https://github.com/mu-editor/mu/blob/3e6632ce51ca929c02acf13d9348377f972ad517/.github/workflows/test.yml#L92-L168 Before I didn't quite see how the tests were separated between repos and run inside the container, but now I understand better your separation between the different repos, thanks!
Yeah, it's pretty crazy the amount of value we get for free with GH Actions. And thanks to dockerpi we can easily emulate other archiectures as well, it still blows my mind 🤯 Thanks @lukechilds and all contributors!
Is that when doing an |
The ssh-action approach looks very nice! How did you accomplish to wait for the pi os image to boot up?
It looks like there is some apt command running during first pi image boot. |
Unfortunately is a very hacky sleep for a given amount of time: https://github.com/mu-editor/mu/blob/3e6632ce51ca929c02acf13d9348377f972ad517/.github/workflows/test.yml#L107 |
I am wondering if it is feasible to run test suites for cross-compiled binaries and installers in the future.
I am currently developing the ProxySuite which has an installer for the raspbian/raspios armhf images.
I would like to add a GitHub workflow which spins up a dockerpi qemu emulator, runs the installer inside, and checks if everything is correctly linked and the binary is loadable. That way, I could make sure that the installer works correctly and the cross-compiled binary is probably runnable on a real pi once installed.
What are your thoughts on this approach?
Is something like executing scripts inside already running qemu machines and getting back the return code on the roadmap upstream?
The text was updated successfully, but these errors were encountered: