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

Implement quiet mode with reduced console output (fixes #4) #6

Merged
merged 1 commit into from
Jun 19, 2019

Conversation

f4lco
Copy link
Contributor

@f4lco f4lco commented Jun 3, 2019

Hello there 👋

I'm interested in a quiet mode and make a proposal using the stock logging module. The output format stays the same, in addition to the following behaviors:

  • No additional argument says "verbose output". This is a good default to newcomers and for debugging.
  • -q eliminates all informational output, but keeps displaying all errors / test failures.
  • -qq is dedicated to heavily automated environments, which only rely on the exit code of treon.

@amit1rrr
Copy link
Member

amit1rrr commented Jun 4, 2019

@f4lco Thank you for your contribution. Couple of suggestions,

  • I don't think -qq is required. Even in heavily automated CI system most users would want to have some ability to look at failures etc. We can just keep a single -q/--quiet mode that suppresses all informational output.

  • We should print the result summary even under -quiet mode. Result summary is short and it explicitly shows which notebooks ran under treon. It avoids situation where test script succeeded without actually running anything.

@f4lco
Copy link
Contributor Author

f4lco commented Jun 7, 2019

@amit1rrr I understand. I do like the suggested behavior you just laid out, but I do not think that is how a "quiet" mode supposedly works.

I suggest the following: without arguments, show a minimum about of which notebooks are run, and the result table (compare with pytest, for instance). Have a --verbose option, which includes all the details. What do you think?

@amit1rrr
Copy link
Member

amit1rrr commented Jun 8, 2019

I suggest the following: without arguments, show a minimum about of which notebooks are run, and the result table (compare with pytest, for instance).

I like this. Those two things you mentioned and stack trace in case of failures is a good default. So default output would look something like,

Testing /workspace/keras/overfit.ipynb
<error tracebcks if any>
Testing /workspace/keras/underfit.ipynb
<error tracebcks if any>

<result table>

Have a --verbose option, which includes all the details. What do you think?

Sure. It would have all the output from the default prepended with some more details like below,

Executing treon version 0.1.0
Recursively scanning /workspace/treon/tmp/docs/ for notebooks...

-----------------------------------------------------------------------
Collected following Notebooks for testing
-----------------------------------------------------------------------
/workspace/treon/tmp/docs/tools/templates/subsite/g3doc/tutorials/notebook.ipynb
/workspace/treon/tmp/docs/site/ru/guide/keras.ipynb
/workspace/treon/tmp/docs/site/ru/guide/eager.ipynb

<followed by default output>

--verbose seems a bit superfluous now but if we setup the logging levels as you have done we can add more useful outputs in future that would help with debugging the failures or even treon issues itself.

What do you think?

@sgugger I remember you requesting this feature at one point. I hope this proposal works for you. Feel free to chime in if you have any comments.

@sgugger
Copy link

sgugger commented Jun 9, 2019

This proposal seems great and perfectly in line with what I had suggested at one point!

@f4lco f4lco force-pushed the feature/quiet-mode branch from 0cc4673 to 1809a8a Compare June 17, 2019 13:01
@f4lco
Copy link
Contributor Author

f4lco commented Jun 17, 2019

@amit1rrr finally, seems like we are on the same page now 🙂 I updated the PR accordingly!

Copy link
Member

@amit1rrr amit1rrr left a comment

Choose a reason for hiding this comment

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

Looks good. Couple of minor suggestions.

@f4lco f4lco force-pushed the feature/quiet-mode branch from 1809a8a to 8d8d91c Compare June 19, 2019 07:42
@amit1rrr amit1rrr merged commit c116c5e into ReviewNB:master Jun 19, 2019
@amit1rrr
Copy link
Member

Thanks for the contribution @f4lco. I have merged in the changes. Will update the package on PyPI in some time.

@f4lco
Copy link
Contributor Author

f4lco commented Jun 19, 2019

Thank you very much for your time and patience, @amit1rrr ! Don't worry, it's not urgent 😉

@amit1rrr
Copy link
Member

@f4lco @sgugger FYI, this is release in latest treon version 0.1.2

Thanks!

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.

3 participants