-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Fix TrainsLogger doctest failing (switch to bypass mode in GitHub CI) #1379
Fix TrainsLogger doctest failing (switch to bypass mode in GitHub CI) #1379
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1379 +/- ##
======================================
- Coverage 92% 91% -1%
======================================
Files 63 63
Lines 3336 3321 -15
======================================
- Hits 3061 3025 -36
- Misses 275 296 +21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this fix is just for the two CI, but what about other users running test offline?
self._trains = None | ||
print('TRAINS Task: running in bypass mode') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use rather a logger from pytorch_lightning import _logger as log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using "print" to match the behavior of Trains, otherwise the doctest will not match the expected behavior outside of CI testing, don't you think?
@Borda what do you think? If I'll use logging it will break the doctest again, unless we change the documentation (which I'm okay with) ...
pytorch_lightning/loggers/trains.py
Outdated
|
||
:return: If True, all outside communication is skipped | ||
""" | ||
return cls._bypass if cls._bypass is not None else \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this will still fail if a contributor will run it locally without connection, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes working on CI failing
I'm using "print" to match the behavior of Trains, otherwise the doctest will not match the expected behavior outside of CI testing, don't you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to doctest the print statements? Perhaps it is enough to just test the instantiation? Anyway I think having the doctest is already very nice :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@awaelchli the print is to match the expected behavior, so users know what to excepted when everything is working correctly. That said the actual text is printed (stdout) inside Trains package, so my goal was that CI process imitates the Trains prints.
@Borda what do you think? If I'll use logging it will break the doctest again, unless we change the documentation (which I'm okay with) ...
p.s.
CI finally passing, all in bypass mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh right, these prints are the package itself. ok sry :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Borda @williamFalcon again my apologies for not realizing the doctest are executed as part of the CI (after seeing it, I can definitely relate to how annoying tests failing is).
Also, while debugging the CI pipelines I found that the same doctests are executed by three different pipelines: GitHub workflow, Circle, and Drone. Not sure if it is on purpose, but just fyi...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this will still fail if a contributor will run it locally without connection, right?
If users use the TrainsLogger without a connection the Trains package will output an error (it has to have a connection)
That said bypass mode is still supported with:
TrainsLogger.set_bypass_mode(True)
This is still supported with: TrainsLogger.set_bypass_mode(True) |
This PR drops coverage though. Can we fix that? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind making sure this doesn't drop coverage?
Guys, the "Build-Docs" started failing, yesterday it passed on the exact same code base. |
It looks like sphinx got a new release but one of the extensions is not ready for that. |
@awaelchli yes i think as a general rule we should pin versions to prevent upgrading major releases without explicit review
|
@Borda how do you run the codecov bot again? |
you need to re-run Drone CI because only this one is sending the report |
@Borda How do I do that (re-run Drone CI) ? |
4b40eef
to
5ba689c
Compare
Guys, I still can't detect any change in Codecov, is it just me? (The decrease in coverage was due to the CI bypass mode, I think I manage to tell Codecov to ignore it, but I'm uncertain...) Edit: |
@williamFalcon I can't get the Codecov bot to update the new coverage but on the drone log it seems to stay 92% (i.e. no change) |
…Lightning-AI#1379) * Fix TrainsLogger doctest failing (switch to bypass mode in GitHub CI) * fix * test ci * debug * debug CI * Fix CircleCI * Fix Any CI environment switch to bypass mode * Removed debug prints * Improve code coverage * Improve code coverage * Reverted * Improve code coverage * Test CI * test codecov * Codecov fix * remove pragma Co-authored-by: bmartinn <>
Fix TrainsLogger CI doctests failing
See PR #1352 and allegroai/clearml#119
TrainsLogger run in offline (bypass-mode) automatically on GitHub CI doctest.