Add list and prune commands (simplified version)#253
Conversation
d674890 to
3591add
Compare
| _common_setup | ||
| } | ||
|
|
||
| @test "'cqfd images' lists the build containers" { |
There was a problem hiding this comment.
if bats tries to run these tests in parallel, they won't work.
Put all of these in a sequential test instead?
There was a problem hiding this comment.
actually bats is running the tests sequentially, do you think I should make this explicit ?
There was a problem hiding this comment.
bats has some arguments to select which tests to run, so it would also break the sequence.
Even though today we always run all of them, sequentially, in the CI, I think it would be a better practice to group sequential dependencies in a single test.
There was a problem hiding this comment.
I tried to parallelize tests in another PR #255 but it has a lot more issues than this one, and I think that it would be part of a refactor of the tests but it does not add a lot of value compared to the current system.
So I think I will leave it like that to be consistent with the other tests, and I may try to parallelize the tests in another PR at some point
There was a problem hiding this comment.
Why not putting all the code in one single test? That way we ensure it is run sequentially.
There was a problem hiding this comment.
Yes, but we lose atomicity in the tests. It is useful to know which command makes a test fail.
If we have 4 different tested commands in one @test, and if one of them fail we won’t know which one makes the test fail. Having four different tests makes it possible to know which exact command fail.
If we want the tests to run sequentially, then we can add export BATS_NO_PARALLELIZE_WITHIN_FILE=true to the setup_file function
There was a problem hiding this comment.
I would argue that bats would still report which assert failed, so you know exactly what failed. And anyway, if one step failed, the following ones would also fail, so you can only get a more confusing output by having a split test IMO.
BATS_NO_PARALLELIZE_WITHIN_FILE does sound like an alternative improvement also.
Anyway, the CI doesn't care since it always runs everything and does so sequentially, so I'll approve the PR this way. I think we spent enough time on a problem that we probably won't face.
f990dd6 to
1d625d1
Compare
Add command `images` to list all cqfd user build container images and `prune` to clean those images
1d625d1 to
9ec8391
Compare
this is a potential alternative to #251 which does not keep a cache of the running images but cleans every image which is starting by
cqfd_$USERon the host