Skip to content
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

Success output of 'docker compose' command should only be shown when '--info' is passed to Gradle #462

Open
TheoLassonder opened this issue Oct 31, 2024 · 2 comments
Labels

Comments

@TheoLassonder
Copy link

Hi there! The output of "docker compose up" and "docker compose down" appears on the console when running tasks. As an example, this is what you see:

$ ./gradlew SampleApp:test
> Task :SampleApp:composeUp
Will use localhost as host of db
Will use localhost as host of receiver
Will use localhost as host of sender
Will use localhost as host of worker
Probing TCP socket on localhost:5439 of 'db-1'
Waiting for TCP socket on localhost:5439 of 'db-1' (TCP connection on localhost:5439 of 'db-1' was disconnected right after connected)
Will use localhost as host of db
Waiting for TCP socket on localhost:5439 of 'db-1' (TCP connection on localhost:5439 of 'db-1' was disconnected right after connected)
Will use localhost as host of db
TCP socket on localhost:5439 of 'db-1' is ready
Probing TCP socket on localhost:20080 of 'receiver-1'
Waiting for TCP socket on localhost:20080 of 'receiver-1' (TCP connection on localhost:20080 of 'receiver-1' was disconnected right after connected)
Will use localhost as host of receiver
TCP socket on localhost:20080 of 'receiver-1' is ready
+------------+----------------+-----------------+
| Name       | Container Port | Mapping         |
+------------+----------------+-----------------+
| db-1       | 5432           | localhost:5439  |
+------------+----------------+-----------------+
| receiver-1 | 20080          | localhost:20080 |
+------------+----------------+-----------------+

> Task :SampleApp:composeDown
 Container 28619d8325560bc41517cf49d1163b35_dashboard-worker-1  Stopping
 Container 28619d8325560bc41517cf49d1163b35_dashboard-sender-1  Stopping
 Container 28619d8325560bc41517cf49d1163b35_dashboard-worker-1  Stopped
 Container 28619d8325560bc41517cf49d1163b35_dashboard-sender-1  Stopped
 Container 28619d8325560bc41517cf49d1163b35_dashboard-receiver-1  Stopping
 Container 28619d8325560bc41517cf49d1163b35_dashboard-receiver-1  Stopped
 Container 28619d8325560bc41517cf49d1163b35_dashboard-db-1  Stopping
 Container 28619d8325560bc41517cf49d1163b35_dashboard-db-1  Stopped

However, the output should only appear if --info is passed to Gradle, should it not? Otherwise there should be no output at all if the task is successful.

@augi augi added the question label Oct 31, 2024
@augi
Copy link
Member

augi commented Oct 31, 2024

Hi, this Gradle plugin uses lifecycle to report the mentioned messages, and it is intentional. IMHO, this behavior is there from the beginning.

The reason for this is that there operations could take a lot of time, and so someone could get an impression that it is stuck.

@TheoLassonder
Copy link
Author

Sure, the behaviour has been there from the beginning. It just doesn't seem very Gradle-like. Before the tests were dockerized, the output on the console while running the tests was something like this:

$ ./gradlew SampleApp:test

<============-> 92% EXECUTING [59s]
> :SampleApp:test > 81 tests completed
> :SampleApp:test > Executing test tests.Test16

And when the tests completed successfully, the console would show:

$ ./gradlew SampleApp:test

BUILD SUCCESSFUL in 1m 10s
16 actionable tasks: 4 executed, 12 up-to-date
$

If I wanted to see the gory detail I would run the tests with --info. This Gradle plugin would be more Gradle-like if it also behaved like that.

While the "docker compose up" is running, the plugin currently already shows:

$ ./gradlew :SampleApp:test

> Task :SampleApp:composeUp

So it's clear what is going on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants