test/system: Simplify checking if the container started or not#1367
Conversation
|
Build failed. ✔️ unit-test SUCCESS in 8m 31s |
Bats' 'run' helper is not necessary to merely check if a command succeeded or not [1]. In this case, it's idiomatic to pipe the 'output' directly to grep(1) and use it as the condition for an 'if' branch. [1] https://bats-core.readthedocs.io/en/stable/writing-tests.html containers#1367
... to merely check if a command succeeded or not [1]. [1] https://bats-core.readthedocs.io/en/stable/writing-tests.html containers#1367
40aee85 to
40fd406
Compare
|
Build failed. ✔️ unit-test SUCCESS in 9m 54s |
Bats' 'run' helper is not necessary to merely check if a command succeeded or not [1]. It also complicates using pipes to feed the output of 'podman logs' into grep(1) [1]. In this case, it's idiomatic to pipe the 'output' directly to grep(1) and use it as the condition for an 'if' branch. [1] https://bats-core.readthedocs.io/en/stable/writing-tests.html containers#1367
... to merely check if a command succeeded or not [1]. [1] https://bats-core.readthedocs.io/en/stable/writing-tests.html containers#1367
40fd406 to
5bcb375
Compare
|
Build failed. ✔️ unit-test SUCCESS in 14m 37s |
5bcb375 to
363c3f8
Compare
|
Build failed. ✔️ unit-test SUCCESS in 7m 58s |
martymichal
left a comment
There was a problem hiding this comment.
Straightforward and nicer to read 👍. But makes me wonder whether this function should be merged with start_container() as it does the same with the difference of also ensuring the container did, in fact, start.
Thanks for the review, @HarryMichal ! I have wondered that too. I didn't want to change too many things here, because my main objective here is to be able to enforce |
|
There are still some test failures on Fedora Rawhide. For example: I believe these are because of changes in various other components in Fedora 39, which we need to track down one by one and work out a fix. In the mean time, I am going to temporarily override these failures. |
Bats'
runhelper is not necessary to merely check if a command succeeded or not [1]. In this case, it's idiomatic to pipe the output directly togrep(1)and use it as the condition for anifbranch.[1] https://bats-core.readthedocs.io/en/stable/writing-tests.html