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

Add logs to test command #233

Merged
merged 8 commits into from
Jun 19, 2018
Merged

Add logs to test command #233

merged 8 commits into from
Jun 19, 2018

Conversation

antho1404
Copy link
Member

@antho1404 antho1404 commented Jun 17, 2018

Now the test command also have the logs from the service and the logs from all dependencies with the --logs-all flag

@codecov
Copy link

codecov bot commented Jun 17, 2018

Codecov Report

Merging #233 into dev will decrease coverage by 0.6%.
The diff coverage is 6.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #233      +/-   ##
==========================================
- Coverage   64.26%   63.65%   -0.61%     
==========================================
  Files          75       75              
  Lines        1595     1640      +45     
==========================================
+ Hits         1025     1044      +19     
- Misses        493      513      +20     
- Partials       77       83       +6
Impacted Files Coverage Δ
cmd/service/logs.go 11.11% <0%> (-4.28%) ⬇️
cmd/service/test.go 10.46% <14.28%> (+0.7%) ⬆️
service/start.go 60% <0%> (-3.08%) ⬇️
api/service/emit_event.go 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 496ad16...1824a5b. Read the comment docs.

@antho1404 antho1404 self-assigned this Jun 17, 2018
for _, reader := range readers {
defer reader.Close()
go stdcopy.StdCopy(os.Stdout, os.Stderr, reader)
stdcopy.StdCopy(os.Stdout, os.Stderr, reader)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the goroutine prevents to see the logs from many dependencies..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the goroutine, without having the <-utils.WaitForCancel() in the same function make the function executes the defer reader.Close().
We could return a function close that will call the reader.Close(). What do you think?

for _, reader := range readers {
defer reader.Close()
go stdcopy.StdCopy(os.Stdout, os.Stderr, reader)
stdcopy.StdCopy(os.Stdout, os.Stderr, reader)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the goroutine, without having the <-utils.WaitForCancel() in the same function make the function executes the defer reader.Close().
We could return a function close that will call the reader.Close(). What do you think?

@@ -38,6 +38,7 @@ func init() {
Test.Flags().StringP("event-filter", "e", "*", "Only log the data of the given event")
Test.Flags().StringP("task-filter", "r", "", "Only log the result of the given task")
Test.Flags().StringP("output-filter", "o", "", "Only log the data of the given output of a task result. If set, you also need to set the task in --task-filter")
Test.Flags().BoolP("full-logs", "f", false, "Display logs from service and its dependencies")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The flag full-logs is not explicit enough.
I suggest the name logs-dependencies and as explanation: "Also displays the logs of all service's dependencies".
Also please add this flag in the Example of this command.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logs-dependencies is even more confusing I think because we don't know if we will have only the dependencies or all

Copy link
Member

@NicolasMahe NicolasMahe Jun 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about logs-all ?

@NicolasMahe NicolasMahe merged commit 41c04f0 into dev Jun 19, 2018
@NicolasMahe NicolasMahe deleted the improve-test-command branch June 19, 2018 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants