Skip to content

Commit

Permalink
Add unit tests for NewView
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Nov 10, 2022
1 parent bdde868 commit 81b8f8e
Show file tree
Hide file tree
Showing 2 changed files with 523 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sdk/metric/pipeline_registry_test.go
Expand Up @@ -369,6 +369,7 @@ func TestPipelineRegistryCreateAggregatorsIncompatibleInstrument(t *testing.T) {
type logCounter struct {
logr.LogSink

errN uint32
infoN uint32
}

Expand All @@ -381,6 +382,15 @@ func (l *logCounter) InfoN() int {
return int(atomic.SwapUint32(&l.infoN, 0))
}

func (l *logCounter) Error(err error, msg string, keysAndValues ...interface{}) {
atomic.AddUint32(&l.errN, 1)
l.LogSink.Error(err, msg, keysAndValues...)
}

func (l *logCounter) ErrorN() int {
return int(atomic.SwapUint32(&l.errN, 0))
}

func TestResolveAggregatorsDuplicateErrors(t *testing.T) {
tLog := testr.NewWithOptions(t, testr.Options{Verbosity: 6})
l := &logCounter{LogSink: tLog.GetSink()}
Expand Down

0 comments on commit 81b8f8e

Please sign in to comment.