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
x/playground: make the outcome of "Run" clearer #25454
Comments
Maybe something like "all tests passed" / "N tests failed" when running tests and/or examples? |
SGTM. The exit codes may not be needed. The point of the current "Program exited." is that the output is streaming so that line just says "it's done". The exact exit status is not usually terribly interesting. |
My vote: only print non-zero exit status and only when not running tests. Most of the time it's uninteresting but if you do |
@rsc, thanks, I have fixed examples regarding exit status. @jimmyfrasche I will look into that. I have started sketching it and passing exit status might be too tricky to implement without breaking interfaces. Anyway, I will keep that in mind because I like the idea to show "Program exited with the code 3." in case of non zero exit code. |
One format I am not sure about is the messages when program has exited with non-zero status. What do you think is the best?
I am inclined toward the 3rd option. |
Change https://golang.org/cl/141477 mentions this issue: |
Change https://golang.org/cl/141478 mentions this issue: |
The precedence is that |
Ok good. I somehow missed that new stuff. It was decided already, I will use it. |
This CL changes the last line displayed after the program was run to display more details on what happened. If the program cannot be built, the last message is "Go build failed". If the program has tests, the last message is "All tests passed" in case of success. Otherwise it is "N tests failed". If the program has exited with non-zero code, the exit message is postfixed with the code. This CL adds output for timed out programs. This CL is prerequisite for the backend change in CL 141478. Dockerfile in playground repo has to be updated to include this CL. Updates golang/go#10590 Updates golang/go#25454 Change-Id: Ie0a51b0729c574d2508a4a1b89f629def1d79fd6 Reviewed-on: https://go-review.googlesource.com/c/141477 Reviewed-by: Andrew Bonventre <andybons@golang.org>
This CL changes the last line displayed after the program was run to display more detail on what happened. For more details see CL 141477. Dockerfile in playground repo needs to be updated to include x/tools with CL 141477. Updates golang/go#10590 Updates golang/go#25454 Change-Id: I6bdef66e70d693540e4e7d30478ae9f0bf85d1ba Reviewed-on: https://go-review.googlesource.com/c/141478 Reviewed-by: Andrew Bonventre <andybons@golang.org> Run-TryBot: Andrew Bonventre <andybons@golang.org>
Change https://golang.org/cl/142637 mentions this issue: |
Updates golang/go#10590 Updates golang/go#25454 Change-Id: I807608979062f57268bf2b80edbd37d88e74b8f7 Reviewed-on: https://go-review.googlesource.com/c/142637 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@dmitshur, this ticket can be closed after the deployment. |
Change https://golang.org/cl/144078 mentions this issue: |
New fields were added to the response struct in CL 141478. That was not accounted in the TestCommandHandler test. This CL fixes the test by adding required fields. Updates golang/go#25454 Change-Id: I374cef6199235d781bd83a60156ca4f0d90898ee Reviewed-on: https://go-review.googlesource.com/c/144078 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Yury Smolsky <yury@smolsky.by> Reviewed-by: Katie Hockman <katie@golang.org>
@ysmolsky It's deployed now. Thank you! |
Currently playground ends every output with "Program exited.".
It is confusing because sometimes program was not run at all.
I propose the behaviour below.
In case of success:
Vet errors and successful run of a program:
In case of failed compilation:
In case of failed test:
In case of program timeout. Display the recorded output before the program was killed. This might require returning both Errors and Events fields. #10590
Bonus parts (implement in that does not break /compile interface):
UP: removed exit status from proposal.
UP2: added bonus parts
The text was updated successfully, but these errors were encountered: