You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move docs from knative/serving to knative/pkg (knative#2097)
* Move docs from knative/serving to knative/pkg
While working on tektoncd/pipeline#16
I started trying to build some integration tests, and I wanted to use
the code which had been moved to knative/pkg, but it turned out the docs
hadn't been ported with the code, so I am moving the docs relevant to
knative/pkg/test to that repo.
I also fixed some headings which were duplicated.
Adding docs to knative/pkg in knative/pkg#102
* Fix name of function in docs
lol this one was wrong THE WHOLE TIME SINCE THE VERY FIRST COMMIT where
I used one name in the implementation and a different name in the docs
XD knative@5bc7377
option](README.md#output-verbose-logs), debug logs will be emitted to stdout.
54
-
55
-
We are using the common [e2e logging library](/pkg/test/logging) that uses the [Knative logging library](/pkg/logging/) for structured logging.
56
-
It is built on top of [zap](https://github.com/uber-go/zap). Tests should initialize the global logger to use a test specifc context with `logging.GetContextLogger`:
57
-
58
-
```go
59
-
// The convention is for the name of the logger to match the name of the test.
60
-
logging.GetContextLogger("TestHelloWorld")
61
-
```
62
-
63
-
Logs can then be emitted using the `logger` object which is required by
64
-
many functions in the test library. To emit logs:
65
-
66
-
```go
67
-
logger.Infof("Creating a new Route %s and Configuration %s", route, configuration)
68
-
logger.Debugf("The LogURL is %s, not yet verifying", logURL)
69
-
```
70
-
71
-
_See [logging.go](./logging/logging.go)._
72
-
73
-
### Emit metrics
74
-
75
-
You can emit metrics from your tests using [the opencensus
76
-
library](https://github.com/census-instrumentation/opencensus-go), which [is being
77
-
used inside Knative as well](/docs/telemetry.md). These metrics will be emitted by
78
-
the test if the test is run with [the `--emitmetrics` option](README.md#emit-metrics).
79
-
80
-
You can record arbitrary metrics with
81
-
[`stats.Record`](https://github.com/census-instrumentation/opencensus-go#stats) or
82
-
measure latency with [`trace.StartSpan`](https://github.com/census-instrumentation/opencensus-go#traces):
0 commit comments