-
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
boundimage: Add tmt tests for bound images #729
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sane to me! Just one nonblocking nit
initial_setup | ||
|
||
# build a bootc image that includes bound images | ||
let images = echo [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The echo
here shouldn't be necessary, in nushell I think it's basically a no-op. It notably doesn't convert the argument to a string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Here and a variety of other places)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah - I'll clean these up before merging
At the end of doing this, what did you think? I personally ended up somewhat ambivalent about the nushell usage for tests...my overall feeling was I could have written 70% of it faster in bash, except there's that 20% where you want to parse some JSON or operate on arrays and I need to go look up syntax and about 10% of horrible bash pitfalls. |
I like it, I think these will be way easier to maintain in the long run. It was a little frustrating digging through the nu shell docs at times and chat gpt (and other llms) wasn't very helpful. Still, after the initial (relatively low) learning curve I think this a lot nicer than bash. I eventually got familiar enough with testing stuff directly in a nu shell prompt which seems more ergonomic than zsh or bash. I'll probably switch over to it as my main shell soon. |
marking this as a draft because I started seeing some odd behavior related to handling reboots. I ran out of time today to figure out the cause and I'll be AFK for awhile. AFAICT the problem is that on each reboot all of the nu shell tmt tests run. So, trying to read the reboot count in each test gets tricky. I think for now we could just dump all the tests in a single file, but we probably want to isolate each test to a separate VM and run them in parallel or something. |
Oh wow...yes, oops.
Yes, this is quite doable, I'll take a look at figuring out the relevant tmt incantations. |
Let's track this issue here #735 |
Want to try rebasing on top of #736 ? It will require something like:
(Which will become our new SOP for destructive tests unfortunately) |
These tests validate the basic use case of switching and upgrading an image with bound images that need to be pulled. Signed-off-by: Chris Kyrouac <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- rebased on main
- Added a fmf wrapper per new test SOP
- dropped the unnecessary
echo
(btw: doing so made the LSP plugin correctly do type inference! While nushell is somewhat obscure it's at least got a functioning language server and also functioning type inference; very unlikely to happen for bash...)
tests/booted/test-logically-bound.nu
Outdated
null | "0" => first_boot, | ||
null | "1" => second_boot, | ||
null | "2" => third_boot, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last two null
here are unreachable (only the first can match), a bit surprising nu doesn't error on this. I've updated the code to drop them.
🎉 |
Skip `UEFI` or `BIOS` on none hybrid partition layout
These tests validate the basic use case of switching and upgrading an image with bound images that need to be pulled.