* Various cleanups around the codebase
- unindent the else after return
- make things private that are not used anywhere
- rearrange params
- etc
* add
* Remove unused code.
* Use raw strings to avoid escaping.
* Remove unneeded type conversions.
* Preallocate slices where possible.
* Use semantic equality in psbinding reconciler.
* Create TLogger, bringing leveled logging to tests
Inspired heavily by go-logr, brings leveled logging to tests while
using the highly reliable zap logger backend to fulfill writing to
multiple log files.
Now that metrics logger has been removed, SetupLoggingFlags() is redundant. Moved to test/logging
* Cleanup TLogger and document
Add TLogger.Collect() to support collecting outcomes (either positive
strings or error types) which will be processed in a subtest upon
completion of the currently-running (sub-)test.
StructuredError prints its output in a more-readable form now.
Call-site should now work for .Log/.Logf-using functions.
Use cancel from NewTLogger instead of t.CleanUp()
Use a zapcore SpewEncoder when writing to testing.T
Means even non-json-encodable structs will get printed to the test log
output, while preserving encodable structured output for other log files.
Removed timestamp from printing to t.Log
* Fix the automatically-detected issues
Spelling, codegen, some coverage (coverage of memory_encoder.go should
not be necessary but the coverage tool is broken and needs to be fixed).
* Increase unit test coverage slightly and fix tiny comment
* Set attribute the way the coverage program wants
* Cleanup based on notes
* Comment cleanup and privitize var
* Mistake; left purposely-failing tests enabled
* Reduce long lines
* Consolidate cleanup code; make variable expressive
* Cleanup and bugfix
Failing functions now tested by having an internal constructor
option to skip calls to t.Fail()/t.FailNow().
Fixed some bugs with internal method errorWithRuntimeCheck and added
tests for it.
Address minor typos from comments.
* Tiny name/optimization fixes
* Metrics logging fix in pkg/test: Issue-3150
https://github.com/knative/serving/issues/3150 describes the issue
that currently exists in our test logging framework. This change
fixes the problem by prefixing metrics that needs to be emited by
a constant which the logging.ExpoxtSpan method then uses to identify
the spans that needs to be emitted as logs
Note this only fixes part of the issue:
https://github.com/knative/serving/issues/3150
this change needs to be ported to knative serving before the issue
can be closed.
* Update test/logging/logging.go
Adding required lines.
Co-Authored-By: dushyanthsc <43390008+dushyanthsc@users.noreply.github.com>