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

Dots format outputs only on one line #41

Closed
silvin-lubecki opened this issue Jan 27, 2019 · 7 comments · Fixed by #79
Closed

Dots format outputs only on one line #41

silvin-lubecki opened this issue Jan 27, 2019 · 7 comments · Fixed by #79
Labels
enhancement New feature or request

Comments

@silvin-lubecki
Copy link

While trying the dots format on the docker/cli unit tests, it printed everything on one line

$ GOTESTSUM_FORMAT=dots make test-unit
[some packages listed]
[cli]·····[cli/command/bundlefile]····[cli/command/checkpoint]·······[cli/command/idresolver]·····[cli/command/formatter]··················[cli/command/config]··················[cli/command]···························[cli/command/inspect]···········[cli/command/engine]···············[cli/command/manifest]············[cli/command/context]·······························[cli/command/network]·············[cli/command/container]··········↷·↷··········································································[cli/command/node]························[cli/command/plugin]······························[cli/command/registry]·············[cli/command/service/progress]····[cli/command/secret]···[cli/command/stack/formatter]·················[cli/command/stack/loader]··[cli/command/stack/swarm]·····[cli/command/swarm]·····························[cli/command/service]·····························································[cli/command/task]········[cli/command/stack]······························[cli/compose/interpolation]·····[cli/command/volume]·················[cli/compose/convert]············································[cli/compose/schema]··················[cli/command/trust]····················································································[cli/compose/loader]··········································································································[cli/compose/template]·······················[cli/config]·····················[cli/config/configfile]·············[cli/config/credentials]·············[cli/connhelper/ssh]·[cli/command/image/build]···✖✖·✖[cli/connhelper]·········[cli/command/system]········[cli/debug]···[cli/context/store]············[cli/flags]··[cli/manifest/store]·······[cli/context/kubernetes]···[internal/licenseutils]············[cli/trust]···[cmd/docker]····[internal/pkg/containerized]·[internal/containerizedengine]··········[internal/versions]·········[service/logs]·······[templates]················[cli/command/stack/kubernetes]························[opts]·····························································[cli/command/image]·↷·················✖·····↷·····································

I would have expected a line per package, but maybe I'm missing something with the dots format usage:

[cli]·····
[cli/command/bundlefile]····
[cli/command/checkpoint]·······
[cli/command/idresolver]·····
[cli/command/formatter]··················
[cli/command/config]··················
[cli/command]···························
[cli/command/inspect]···········
[cli/command/engine]···············
[cli/command/manifest]············
[cli/command/context]·······························
[cli/command/network]·············
[cli/command/container]··········↷·↷··········································································
[cli/command/node]························
...
@dnephin
Copy link
Member

dnephin commented Jan 27, 2019

I was hoping to be able to do one package per line as well. When I went to implement the format I noticed that the output from test2json is not necessarily ordered in the way you would expect. The start package event would be sent before the previous test had finished running.

Because of the ordering you'd end up with the dots on each line not matching the tests in the package, which I found to be misleading. The problem still exists with the single line format, but at least that way it doesn't look as much like the dots necessarily match the proceeding package.

I'm not sure if that behaviour has changed in a more recent version of Go. I believe it has to do with go test running multiple packages in parallel by default. I think it's probably worth revisiting to see if there is some way to make it work.

@dnephin dnephin added the enhancement New feature or request label Jan 27, 2019
@silvin-lubecki
Copy link
Author

The problem still exists with the single line format, but at least that way it doesn't look as much like the dots necessarily match the proceeding package.

If I understand that correctly, it means that a test dot can be printed to another package? And so if we have a failing test, it can be printed to a wrong package, then misleading if you try to find the failing test in the wrong package?
If that is the case, I don't think the dot format is really useful 🤔

@dnephin
Copy link
Member

dnephin commented Jan 29, 2019

Ya, it probably isn't. I kept it around hoping there would be some way to fix it.

I think one package per line would be possible by keeping track of which package is on which line and moving the cursor to print on that line, like how download progress clis work, but I expect that would be some work.

@silvin-lubecki
Copy link
Author

keeping track of which package is on which line and moving the cursor to print on that line, like how download progress clis work

Yep I thought about that too

but I expect that would be some work.

Sure it would 😄

@silvin-lubecki
Copy link
Author

Should I close this issue?

@dnephin
Copy link
Member

dnephin commented Jan 29, 2019

I think we should keep it open. It is a good idea, and maybe one day it will get implemented.

@dnephin
Copy link
Member

dnephin commented Dec 14, 2019

I put up #79 which implements this format

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

Successfully merging a pull request may close this issue.

2 participants