buildkite-plugins / docker-compose-buildkite-plugin

🐳⚡️ Run build scripts, and build + push images, w/ Docker Compose
MIT License
172 stars 139 forks source link

@test "Run with --quiet-pull" should not pass #397

Closed Songyu-Wang closed 1 year ago

Songyu-Wang commented 1 year ago

Hello, I recently added the quiet pull test as part of https://github.com/buildkite-plugins/docker-compose-buildkite-plugin/pull/387 with this line refute_output --partial "Pulling" I thought the quiet pull option will remove the event log for pulling events. After deploying the new version of the plugin, I realized this assumption is not correct. Please see https://github.com/docker/compose/issues/10686 I raised for details

This issue was not caught at development because the refute_output line somehow passed. I'm not exactly sure how and why this got escaped, but I think you may want to take a look

toote commented 1 year ago

@Songyu-Wang as you mentioned, the fact that logging is still shown in the output is a bug with the underlying docker compose implementation. The fact that the test passes arises from the stubbing of the docker compose commands. That means that the actual docker compose command is never run and the specified bash commands do so instead.

That said, there is an issue with the test itself: the refute_output --partial "Pulling" line is not actually testing anything. The actual verification in that test is that the command recieves the --quiet-pull option. If that was not the case, the test would fail as the command ran would not match the mock. I don't think that there is much that can be done in the plugin to correct that behaviour other than removing the refute_output line that is not doing anything :shrug:

Songyu-Wang commented 1 year ago

Ah that makes sense, I just pattern matched the other test without realizing everything is stubbed. Thanks for the explanation