mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
@@ -109,7 +109,7 @@ fully Go modules compatible, but can be viewed using
|
||||
### Error source
|
||||
|
||||
You can optionally specify an error source that describes from where an
|
||||
error originates. By default it's _server_ and means the error originates
|
||||
error originates. By default, it's _server_ and means the error originates
|
||||
from within the application, e.g. Grafana. The `errutil.WithDownstream()`
|
||||
option may be appended to the NewBase function call to denote an error
|
||||
originates from a _downstream_ server/service. The error source information
|
||||
|
||||
@@ -80,7 +80,7 @@ func doSomething(ctx context.Context) {
|
||||
|
||||
### Enable certain log levels for certain loggers
|
||||
|
||||
During development it's convenient to enable certain log level, e.g. debug, for certain loggers to minimize the generated log output and make it easier to find things. See [[log.filters]](https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#filters) for information how to configure this.
|
||||
During development, it's convenient to enable certain log level, e.g. debug, for certain loggers to minimize the generated log output and make it easier to find things. See [[log.filters]](https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#filters) for information how to configure this.
|
||||
|
||||
It's also possible to configure multiple loggers:
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ Tests must use the standard library, `testing`. For assertions, prefer using [te
|
||||
|
||||
We have a [testsuite](https://github.com/grafana/grafana/tree/main/pkg/tests/testsuite) package which provides utilities for package-level setup and teardown.
|
||||
|
||||
Currently this is just used to ensure that test databases are correctly set up and torn down, but it also provides a place we can attach future tasks.
|
||||
Currently, this is just used to ensure that test databases are correctly set up and torn down, but it also provides a place we can attach future tasks.
|
||||
|
||||
Each package SHOULD include a [TestMain](https://pkg.go.dev/testing#hdr-Main) function that calls `testsuite.Run(m)`:
|
||||
|
||||
@@ -78,7 +78,7 @@ func TestIntegrationFoo(t *testing.T) {
|
||||
|
||||
Use respectively [`assert.*`](https://github.com/stretchr/testify#assert-package) functions to make assertions that
|
||||
should _not_ halt the test ("soft checks") and [`require.*`](https://github.com/stretchr/testify#require-package)
|
||||
functions to make assertions that _should_ halt the test ("hard checks"). Typically you want to use the latter type of
|
||||
functions to make assertions that _should_ halt the test ("hard checks"). Typically, you want to use the latter type of
|
||||
check to assert that errors have or have not happened, since continuing the test after such an assertion fails is
|
||||
chaotic (the system under test will be in an undefined state) and you'll often have segfaults in practice.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user