You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2022/06/02 22:31:31 UTC
[GitHub] [trafficcontrol] ocket8888 opened a new pull request, #6882: Add a way to use a testing.T for our go-log library in tests
ocket8888 opened a new pull request, #6882:
URL: https://github.com/apache/trafficcontrol/pull/6882
This PR adds the ability to use `(*testing.T).Error` and `(*testing.T).Log` as output streams for the `lib/go-log` library we use for logging.
In some of the TO unit tests, if you try to pass in a request and a response recorder and observe the output, you can wind up just getting back the obtuse `Internal Server Error` message with no further visible information. That's annoying to troubleshoot. With this, you just call `InitTestLogging(t, true)` and all of the messages that use e.g. `log.Debugf` will be printed to the test output (at the appropriate level).
logged errors mark the test as failed, logged warnings optionally do the same
<hr/>
## Which Traffic Control components are affected by this PR?
Nothing, this includes no usage, it just seemed big and self-contained enough to be its own PR separate from anything I may be using it for.
## What is the best way to verify this PR?
Make sure the tests I wrote have adequate coverage, then make sure they pass.
## PR submission checklist
- [x] This PR has tests <!-- If not, please delete this text and explain why this PR does not need tests. -->
- [x] This PR has documentation in the form of GoDoc comments
- [ ] This PR has a CHANGELOG.md entry
- [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY**
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman merged pull request #6882: Add a way to use a testing.T for our go-log library in tests
Posted by "zrhoffman (via GitHub)" <gi...@apache.org>.
zrhoffman merged PR #6882:
URL: https://github.com/apache/trafficcontrol/pull/6882
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] codecov[bot] commented on pull request #6882: Add a way to use a testing.T for our go-log library in tests
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #6882:
URL: https://github.com/apache/trafficcontrol/pull/6882#issuecomment-1736381566
## [Codecov](https://app.codecov.io/gh/apache/trafficcontrol/pull/6882?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#6882](https://app.codecov.io/gh/apache/trafficcontrol/pull/6882?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (b5645a7) into [master](https://app.codecov.io/gh/apache/trafficcontrol/commit/40f0b5754d3888e4d40d0e6e86775333a074ab6d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (40f0b57) will **increase** coverage by `21.54%`.
> The diff coverage is `100.00%`.
```diff
@@ Coverage Diff @@
## master #6882 +/- ##
=============================================
+ Coverage 28.91% 50.45% +21.54%
Complexity 98 98
=============================================
Files 600 334 -266
Lines 77353 22213 -55140
Branches 90 90
=============================================
- Hits 22368 11208 -11160
+ Misses 52892 10042 -42850
+ Partials 2093 963 -1130
```
| [Flag](https://app.codecov.io/gh/apache/trafficcontrol/pull/6882/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [golib_unit](https://app.codecov.io/gh/apache/trafficcontrol/pull/6882/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `53.81% <100.00%> (+0.22%)` | :arrow_up: |
| [grove_unit](https://app.codecov.io/gh/apache/trafficcontrol/pull/6882/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `12.02% <ø> (ø)` | |
| [t3c_unit](https://app.codecov.io/gh/apache/trafficcontrol/pull/6882/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [traffic_monitor_unit](https://app.codecov.io/gh/apache/trafficcontrol/pull/6882/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [traffic_ops_unit](https://app.codecov.io/gh/apache/trafficcontrol/pull/6882/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [traffic_stats_unit](https://app.codecov.io/gh/apache/trafficcontrol/pull/6882/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `10.78% <ø> (ø)` | |
| [unit_tests](https://app.codecov.io/gh/apache/trafficcontrol/pull/6882/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `45.94% <100.00%> (+20.20%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Files](https://app.codecov.io/gh/apache/trafficcontrol/pull/6882?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [lib/go-log/test.logger.go](https://app.codecov.io/gh/apache/trafficcontrol/pull/6882?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bGliL2dvLWxvZy90ZXN0LmxvZ2dlci5nbw==) | `100.00% <100.00%> (ø)` | |
... and [271 files with indirect coverage changes](https://app.codecov.io/gh/apache/trafficcontrol/pull/6882/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org